diff --git a/codex-rs/codex-api/src/endpoint/realtime_websocket/methods.rs b/codex-rs/codex-api/src/endpoint/realtime_websocket/methods.rs index 7ea8e01bed..95c9af6df1 100644 --- a/codex-rs/codex-api/src/endpoint/realtime_websocket/methods.rs +++ b/codex-rs/codex-api/src/endpoint/realtime_websocket/methods.rs @@ -448,7 +448,7 @@ impl RealtimeWebsocketWriter { SessionTool { kind: "function".to_string(), name: "manage_message_queue".to_string(), - description: "Inspect or edit queued draft messages. Supported actions: list, replace_last, remove_last, clear. Queue editing affects queued draft messages only, not pending steers.".to_string(), + description: "Inspect or edit queued draft messages. Prefer this over codex when the user asks what is queued or wants to replace, remove, or clear queued draft work. Supported actions: list, replace_last, remove_last, clear. Queue editing affects queued draft messages only, not pending steers.".to_string(), parameters: SessionToolParameters { kind: "object".to_string(), properties: BTreeMap::from([ @@ -473,7 +473,7 @@ impl RealtimeWebsocketWriter { SessionTool { kind: "function".to_string(), name: "manage_runtime_settings".to_string(), - description: "Inspect or update runtime settings for future Codex turns. Call with no setting fields to list current settings, possible settings, and allowed values. Supported setting keys: model, working_directory, reasoning_effort, fast_mode, personality, collaboration_mode. Changes are not persisted to disk.".to_string(), + description: "Inspect or update runtime settings for future Codex turns. Prefer this over codex when the user wants to inspect or change model, working_directory, reasoning_effort, fast_mode, personality, or collaboration_mode. Call with no setting fields to list current settings, possible settings, and allowed values. Supported setting keys: model, working_directory, reasoning_effort, fast_mode, personality, collaboration_mode. Changes are not persisted to disk.".to_string(), parameters: SessionToolParameters { kind: "object".to_string(), properties: BTreeMap::from([ @@ -526,7 +526,7 @@ impl RealtimeWebsocketWriter { SessionTool { kind: "function".to_string(), name: "run_tui_command".to_string(), - description: "Run a small set of built-in TUI actions. Supported commands: compact, review, plan, diff, agent. review can take an optional prompt for custom review instructions. plan can take an optional prompt to switch to Plan mode and submit work immediately.".to_string(), + description: "Run a small set of built-in TUI actions. Prefer this over codex for built-in control actions like compact, review, plan, diff, or opening the agent picker. Supported commands: compact, review, plan, diff, agent. review can take an optional prompt for custom review instructions. plan can take an optional prompt to switch to Plan mode and submit work immediately.".to_string(), parameters: SessionToolParameters { kind: "object".to_string(), properties: BTreeMap::from([ diff --git a/codex-rs/tui/src/chatwidget/realtime.rs b/codex-rs/tui/src/chatwidget/realtime.rs index b79ac2782d..d4e25814a3 100644 --- a/codex-rs/tui/src/chatwidget/realtime.rs +++ b/codex-rs/tui/src/chatwidget/realtime.rs @@ -25,10 +25,14 @@ const REALTIME_CONVERSATION_PROMPT: &str = concat!( "text output that the user can read in the TUI. ", "Use codex whenever the user asks for codebase-specific facts, debugging, file changes, ", "command output, or anything that benefits from tools. ", + "Do not use codex for pure control actions when a dedicated control function fits. ", "Use manage_message_queue to inspect or edit queued draft work. Supported actions are list, replace_last, remove_last, and clear. ", + "If the user asks what is queued, or asks to replace, remove, or clear queued draft work, use manage_message_queue instead of codex. ", "Use manage_runtime_settings to inspect or change runtime settings for future turns, including model, working_directory, reasoning_effort, fast_mode, personality, and collaboration_mode. ", + "If the user asks to inspect or change those runtime settings, use manage_runtime_settings instead of codex. ", "If you call manage_runtime_settings without any setting fields, it returns the current settings and the list of possible settings and allowed values. ", "Use run_tui_command for built-in TUI actions. Supported commands are compact, review, plan, diff, and agent. ", + "If the user asks to compact, review, switch to Plan mode, show the diff, or open the agent picker, use run_tui_command instead of codex. ", "When you speak to the user directly, be extremely concise. ", "Prefer short spoken answers because the user can see the detailed text output themselves. ", "Do not read long code snippets, long file paths, diffs, or command output aloud unless the ",