fix(codex): an in-place restart's relaunch puts the running --add-dirs after the conversation id #2037
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 519 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.374
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2037"
general
weight: 0.35
openrig-review
What a person gets
rig seat restart <codex-seat> --keep-conversationreads complete when the same conversation resumed, and the seat can be messagedafterwards. This holds when a directory Codex was given has a space in its path, such as a working directory named
my repo.Until now, in that case:
reconcileread continuity unverified;rig sendwas refused ("reports sh as the foreground command, but OpenRig could not verify its expected codex agent").The same conversation was running the whole time.
The cause
The relaunch reuses the running Codex's own
--add-dirs, git dirs included. They were placed betweenresumeand the conversationid:
OpenRig identifies a Codex by its process line, which joins argv with spaces (both
/procandps). Read back, that line namesrepo/.gitwhere the id belongs. So:Every other resume already puts these dirs after the id, so the id reads correctly even from a cwd with a space.
A shell or
nodewrapper isn't involved. The proof follows the chain from the native Codex throughnodeandshto the pane.The change
packages/daemon/src/adapters/codex-runtime-adapter.ts: for an in-place restart, the running Codex's--add-dirs follow theconversation id, as on every other resume:
They're still the running Codex's own dirs, unchanged, and none are resolved again. Nothing else changes.
One thing a person may need to know: a Codex already relaunched with the old order still reads as another conversation, so a
send to it is refused and another in-place restart of it is too. A fresh launch or a restore of that seat brings it back in the
right order.
Proof
All runs are in a Linux container: Node 22, tmux 3.3a, git, as root, with
--maxWorkers=2(batch rw3).b0d336fd(on main5e0db11b), the new test fails: 1 of 23 incodex-git-add-dirs. The restart'srelaunch put the dirs before the id, and its proof read
repo/.gitas the conversation.codex-git-add-dirs,seat-restart-in-place,codex-runtime-adapter,native-process-lineage,restore-orchestrator,session-transport,codex-resumeandreconcile:- main
5e0db11bpasses 1518 of 1518;-
fa462d4epasses 1519 of 1519;-
test:repopasses 325 of 325.The native restart test (private tmux, compiled stub
codex) restarts in place with the new order and keeps the pane, theshell and the running choices.
- Its stub printed its last argument as the conversation, which held only while the id came last. It now reads the id after
resume, as Codex does (fa462d4e, test only).- Before that stub change, the restart itself already succeeded there, but the stub's screen line didn't match.
Not run here:* a real Codex restarted in place. Quality planned a native A/B on the cell where this was found. That cell's
current Codex was relaunched with the old order, so it needs a fresh launch or restore first.
🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug FixesIn-place Codex restarts now preserve the repository path and additional directories, including paths containing spaces.
Restart and message handling more reliably recognize the resumed conversation, helping ensure the correct session continues.
Tests
Added coverage for restarts with paths containing spaces and for recognizing resumed conversations in restart and message flows.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->