mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-27 05:41:23 +00:00
feat(codex): share sessions across terminal and web
Use one native app-server for terminal, Web and phone clients while retaining the existing CLI and Runner lifecycle. Synchronize native queues, permissions, question history and steering state; preserve explicit permission precedence and per-turn usage models. Resume inactive clear commands through Runner and reject independent child cold resumes. Add shared-runtime regression tests, generated protocol fixtures and lifecycle documentation.
This commit is contained in:
@@ -37,6 +37,7 @@ function isClaudeSession(metadata: SessionMetadataSummary | null): boolean {
|
||||
}
|
||||
|
||||
function formatPermissionSummary(permission: ToolPermission, toolName: string, toolInput: unknown, codex: boolean, t: (key: string) => string): string {
|
||||
if (permission.status === 'resolved') return t('tool.resolved')
|
||||
if (permission.status === 'pending') return t('tool.waitingForApproval')
|
||||
if (permission.status === 'canceled') return permission.reason ? `${t('tool.canceled')}: ${permission.reason}` : t('tool.canceled')
|
||||
|
||||
@@ -203,6 +204,8 @@ export function PermissionFooter(props: {
|
||||
setLoading(null)
|
||||
}
|
||||
|
||||
if (permission.status === 'resolved') return <div className="mt-2 text-xs text-[var(--app-hint)]">{t('tool.resolved')}</div>
|
||||
|
||||
if (!isPending) {
|
||||
// Keep the thread minimal: approval is already reflected by tool state/icon.
|
||||
// Only surface a short message when the permission was denied/canceled and we have a reason.
|
||||
|
||||
@@ -443,7 +443,7 @@ function ToolCardInner(props: ToolCardProps) {
|
||||
const isRequestUserInput = isRequestUserInputToolName(toolName)
|
||||
const isQuestionTool = isAskUserQuestion || isRequestUserInput
|
||||
const showsPermissionFooter = Boolean(permission && (
|
||||
permission.status === 'pending'
|
||||
permission.status === 'resolved' || permission.status === 'pending'
|
||||
|| ((permission.status === 'denied' || permission.status === 'canceled') && Boolean(permission.reason))
|
||||
))
|
||||
const hasBody = showInline || taskSummary !== null || showsPermissionFooter
|
||||
|
||||
Reference in New Issue
Block a user