Centralize slash command draft serialization on top of shlex so popup flows and queued replay use the same quoting and tokenization rules.
Co-authored-by: Codex <noreply@openai.com>
Pause queued replay on local slash actions that need app-side updates or popup dismissal, then resume once the app event queue and bottom pane are idle. Add regression coverage for queued theme replay and popup-gated resume.
Co-authored-by: Codex <noreply@openai.com>
Track whether /model effort and scope modifiers were provided so repeated sentinel values like default and global are rejected consistently.
Validation: cargo test -p codex-tui; just fix -p codex-tui; just fmt
Co-authored-by: Codex <noreply@openai.com>
Route interactive slash-command pickers through canonical serialized drafts so live dispatch and queued replay share one parser/executor path.
Validation: cargo test -p codex-tui; just fix -p codex-tui; just fmt
Co-authored-by: Codex <noreply@openai.com>
Switch supports_inline_args() and requires_interaction() to exhaustive matches so newly added SlashCommand variants must be classified explicitly.
Co-authored-by: Codex <noreply@openai.com>
Explain that the busy-path Stop return in dispatch_command() only matters for live dispatch because queued replay never reaches that branch.
Co-authored-by: Codex <noreply@openai.com>
Mark popup-opening slash commands as requiring interaction, open them immediately instead of queueing bare drafts while a task is running, and make queued replay restore any legacy bare interactive command draft instead of opening UI mid-drain.
Co-authored-by: Codex <noreply@openai.com>
Explain above dispatch_command that live callers usually ignore its return value while queued replay uses QueueReplayControl to decide whether draining can continue.
Co-authored-by: Codex <noreply@openai.com>
Document that the busy-path queueing in dispatch_command is only reached during live slash dispatch, not queued replay, so the returned drain-control value is effectively a throwaway for that branch.
Co-authored-by: Codex <noreply@openai.com>
Serialize custom /review instructions with an explicit custom marker so queued replay cannot reinterpret branch-like text as a structured review target, and rename queued replay to better reflect that it drains inputs until blocked.
Co-authored-by: Codex <noreply@openai.com>
Send interrupt ops directly from the bottom pane instead of routing them through the status indicator widget, and remove the now-unused event wiring from the widget and its tests.
Co-authored-by: Codex <noreply@openai.com>
Keep bare /model and /review interactive while preserving serialized queue replay, restore queued slash drafts into the composer on interrupt, and align queued slash parsing with the same feature-gated lookup used by the composer.
Co-authored-by: Codex <noreply@openai.com>
Unify queued slash commands as serialized drafts, route popup actions through the same replay path, and stop replay after commands that submit a turn.
Co-authored-by: Codex <noreply@openai.com>
Limit Esc interrupts to an empty composer when no popup is active, while preserving the pending-steer interrupt path.
This keeps dialog dismissal on Esc working normally without interrupting the running conversation.
Co-authored-by: Codex <noreply@openai.com>
Keep interactive slash flows usable while a turn is running, and queue the resulting action instead of the bare slash token.
Also let Esc interrupt through popup-active states so queued drafts restore without dropping queued slash actions.
Co-authored-by: Codex <noreply@openai.com>
Restore only queued user-message drafts into the composer when a turn is interrupted, keep queued slash-command actions replayable, and cover the interrupt replay behavior in codex-tui tests.
Co-authored-by: Codex <noreply@openai.com>
Drop the unused bottom-pane mention-binding drain helpers introduced by the queueing refactor and switch the affected tests to the existing non-destructive composer mention accessor.
Co-authored-by: Codex <noreply@openai.com>
Allow slash commands entered during a running turn to be queued and replayed after the turn completes, including /review and inline slash-command variants tested in codex-tui.
Co-authored-by: Codex <noreply@openai.com>
## Summary
- reuse a guardian subagent session across approvals so reviews keep a
stable prompt cache key and avoid one-shot startup overhead
- clear the guardian child history before each review so prior guardian
decisions do not leak into later approvals
- include the `smart_approvals` -> `guardian_approval` feature flag
rename in the same PR to minimize release latency on a very tight
timeline
- add regression coverage for prompt-cache-key reuse without
prior-review prompt bleed
## Request
- Bug/enhancement request: internal guardian prompt-cache and latency
improvement request
---------
Co-authored-by: Codex <noreply@openai.com>
### Motivation
- Interrupting a running turn (Ctrl+C / Esc) currently also terminates
long‑running background shells, which is surprising for workflows like
local dev servers or file watchers.
- The existing cleanup command name was confusing; callers expect an
explicit command to stop background terminals rather than a UI clear
action.
- Make background‑shell termination explicit and surface a clearer
command name while preserving backward compatibility.
### Description
- Renamed the background‑terminal cleanup slash command from `Clean`
(`/clean`) to `Stop` (`/stop`) and kept `clean` as an alias in the
command parsing/visibility layer, updated the user descriptions and
command popup wiring accordingly.
- Updated the unified‑exec footer text and snapshots to point to `/stop`
(and trimmed corresponding snapshot output to match the new label).
- Changed interrupt behavior so `Op::Interrupt` (Ctrl+C / Esc interrupt)
no longer closes or clears tracked unified exec / background terminal
processes in the TUI or core cleanup path; background shells are now
preserved after an interrupt.
- Updated protocol/docs to clarify that `turn/interrupt` (or
`Op::Interrupt`) interrupts the active turn but does not terminate
background terminals, and that `thread/backgroundTerminals/clean` is the
explicit API to stop those shells.
- Updated unit/integration tests and insta snapshots in the TUI and core
unified‑exec suites to reflect the new semantics and command name.
### Testing
- Ran formatting with `just fmt` in `codex-rs` (succeeded).
- Ran `cargo test -p codex-protocol` (succeeded).
- Attempted `cargo test -p codex-tui` but the build could not complete
in this environment due to a native build dependency that requires
`libcap` development headers (the `codex-linux-sandbox` vendored build
step); install `libcap-dev` / make `libcap.pc` available in
`PKG_CONFIG_PATH` to run the TUI test suite locally.
- Updated and accepted the affected `insta` snapshots for the TUI
changes so visual diffs reflect the new `/stop` wording and preserved
interrupt behavior.
------
[Codex
Task](https://chatgpt.com/codex/tasks/task_i_69b39c44b6dc8323bd133ae206310fae)
- [x] Bypass tool search and stuff tool specs directly into model
context when either a. Tool search is not available for the model or b.
There are not that many tools to search for.