Add remote --cd forwarding for app-server sessions#16700
Conversation
|
From a local Codex review:
codex --remote ws://host:3000 --cd /srv/repo-b --resume --last
So the user-visible symptom would be: “I asked to resume my latest session in repo B, but Codex opened some other conversation from repo A, possibly now running it in repo B’s directory.” That’s risky because it’s not just a confusing selection bug: the resumed conversation’s context and the working directory can now be mismatched, which could lead the agent to edit the wrong checkout or interpret prior discussion against the wrong repo. |
|
Good catch. That's inconsistent with the local |
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Addresses #16124
Problem:
codex --remote --cd <path>canonicalized the path locally and then omitted it from remote thread lifecycle requests, so remote-only working directories failed or were ignored.Solution: Keep remote startup on the local cwd, forward explicit
--cdvalues verbatim tothread/start,thread/resume, andthread/fork, and cover the behavior withcodex-tuitests.Testing: I manually tested
--remote --cdwith both absolute and relative paths and validated correct behavior.Update based on code review feedback:
Problem: Remote
--cdwas forwarded tothread/resumeandthread/fork, but not tothread/listlookups, so--resume --lastand picker flows could select a session from the wrong cwd; relative cwd filters also failed against stored absolute paths.Solution: Apply explicit remote
--cdtothread/listlookups for--lastand picker flows, normalize relative cwd filters on the app-server before exact matching, and document/test the behavior.