fix(codex): resume account switches without blanking the terminal (#25485)

fix(codex): restart account switches without blanking or repinning the pane

Integrate the atomic pane replacement from #24350 and adapt the explicit
conversation resume from #14877. Keep terminal protocol replies flowing
while account notices block user input. Ordinary restores retain provenance.

Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
Co-authored-by: itisvincent <vincentcgamer@gmail.com>
Co-authored-by: rayim <rayim@fxy.global>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Neil
2026-10-05 01:51:49 -07:00
committed by GitHub
co-authored by Brennan Benson itisvincent rayim Claude Fable 5
parent b3328390f9
commit 40f9e7a3fc
26 changed files with 1752 additions and 95 deletions
@@ -86,6 +86,32 @@ export async function prepareLegacySharedCodexSessionResume(
return { useRealCodexHome: true }
}
/** Explicit account restarts must move the verified rollout before changing credentials. */
export async function prepareCodexAccountRestartResume(args: {
sourceHome: string
transcriptPath: string
targetHome: string
systemCodexHomePath: string
}): Promise<string> {
if (sameRuntimePath(args.sourceHome, args.targetHome)) {
return args.targetHome
}
const relativePath = relative(
resolve(join(args.sourceHome, 'sessions')),
resolve(args.transcriptPath)
)
if (!isDatedRolloutRelativePath(relativePath)) {
throw new Error(RETRYABLE_RESUME_ERROR)
}
const paths = resolveCodexSessionBackfillPaths(args.systemCodexHomePath)
await materializeLegacyRollout(
args.transcriptPath,
join(args.targetHome, 'sessions', relativePath),
paths.auditLogPath
)
return args.targetHome
}
/**
* Repins a per-account resume to the selected account's home, or null to keep
* the session's own home.