Skip to content

Fix command-code resume to use discovered session transcripts#175

Merged
SDSLeon merged 1 commit into
masterfrom
lightcode/keen-lemur-8d4d8904
Jun 14, 2026
Merged

Fix command-code resume to use discovered session transcripts#175
SDSLeon merged 1 commit into
masterfrom
lightcode/keen-lemur-8d4d8904

Conversation

@SDSLeon

@SDSLeon SDSLeon commented Jun 14, 2026

Copy link
Copy Markdown
Owner
  • Stop minting synthetic session refs on launch and discover the real command-code transcript ID from the per-cwd session files instead.
  • Resume exact conversations with --resume <id>, while keeping --continue only as a fallback when no durable session ID is available.
  • Treat missing, unloadable, or corrupt transcripts as stale session refs so the runtime relaunches cleanly instead of looping on a dead resume target.
  • Update coverage for fresh launches, exact-session resumes, fallback behavior, and transcript filtering.

- Snapshot pre-spawn transcripts, discover the real session id after launch, and avoid synthetic `sessionRef`s
- Resume exact IDs with `--resume`, keep `--continue` as the fallback, and treat stale or corrupt transcripts as invalid
- Add focused coverage for argv, adapter launch/resume, and transcript filtering helpers
@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
lightcode-landing Skipped Skipped Jun 14, 2026 7:46pm

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c4f36b772

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

export function snapshotCommandCodePreSpawnSessions(location: ProjectLocation, cwd: string): void {
preSpawnIds = new Set();
preSpawnKey = sanitizeCommandCodeCwd(cwd);
if (location.kind === "wsl") return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Snapshot WSL transcripts before discovering sessions

On WSL this early return leaves preSpawnIds empty, so discoverCommandCodeSessionRef cannot exclude transcripts that already existed before the new PTY was spawned. pollSessionRefDiscovery accepts the first discovered ref, so launching a new Command Code thread in a WSL project with an existing transcript—especially with no initial prompt, or before the CLI writes the new file—will attach the stale conversation ID and future resumes will open the old conversation. Please snapshot through the WSL bridge or avoid returning any candidate until a post-launch file is observed.

Useful? React with 👍 / 👎.

@SDSLeon SDSLeon merged commit ceba9eb into master Jun 14, 2026
6 checks passed
@SDSLeon SDSLeon deleted the lightcode/keen-lemur-8d4d8904 branch June 14, 2026 19:50
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.

1 participant