Fix command-code resume to use discovered session transcripts#175
Conversation
- 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
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
💡 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; |
There was a problem hiding this comment.
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 👍 / 👎.
--resume <id>, while keeping--continueonly as a fallback when no durable session ID is available.