Skip to content

Commit 6ef658a

Browse files
authored
[Hygiene] Remove include_view_image_tool config (#5976)
There's still some debate about whether we want to expose `tools.view_image` or `feature.view_image` so those are left unchanged for now, but this old `include_view_image_tool` config is good-to-go. Also updated the doc to reflect that `view_image` tool is now by default true.
1 parent 8b8be34 commit 6ef658a

File tree

9 files changed

+4
-36
lines changed

9 files changed

+4
-36
lines changed

codex-rs/app-server/src/codex_message_processor.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1777,7 +1777,6 @@ async fn derive_config_from_params(
17771777
developer_instructions,
17781778
compact_prompt,
17791779
include_apply_patch_tool,
1780-
include_view_image_tool: None,
17811780
show_raw_agent_reasoning: None,
17821781
tools_web_search_request: None,
17831782
experimental_sandbox_command_assessment: None,

codex-rs/core/src/config/mod.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,6 @@ pub struct Config {
250250
/// https://github.com/modelcontextprotocol/rust-sdk
251251
pub use_experimental_use_rmcp_client: bool,
252252

253-
/// Include the `view_image` tool that lets the agent attach a local image path to context.
254-
pub include_view_image_tool: bool,
255-
256253
/// Centralized feature flags; source of truth for feature gating.
257254
pub features: Features,
258255

@@ -841,7 +838,6 @@ pub struct ConfigOverrides {
841838
pub developer_instructions: Option<String>,
842839
pub compact_prompt: Option<String>,
843840
pub include_apply_patch_tool: Option<bool>,
844-
pub include_view_image_tool: Option<bool>,
845841
pub show_raw_agent_reasoning: Option<bool>,
846842
pub tools_web_search_request: Option<bool>,
847843
pub experimental_sandbox_command_assessment: Option<bool>,
@@ -873,7 +869,6 @@ impl Config {
873869
developer_instructions,
874870
compact_prompt,
875871
include_apply_patch_tool: include_apply_patch_tool_override,
876-
include_view_image_tool: include_view_image_tool_override,
877872
show_raw_agent_reasoning,
878873
tools_web_search_request: override_tools_web_search_request,
879874
experimental_sandbox_command_assessment: sandbox_command_assessment_override,
@@ -900,7 +895,6 @@ impl Config {
900895

901896
let feature_overrides = FeatureOverrides {
902897
include_apply_patch_tool: include_apply_patch_tool_override,
903-
include_view_image_tool: include_view_image_tool_override,
904898
web_search_request: override_tools_web_search_request,
905899
experimental_sandbox_command_assessment: sandbox_command_assessment_override,
906900
};
@@ -998,7 +992,6 @@ impl Config {
998992
let history = cfg.history.unwrap_or_default();
999993

1000994
let include_apply_patch_tool_flag = features.enabled(Feature::ApplyPatchFreeform);
1001-
let include_view_image_tool_flag = features.enabled(Feature::ViewImageTool);
1002995
let tools_web_search_request = features.enabled(Feature::WebSearchRequest);
1003996
let use_experimental_streamable_shell_tool = features.enabled(Feature::StreamableShell);
1004997
let use_experimental_unified_exec_tool = features.enabled(Feature::UnifiedExec);
@@ -1160,7 +1153,6 @@ impl Config {
11601153
use_experimental_streamable_shell_tool,
11611154
use_experimental_unified_exec_tool,
11621155
use_experimental_use_rmcp_client,
1163-
include_view_image_tool: include_view_image_tool_flag,
11641156
features,
11651157
active_profile: active_profile_name,
11661158
active_project,
@@ -1595,7 +1587,7 @@ trust_level = "trusted"
15951587
profiles.insert(
15961588
"work".to_string(),
15971589
ConfigProfile {
1598-
include_view_image_tool: Some(false),
1590+
tools_view_image: Some(false),
15991591
..Default::default()
16001592
},
16011593
);
@@ -1612,7 +1604,6 @@ trust_level = "trusted"
16121604
)?;
16131605

16141606
assert!(!config.features.enabled(Feature::ViewImageTool));
1615-
assert!(!config.include_view_image_tool);
16161607

16171608
Ok(())
16181609
}
@@ -2908,7 +2899,6 @@ model_verbosity = "high"
29082899
use_experimental_streamable_shell_tool: false,
29092900
use_experimental_unified_exec_tool: false,
29102901
use_experimental_use_rmcp_client: false,
2911-
include_view_image_tool: true,
29122902
features: Features::with_defaults(),
29132903
active_profile: Some("o3".to_string()),
29142904
active_project: ProjectConfig { trust_level: None },
@@ -2981,7 +2971,6 @@ model_verbosity = "high"
29812971
use_experimental_streamable_shell_tool: false,
29822972
use_experimental_unified_exec_tool: false,
29832973
use_experimental_use_rmcp_client: false,
2984-
include_view_image_tool: true,
29852974
features: Features::with_defaults(),
29862975
active_profile: Some("gpt3".to_string()),
29872976
active_project: ProjectConfig { trust_level: None },
@@ -3069,7 +3058,6 @@ model_verbosity = "high"
30693058
use_experimental_streamable_shell_tool: false,
30703059
use_experimental_unified_exec_tool: false,
30713060
use_experimental_use_rmcp_client: false,
3072-
include_view_image_tool: true,
30733061
features: Features::with_defaults(),
30743062
active_profile: Some("zdr".to_string()),
30753063
active_project: ProjectConfig { trust_level: None },
@@ -3143,7 +3131,6 @@ model_verbosity = "high"
31433131
use_experimental_streamable_shell_tool: false,
31443132
use_experimental_unified_exec_tool: false,
31453133
use_experimental_use_rmcp_client: false,
3146-
include_view_image_tool: true,
31473134
features: Features::with_defaults(),
31483135
active_profile: Some("gpt5".to_string()),
31493136
active_project: ProjectConfig { trust_level: None },

codex-rs/core/src/config/profile.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ pub struct ConfigProfile {
2424
pub experimental_instructions_file: Option<PathBuf>,
2525
pub experimental_compact_prompt_file: Option<PathBuf>,
2626
pub include_apply_patch_tool: Option<bool>,
27-
pub include_view_image_tool: Option<bool>,
2827
pub experimental_use_unified_exec_tool: Option<bool>,
2928
pub experimental_use_exec_command_tool: Option<bool>,
3029
pub experimental_use_rmcp_client: Option<bool>,

codex-rs/core/src/features.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ pub struct Features {
8282
#[derive(Debug, Clone, Default)]
8383
pub struct FeatureOverrides {
8484
pub include_apply_patch_tool: Option<bool>,
85-
pub include_view_image_tool: Option<bool>,
8685
pub web_search_request: Option<bool>,
8786
pub experimental_sandbox_command_assessment: Option<bool>,
8887
}
@@ -91,7 +90,6 @@ impl FeatureOverrides {
9190
fn apply(self, features: &mut Features) {
9291
LegacyFeatureToggles {
9392
include_apply_patch_tool: self.include_apply_patch_tool,
94-
include_view_image_tool: self.include_view_image_tool,
9593
tools_web_search: self.web_search_request,
9694
..Default::default()
9795
}
@@ -193,7 +191,6 @@ impl Features {
193191

194192
let profile_legacy = LegacyFeatureToggles {
195193
include_apply_patch_tool: config_profile.include_apply_patch_tool,
196-
include_view_image_tool: config_profile.include_view_image_tool,
197194
experimental_sandbox_command_assessment: config_profile
198195
.experimental_sandbox_command_assessment,
199196
experimental_use_freeform_apply_patch: config_profile

codex-rs/core/src/features/legacy.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ const ALIASES: &[Alias] = &[
3333
legacy_key: "include_apply_patch_tool",
3434
feature: Feature::ApplyPatchFreeform,
3535
},
36-
Alias {
37-
legacy_key: "include_view_image_tool",
38-
feature: Feature::ViewImageTool,
39-
},
4036
Alias {
4137
legacy_key: "web_search",
4238
feature: Feature::WebSearchRequest,
@@ -56,7 +52,6 @@ pub(crate) fn feature_for_key(key: &str) -> Option<Feature> {
5652
#[derive(Debug, Default)]
5753
pub struct LegacyFeatureToggles {
5854
pub include_apply_patch_tool: Option<bool>,
59-
pub include_view_image_tool: Option<bool>,
6055
pub experimental_sandbox_command_assessment: Option<bool>,
6156
pub experimental_use_freeform_apply_patch: Option<bool>,
6257
pub experimental_use_exec_command_tool: Option<bool>,
@@ -110,12 +105,6 @@ impl LegacyFeatureToggles {
110105
self.tools_web_search,
111106
"tools.web_search",
112107
);
113-
set_if_some(
114-
features,
115-
Feature::ViewImageTool,
116-
self.include_view_image_tool,
117-
"include_view_image_tool",
118-
);
119108
set_if_some(
120109
features,
121110
Feature::ViewImageTool,

codex-rs/exec/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ pub async fn run_main(cli: Cli, codex_linux_sandbox_exe: Option<PathBuf>) -> any
177177
developer_instructions: None,
178178
compact_prompt: None,
179179
include_apply_patch_tool: None,
180-
include_view_image_tool: None,
181180
show_raw_agent_reasoning: oss.then_some(true),
182181
tools_web_search_request: None,
183182
experimental_sandbox_command_assessment: None,

codex-rs/mcp-server/src/codex_tool_config.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ impl CodexToolCallParam {
167167
developer_instructions,
168168
compact_prompt,
169169
include_apply_patch_tool: None,
170-
include_view_image_tool: None,
171170
show_raw_agent_reasoning: None,
172171
tools_web_search_request: None,
173172
experimental_sandbox_command_assessment: None,

codex-rs/tui/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ pub async fn run_main(
147147
developer_instructions: None,
148148
compact_prompt: None,
149149
include_apply_patch_tool: None,
150-
include_view_image_tool: None,
151150
show_raw_agent_reasoning: cli.oss.then_some(true),
152151
tools_web_search_request: cli.web_search.then_some(true),
153152
experimental_sandbox_command_assessment: None,

docs/config.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,12 @@ Though using this option may also be necessary if you try to use Codex in enviro
312312

313313
### tools.\*
314314

315-
Use the optional `[tools]` table to toggle built-in tools that the agent may call. Both keys default to `false` (tools stay disabled) unless you opt in:
315+
Use the optional `[tools]` table to toggle built-in tools that the agent may call. `web_search` stays off unless you opt in, while `view_image` is now enabled by default:
316316

317317
```toml
318318
[tools]
319319
web_search = true # allow Codex to issue first-party web searches without prompting you
320-
view_image = true # let Codex attach local images (paths in your workspace) to the model request
320+
view_image = false # disable image uploads (they're enabled by default)
321321
```
322322

323323
`web_search` is also recognized under the legacy name `web_search_request`. The `view_image` toggle is useful when you want to include screenshots or diagrams from your repo without pasting them manually. Codex still respects sandboxing: it can only attach files inside the workspace roots you allow.
@@ -926,7 +926,7 @@ Valid values:
926926
| `experimental_use_exec_command_tool` | boolean | Use experimental exec command tool. |
927927
| `projects.<path>.trust_level` | string | Mark project/worktree as trusted (only `"trusted"` is recognized). |
928928
| `tools.web_search` | boolean | Enable web search tool (alias: `web_search_request`) (default: false). |
929+
| `tools.view_image` | boolean | Enable or disable the `view_image` tool so Codex can attach local image files from the workspace (default: true). |
929930
| `forced_login_method` | `chatgpt` \| `api` | Only allow Codex to be used with ChatGPT or API keys. |
930931
| `forced_chatgpt_workspace_id` | string (uuid) | Only allow Codex to be used with the specified ChatGPT workspace. |
931932
| `cli_auth_credentials_store` | `file` \| `keyring` \| `auto` | Where to store CLI login credentials (default: `file`). |
932-
| `tools.view_image` | boolean | Enable the `view_image` tool so Codex can attach local image files from the workspace (default: false). |

0 commit comments

Comments
 (0)