Add plan and fast slash commands#257
Conversation
5d38219 to
0a170f0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0a170f000a
ℹ️ 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".
| fn user_input_request_key(turn_id: &str) -> String { | ||
| format!("user-input:{turn_id}") |
There was a problem hiding this comment.
Key user-input permission requests by call ID
user_input_request_key uses only turn_id, so multiple RequestUserInput prompts emitted within the same turn overwrite each other in pending_permission_interactions and abort the earlier task. In that case the first prompt never gets a corresponding Op::UserInputAnswer, which can leave the turn waiting on an unanswered tool call. Use a per-call key (e.g. include call_id) to keep concurrent prompts distinct.
Useful? React with 👍 / 👎.
| let [question] = event.questions.as_slice() else { | ||
| return None; | ||
| }; | ||
| let options = question | ||
| .options | ||
| .as_ref() | ||
| .filter(|options| !options.is_empty())?; |
There was a problem hiding this comment.
Reject
request_user_input prompts requiring free-form "Other"
The supported-shape gate only checks for a single question with non-empty options, but it ignores question.is_other. When is_other is true, this adapter still routes the prompt through fixed permission buttons, so users cannot provide the required free-form "Other" answer and the tool call receives an incomplete/incorrect response path. This shape should be treated as unsupported and sent through the existing fallback branch.
Useful? React with 👍 / 👎.
d837599 to
218665d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 218665dea6
ℹ️ 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".
| self.set_service_tier(service_tier).await?; | ||
| } | ||
| "on" => self.set_service_tier(Some(ServiceTier::Fast)).await?, | ||
| "off" => self.set_service_tier(None).await?, |
There was a problem hiding this comment.
Preserve prior non-fast tier when disabling /fast
The /fast off path always calls set_service_tier(None), which clears the session's tier preference instead of restoring whatever non-fast tier was active before /fast on (for example ServiceTier::Flex). Because this command also overwrites self.config.service_tier, users who start in a non-default tier cannot get back to it via /fast and silently run future turns with a different service tier than intended.
Useful? React with 👍 / 👎.
0de7412 to
655076a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 655076a94b
ℹ️ 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".
| (collaboration_mode, plan_rest) | ||
| } else { |
There was a problem hiding this comment.
Persist plan-off mode before accepting an inline prompt
When handling /plan off <prompt>, this branch only sets collaboration_mode: Default on Op::UserInputWithTurnContext for that one turn and does not submit Op::OverrideTurnContext. If the session was previously switched to Plan mode (for example via /plan), the persistent mode remains Plan after the prompted turn, so subsequent normal prompts keep running in Plan mode even though the user explicitly used off.
Useful? React with 👍 / 👎.
655076a to
5465d67
Compare
|
Addressed the latest Codex review in
|
5465d67 to
24499a3
Compare
|
Updated in Previously, a request containing multiple fixed-option questions fell into the unsupported fallback and returned an empty answer immediately. The adapter now asks each fixed-option question sequentially through ACP permission requests, keeps each prompt visible as a pending tool call, and only submits |
Summary
Adds Codex ACP support for the
/planand/fastslash commands so ACP clients such as Zed can expose the same core Codex controls available in the Codex TUI./planand/fastthrough ACP available commands/planto Codex Plan collaboration mode using the built-in Codex collaboration mode preset/plan <prompt>by submitting the prompt with Plan mode in the same turn context/plan offand/plan off <prompt>to explicitly leave Plan mode or continue immediately in Default mode/fast,/fast on,/fast off, and/fast statususing Codex service tier overrides/fast offdisables Fast moderequest_user_inputevents through ACP permission requests so Zed can show a choice UI during Plan moderequest_user_inputquestions sequentially and only returns answers to Codex after all questions have been resolvedrequest_user_inputprompts as visible pending tool calls so the question remains in the thread history if the user switches away and returnsrequest_user_inputpermission requests by turn and call ID, and rejects free-form/secret prompt shapes that ACP permission buttons cannot representPlanDelta/ completedTurnItem::Planoutput as visible assistant markdown so<proposed_plan>content is not dropped by ACP clientsValidation
CODEX_SKIP_VENDORED_BWRAP=1 CARGO_HOME=/tmp/codex-rust/cargo RUSTUP_HOME=/tmp/codex-rust/rustup /tmp/codex-rust/cargo/bin/cargo fmtCODEX_SKIP_VENDORED_BWRAP=1 CARGO_HOME=/tmp/codex-rust/cargo RUSTUP_HOME=/tmp/codex-rust/rustup /tmp/codex-rust/cargo/bin/cargo test -- --nocaptureCODEX_SKIP_VENDORED_BWRAP=1 CARGO_HOME=/tmp/codex-rust/cargo RUSTUP_HOME=/tmp/codex-rust/rustup /tmp/codex-rust/cargo/bin/cargo build --bin codex-acpNote:
CODEX_SKIP_VENDORED_BWRAP=1was needed in this environment becauselibcap.pcis not installed for the vendored bubblewrap build.Release Notes:
/planand/fastslash commands, including visible Plan-mode prompts and/plan off.