docs: --cwd routing flag, deterministic --wait/--background stripping, non-interactive resume guard - #591
docs: --cwd routing flag, deterministic --wait/--background stripping, non-interactive resume guard#591scompel wants to merge 1 commit into
Conversation
…d stripping, non-interactive resume guard - Document --cwd <path> as a routing control on the rescue path in the agent, skill, and command docs: strip from task text, forward to task, scoping parallel rescue runs and --resume-last threads per worktree - State explicitly that --background/--wait are Claude-side execution controls that are always stripped and never forwarded to task - Skip the resume-candidate AskUserQuestion in non-interactive sessions or when --cwd is present; route as --fresh unless --resume was given Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82ec7206db
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| - `--cwd <path>` is a routing flag. Preserve it for the forwarded `task` call as `--cwd <path>`, but do not treat it as part of the natural-language task text. It targets the Codex run at a specific working tree (typically an isolated git worktree) so parallel rescue runs never collide; the companion's job state and `--resume-last` threads are scoped per `--cwd` repository root. | ||
| - If the request includes `--resume`, do not ask whether to continue. The user already chose. | ||
| - If the request includes `--fresh`, do not ask whether to continue. The user already chose. | ||
| - If the session is non-interactive (no human available to answer a question) or the request includes `--cwd`, do not ask whether to continue. Route as `--fresh` unless `--resume` was given. |
There was a problem hiding this comment.
Preserve cwd-scoped resume checks
When the user targets a worktree and gives a follow-up such as /codex:rescue --cwd ../wt continue, this new rule forces the command to add --fresh unless the user also typed --resume, so the subagent's existing “continue/keep going” heuristic is suppressed and Codex starts a new thread instead of resuming the latest task for that --cwd root. The companion helper already accepts --cwd for task-resume-candidate, so the command should check the candidate in the routed worktree (or only force fresh for truly non-interactive sessions) rather than making all --cwd follow-ups fresh by default.
Useful? React with 👍 / 👎.
Documents the
--cwdrouting flag on the rescue path (the companiontaskcommand already accepts it —valueOptionsin codex-companion.mjs) so parallel rescue runs can target isolated git worktrees without colliding on files or job state; makes--wait/--backgroundstripping explicit (observed agents occasionally forwarding--waittotask); skips the resume AskUserQuestion in non-interactive sessions (it blocks autonomous runs). Docs-only — no runtime change; commands suite 8/8, full suite matches baseline.