Always enable plan tool in exec (#5380)

Fixes: https://github.com/openai/codex/issues/5359
This commit is contained in:
pakrym-oai
2025-10-20 11:05:55 -07:00
committed by GitHub
parent 73a1787eb8
commit cda6db6ccf
3 changed files with 17 additions and 14 deletions

View File

@@ -68,8 +68,8 @@ pub struct Cli {
pub json: bool, pub json: bool,
/// Whether to include the plan tool in the conversation. /// Whether to include the plan tool in the conversation.
#[arg(long = "include-plan-tool", default_value_t = false)] #[arg(long = "include-plan-tool")]
pub include_plan_tool: bool, pub include_plan_tool: Option<bool>,
/// Specifies file where the last message from the agent should be written. /// Specifies file where the last message from the agent should be written.
#[arg(long = "output-last-message", short = 'o', value_name = "FILE")] #[arg(long = "output-last-message", short = 'o', value_name = "FILE")]

View File

@@ -74,6 +74,10 @@ pub async fn run_main(cli: Cli, codex_linux_sandbox_exe: Option<PathBuf>) -> any
config_overrides, config_overrides,
} = cli; } = cli;
if include_plan_tool.is_some() {
eprintln!("include-plan-tool is deprecated. Plan tool is now enabled by default.");
}
// Determine the prompt source (parent or subcommand) and read from stdin if needed. // Determine the prompt source (parent or subcommand) and read from stdin if needed.
let prompt_arg = match &command { let prompt_arg = match &command {
// Allow prompt before the subcommand by falling back to the parent-level prompt // Allow prompt before the subcommand by falling back to the parent-level prompt
@@ -177,7 +181,7 @@ pub async fn run_main(cli: Cli, codex_linux_sandbox_exe: Option<PathBuf>) -> any
model_provider, model_provider,
codex_linux_sandbox_exe, codex_linux_sandbox_exe,
base_instructions: None, base_instructions: None,
include_plan_tool: Some(include_plan_tool), include_plan_tool: Some(include_plan_tool.unwrap_or(true)),
include_apply_patch_tool: None, include_apply_patch_tool: None,
include_view_image_tool: None, include_view_image_tool: None,
show_raw_agent_reasoning: oss.then_some(true), show_raw_agent_reasoning: oss.then_some(true),

View File

@@ -40,17 +40,16 @@ Send a `tools/list` request and you will see that there are two tools available:
**`codex`** - Run a Codex session. Accepts configuration parameters matching the Codex Config struct. The `codex` tool takes the following properties: **`codex`** - Run a Codex session. Accepts configuration parameters matching the Codex Config struct. The `codex` tool takes the following properties:
| Property | Type | Description | | Property | Type | Description |
| ----------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | | ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | --- |
| **`prompt`** (required) | string | The initial user prompt to start the Codex conversation. | | **`prompt`** (required) | string | The initial user prompt to start the Codex conversation. |
| `approval-policy` | string | Approval policy for shell commands generated by the model: `untrusted`, `on-failure`, `never`. | | `approval-policy` | string | Approval policy for shell commands generated by the model: `untrusted`, `on-failure`, `never`. |
| `base-instructions` | string | The set of instructions to use instead of the default ones. | | `base-instructions` | string | The set of instructions to use instead of the default ones. |
| `config` | object | Individual [config settings](https://github.com/openai/codex/blob/main/docs/config.md#config) that will override what is in `$CODEX_HOME/config.toml`. | | `config` | object | Individual [config settings](https://github.com/openai/codex/blob/main/docs/config.md#config) that will override what is in `$CODEX_HOME/config.toml`. |
| `cwd` | string | Working directory for the session. If relative, resolved against the server process's current directory. | | `cwd` | string | Working directory for the session. If relative, resolved against the server process's current directory. | |
| `include-plan-tool` | boolean | Whether to include the plan tool in the conversation. | | `model` | string | Optional override for the model name (e.g. `o3`, `o4-mini`). |
| `model` | string | Optional override for the model name (e.g. `o3`, `o4-mini`). | | `profile` | string | Configuration profile from `config.toml` to specify default options. |
| `profile` | string | Configuration profile from `config.toml` to specify default options. | | `sandbox` | string | Sandbox mode: `read-only`, `workspace-write`, or `danger-full-access`. |
| `sandbox` | string | Sandbox mode: `read-only`, `workspace-write`, or `danger-full-access`. |
**`codex-reply`** - Continue a Codex session by providing the conversation id and prompt. The `codex-reply` tool takes the following properties: **`codex-reply`** - Continue a Codex session by providing the conversation id and prompt. The `codex-reply` tool takes the following properties: