Skip to content

fix(daemon): pass -C with the seat's directory on Codex resume and fork - #15

Merged
fsafey merged 5 commits into
mainfrom
codex/codex-resume-cwd
Nov 24, 2026
Merged

fsafey merged 5 commits into
mainfrom
codex/codex-resume-cwd

Conversation

@fsafey

@fsafey fsafey commented Nov 24, 2026

Copy link
Copy Markdown
Owner

What a user gets

A Codex seat whose saved directory differs from the one its conversation was recorded in (after rig seat set-cwd, then a restore, rig down/rig up or a fork handover) no longer stops at Codex's "Working directory" picker and ends attention_required. Resume, the older restore path and fork now pass -C <seat cwd>, as the fresh launch does; in-place restart relaunches in the running Codex's -C directory. The set-cwd help and startup guide no longer claim a Claude resume in a new directory may lose the conversation (Claude 2.1.331 resumes it).

How you verified it

Native Codex 0.171.0 in a throwaway CODEX_HOME: the picker appears without -C and not with it, for resume and fork. Native Claude 2.1.331 resume from another directory loads the conversation. 626/627 focused daemon tests pass on the code commits; lint passes. Upstream (code commits only): mvschwarz#3892. Full npm run ci:local on the exact head, published as local-ci.

🤖 Generated with Claude Code

fsafey and others added 5 commits November 24, 2026 11:06
A Codex resume carried no -C, so a seat whose saved directory differs from
the one its conversation was recorded in (rig seat set-cwd, then a restore
or relaunch) met Codex's own "Working directory" picker, which OpenRig does
not recognize, and the seat ended attention_required. The fresh launch
already passes -C <cwd>.

Both resume builders (the launch adapter's resumeCore, which restart
--keep-conversation also uses with the observed process cwd, and the
legacy CodexResumeAdapter) now add -C <cwd>, shell-quoted as the fresh
launch does, after the conversation id so a process listing still reads
the id from a path with a space. Codex 0.171.0 then resumes the same
conversation in the new directory with no prompt; --last selects within
that directory, as it did from the pane's cwd. The displayed recovery
command is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Codex fork had the same gap as a resume: forking a parent recorded in
another directory (a handover by fork after rig seat set-cwd) shows Codex's
"Working directory" picker, verified with Codex 0.171.0. The fork now adds
-C <cwd> after the parent id, as the fresh launch and resume do, so the
fork proof still reads the id from a path with a space.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The set-cwd help and the agent startup guide said a Claude resume in the new
directory may not find the conversation and that cross-directory resume had
not been run natively. Run natively, Claude Code 2.1.331 resumes (and forks)
a conversation recorded in another directory by id, and Codex 0.171.0 does
with -C, which OpenRig now passes on resume and fork.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rectory

Codex launched with -C works in that directory while its process cwd stays
the launcher's (checked natively with Codex 0.171.0), so the observed cwd
isn't always where the running Codex works. rig seat restart
--keep-conversation now names the running Codex's -C (relative to its cwd)
on the relaunch, and the observed directory only when it had none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fsafey
fsafey merged commit a26286e into main Nov 24, 2026
1 check passed
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