Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Always enable plan tool in exec (#5380)

pakrym-oaicda6db6ccf13
diff --git a/codex-rs/exec/src/cli.rs b/codex-rs/exec/src/cli.rs
index d264eb61b0..67c072e021 100644
--- a/codex-rs/exec/src/cli.rs
+++ b/codex-rs/exec/src/cli.rs
@@ -68,8 +68,8 @@ pub struct Cli {
pub json: bool,
/// Whether to include the plan tool in the conversation.
- #[arg(long = "include-plan-tool", default_value_t = false)]
- pub include_plan_tool: bool,
+ #[arg(long = "include-plan-tool")]
+ pub include_plan_tool: Option<bool>,
/// Specifies file where the last message from the agent should be written.
#[arg(long = "output-last-message", short = 'o', value_name = "FILE")]
diff --git a/codex-rs/exec/src/lib.rs b/codex-rs/exec/src/lib.rs
index 953c997685..afd9d44a73 100644
--- a/codex-rs/exec/src/lib.rs
+++ b/codex-rs/exec/src/lib.rs
@@ -74,6 +74,10 @@ pub async fn run_main(cli: Cli, codex_linux_sandbox_exe: Option<PathBuf>) -> any
config_overrides,
} = 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.
let prompt_arg = match &command {
// 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,
codex_linux_sandbox_exe,
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_view_image_tool: None,
show_raw_agent_reasoning: oss.then_some(true),
diff --git a/docs/advanced.md b/docs/advanced.md
index 4bf05a8032..ebcd6e34fd 100644
--- a/docs/advanced.md
+++ b/docs/advanced.md
@@ -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:
-| Property | Type | Description |
-| ----------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| **`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`. |
-| `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`. |
-| `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`). |
-| `profile` | string | Configuration profile from `config.toml` to specify default options. |
-| `sandbox` | string | Sandbox mode: `read-only`, `workspace-write`, or `danger-full-access`. |
+| Property | Type | Description |
+| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | --- |
+| **`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`. |
+| `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`. |
+| `cwd` | string | Working directory for the session. If relative, resolved against the server process's current directory. | |
+| `model` | string | Optional override for the model name (e.g. `o3`, `o4-mini`). |
+| `profile` | string | Configuration profile from `config.toml` to specify default options. |
+| `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: