Handle messages during goal continuations and expose Codex speed tiers

Merged
TE
11d ago
+493-18

Messages sent while Codex is continuing a persistent goal now steer that active turn. If a continuation wins the send race, an explicit busy refusal triggers one turn read and a steer of the original input; unrelated errors are returned without replay. Normal duplicate prompts remain rejected.

Restore Codex-owned goal state when a session opens and expose the service tiers advertised by the selected model, including Fast and Ultrafast where offered. A picked tier is sent on the next turn; unsupported tiers are refused.

Observed / Not run

  • Added boundary regressions for autonomous goal turns, the start race, unrelated errors, duplicate prompts, and advertised service-tier picks.
  • Rust formatting and primary diff inspection completed.
  • Rust execution runs in this PR's Linux and macOS CI; no native build or tests ran on the submitting laptop.

Agent session: cosmic-gray


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Messages sent while Codex is continuing a persistent goal now steer that active turn. Goal pause/clear commands are acknowledged from the persisted RPC result, publishing the goal state before the acknowledgement instead of waiting for an update notification, and the bridge restores the persisted goal when a session opens.

  • A prompt that loses the send race to a goal continuation triggers one thread read and steers the original input; unrelated errors and duplicate prompts are still rejected.
  • Model settings expose the service tiers advertised by the selected model (including Fast and Ultrafast where offered); the picked tier is sent on the next turn, and switching models resets an unsupported pick.

Summary by CodeRabbit

  • New Features
    • Model settings now display available speed tiers, including the model’s default when provided.
    • Prompts can steer an active goal, while goal pause and clear commands remain available.
    • Goal information refreshes after starting, resuming, or forking a thread.
  • Bug Fixes
    • Speed-tier selections are limited to options supported by the current model.
    • Prompts are preserved when recovering from an active-turn conflict, and duplicate prompts no longer replace an in-flight prompt.
    • Cancelled prompts are no longer delivered later during recovery.