From 1377932db383002ea2bb7a11f9b803218d6ea0a6 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Wed, 12 Aug 2026 18:46:05 -0700 Subject: [PATCH] fix(native-chat): keep structured recovery provider-neutral --- .../structured-agent-session-handoff.test.ts | 2 +- src/main/runtime/orca-runtime.ts | 34 ------------------- .../structured-agent-session-runtime.ts | 6 ---- src/renderer/src/i18n/locales/en.json | 2 +- 4 files changed, 2 insertions(+), 42 deletions(-) diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-handoff.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-handoff.test.ts index d5bc04b8f9a..25e97620579 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-handoff.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-handoff.test.ts @@ -72,7 +72,7 @@ function operationId(): string { function request( direction: AgentSessionHandoffDirection, mode: AgentSessionHandoffMode, - options: { action?: 'start' | 'cancel-queued' | 'retry'; operationId?: string } = {} + options: { action?: 'start' | 'cancel-queued' | 'retry' | 'recover'; operationId?: string } = {} ): AgentSessionHandoffRequest { const action = options.action ?? 'start' const fields = { direction, mode, action } diff --git a/src/main/runtime/orca-runtime.ts b/src/main/runtime/orca-runtime.ts index e447123215f..05cf985f2b4 100644 --- a/src/main/runtime/orca-runtime.ts +++ b/src/main/runtime/orca-runtime.ts @@ -9362,40 +9362,6 @@ export class OrcaRuntimeService { } } - private recoverClaudeStructuredTuiProof(input: { - candidate: RuntimePtyWorktreeRecord - sessionId: string - spawnToken: string - }): { transcriptPath: string } { - const paneKey = input.candidate.paneKey - if (!paneKey) { - throw new Error('The owning Claude terminal did not retain its pane identity.') - } - if (this.restoredOrchestrationAuthorityByPtyId.has(input.candidate.ptyId)) { - const attestation = this.attestAgentHookCompatibilityAuthorityFn?.({ - paneKey, - launchTokenHash: createHash('sha256').update(input.spawnToken).digest('hex'), - connectionId: input.candidate.connectionId, - terminalProvenance: 'restored' - }) - if (attestation?.paneKey !== paneKey) { - throw new Error('The owning Claude terminal did not retain launch-token authority.') - } - } - const matches = (this.getAgentProviderSessionRowsForPaneFn?.(paneKey) ?? []).filter( - (row) => - row.paneKey === paneKey && - row.connectionId === input.candidate.connectionId && - row.providerSession?.key === 'session_id' && - row.providerSession.id === input.sessionId && - Boolean(row.providerSession.transcriptPath) - ) - if (matches.length !== 1) { - throw new Error('The owning Claude terminal did not retain a unique resume proof.') - } - return { transcriptPath: matches[0]!.providerSession!.transcriptPath! } - } - private refreshStructuredTuiOwnerBinding(owner: StructuredTuiOwner): StructuredTuiOwner { const pty = this.ptysById.get(owner.terminal.ptyId) if (!pty?.connected) { diff --git a/src/main/runtime/structured-agent-session-runtime.ts b/src/main/runtime/structured-agent-session-runtime.ts index 3621c63a8c7..09088144fbd 100644 --- a/src/main/runtime/structured-agent-session-runtime.ts +++ b/src/main/runtime/structured-agent-session-runtime.ts @@ -102,12 +102,6 @@ async function install(deps: StructuredAgentSessionRuntimeDeps): Promise - provider === 'claude' ? deps.resolveClaudeLaunchEnv?.() : undefined - } - : {}), probeOwner: createStructuredAgentSessionOwnerProbe(deps.hostId), onEventSinkError: ({ sessionId, error }) => deps.onError?.({ scope: `structured-agent-session-journal:${sessionId}`, error }), diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index a3694ae72f4..5fbad271cfc 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -15031,7 +15031,6 @@ "sshConnectVerb": { "reconnect": "Reconnect", "retry": "Retry", - "retryProof": "Retry proof", "connect": "Connect", "connecting": "Connecting…" } @@ -15139,6 +15138,7 @@ "exitTerminal": "Exit the agent terminal to continue in chat.", "switchingOwner": "Switching session owner…", "retry": "Retry", + "retryProof": "Retry proof", "details": "Details", "stage": { "finishingChat": "Finishing chat session…",