fix(native-chat): keep structured recovery provider-neutral

This commit is contained in:
Brennan Benson
2026-08-12 18:46:05 -07:00
parent 20c2deda29
commit 1377932db3
4 changed files with 2 additions and 42 deletions
@@ -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 }
-34
View File
@@ -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) {
@@ -102,12 +102,6 @@ async function install(deps: StructuredAgentSessionRuntimeDeps): Promise<Install
adapter,
journalRoot: deps.stateDirectory,
claimKeyId: deps.claimKeyId,
...(deps.resolveClaudeLaunchEnv
? {
resolveLaunchEnv: (provider) =>
provider === 'claude' ? deps.resolveClaudeLaunchEnv?.() : undefined
}
: {}),
probeOwner: createStructuredAgentSessionOwnerProbe(deps.hostId),
onEventSinkError: ({ sessionId, error }) =>
deps.onError?.({ scope: `structured-agent-session-journal:${sessionId}`, error }),
+1 -1
View File
@@ -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…",