Skip to content

feat(history): continue Codex and Claude sessions with explicit accounts - #44217

Draft
cianpixel wants to merge 40 commits into
stablyai:mainfrom
cianpixel:split/session-continuations
Draft

cianpixel wants to merge 40 commits into
stablyai:mainfrom
cianpixel:split/session-continuations

Conversation

@cianpixel

@cianpixel cianpixel commented Nov 18, 2026 •

Copy link
Copy Markdown

ELI5

Resume a conversation using its last successful account, or explicitly choose another account when the workspace default differs. Continuing on another account creates an independent transcript copy and keeps the original conversation intact.

What Changed

  • Show conversation versions across account homes without guessing the last-used login from the storage folder. First-time or ambiguous resumes ask for an account.
  • Compare the last successful account with the workspace's effective account, including inherited host default and explicit System default selections.
  • Validate the chosen account and workspace on the owning host, prepare an independent continuation when needed, and record a successful open only after terminal launch succeeds.
  • Carry the validated History receipt through terminal preparation before legacy resume can retarget a worktree pane to the host account. Preserve provider-session metadata, pinned-home environment handling and credential-readiness checks.
  • Prepare legacy local Codex saved-pane restores through the existing History account chooser before spawning. Preserve custom launch settings, use the chosen continuation ID and receipt, retain cancelled sessions and record only a successful terminal open. Private-home and remote restore paths remain unchanged.
  • Keep optional Codex/Claude history import and continuation lineage in this PR, separate from credentials-only Codex home import.

Why

Account changes should not hide conversations or silently run a resume using the host's credentials. A verified History choice must remain the launch account when replacing a worktree pane.

Linked Issue

Fixes #44175

Dependencies and review scope

Depends on #43190 (Codex credentials-only home import) and #44185 (workspace accounts). The fork preserves the integrated feature set. Rebase onto the merged prerequisites and review the narrowed diff before marking this PR Ready for review.

Visual Proof

The before image below is an earlier captured History implementation. After and account-choice images were refreshed from 0c3b009341 on Windows: 360px History frame and 1280x900 chooser viewport, dark theme. All accounts and timestamps are synthetic (the fixture intentionally includes an epoch timestamp); these are component checks, not authenticated end-to-end evidence.

Before: separate transcript rows After: conversation versions
Earlier History without recorded continuation lineage History groups versions and shows last-used account

Explicit account choice before continuing

Consistent workspace account selection

The workspace picker uses the same account source as usage. Each account appears once, with a Host default label identifying the inherited account. This shared UI is implemented in prerequisite #44185.

Before: separate inheritance row After: one row per account
Previous workspace picker Unified account picker

Unified account picker in light theme

The latest picker captures use synthetic accounts in headless component fixtures; both rendered without page errors. They are not authenticated end-to-end evidence.

Testing

  • The receipt-to-terminal regression suite passed five cases: chosen account differing from host, missing host credentials, ordinary non-History resume, invalid receipt refusal, and missing chosen-account credentials refusal.
  • The combined planner, discovered-home and terminal preparation suites passed 14 tests across three files. The developer build's non-host worktree resume was also verified by the user.
  • The final integrated focused run passed 49 tests across 13 files, covering account routing, usage, workspace choices, discovered homes and History receipts. No full-suite success is claimed for the broad related-unit selection.
  • Full PR-base pnpm check:changed --base=upstream/main --maxWorkers=2 --timeout=5 after the startup change (before the final WSL exclusion): 43/44 checks passed. The broad related-unit selection timed out after five minutes; all static checks, including the main blocking-helper ratchet, passed. The final WSL exclusion was followed by a clean five-case focused rerun; final incremental pre-push results are recorded below.
  • The startup follow-up passed 19 behavior tests across four files, covering legacy account preparation, cancellation, disposal during choice, failed terminal creation, receipt-to-PTY selection and ordinary account restarts. The installed EXE has not yet been rebuilt or manually verified with this follow-up.
  • Final incremental pre-push gate on 9fd75ff1af: pnpm check:changed --base=ca24217c1696a5eda33043c41b7227209a8f942b --maxWorkers=2 --timeout=5 passed 32/32 checks, including its selected unit tests. This covers the six-file startup follow-up; it does not establish whole-PR CI success. The preceding full PR-base run selected 270 changed files and passed 43/44, with broad units timing out.
  • WSL routing uses simulated boundaries locally; actual WSL and other-platform execution still require CI/manual verification. No test rules, timeout policies or baseline allowances were weakened.

Risk

Medium: independent continuations consume disk space, and the last account is authoritative only after an acknowledged successful open. A verified receipt pins the chosen home; invalid receipts and unavailable credentials fail explicitly. Reverting does not delete imported or continued transcripts.

AI Disclosure

Implemented and reviewed with OpenAI Codex.

Review

Keep Draft until prerequisites and required upstream checks pass. The upstream repository is accessible again; the account-picker images and validation details have been refreshed.

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer source is copied or translated.

Preserve workspace account and history routing alongside upstream owner-scoped usage and launch changes. Move account-home preparation to a worker, use async Claude worker discovery, and lower the blocking-helper and sync-fs baselines.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Continue Codex and Claude conversations with an explicit account choice

1 participant