Skip to content

Commit 9892365

Browse files
authored
fix: refine the warning message and docs for deprecated tools config (openai#7685)
Issue openai#7661 revealed that users are confused by deprecation warnings like: > `tools.web_search` is deprecated. Use `web_search_request` instead. This message misleadingly suggests renaming the config key from `web_search` to `web_search_request`, when the actual required change is to **move and rename the configuration from the `[tools]` section to the `[features]` section**. This PR clarifies the warning messages and documentation to make it clear that deprecated `[tools]` configurations should be moved to `[features]`. Changes made: - Updated deprecation warning format in `codex-rs/core/src/codex.rs:520` to include `[features].` prefix - Updated corresponding test expectations in `codex-rs/core/tests/suite/deprecation_notice.rs:39` - Improved documentation in `docs/config.md` to clarify upfront that `[tools]` options are deprecated in favor of `[features]`
1 parent 57ba9fa commit 9892365

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

codex-rs/core/src/codex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ impl Session {
536536

537537
for (alias, feature) in config.features.legacy_feature_usages() {
538538
let canonical = feature.key();
539-
let summary = format!("`{alias}` is deprecated. Use `{canonical}` instead.");
539+
let summary = format!("`{alias}` is deprecated. Use `[features].{canonical}` instead.");
540540
let details = if alias == canonical {
541541
None
542542
} else {

codex-rs/core/tests/suite/deprecation_notice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async fn emits_deprecation_notice_for_legacy_feature_flag() -> anyhow::Result<()
3636
let DeprecationNoticeEvent { summary, details } = notice;
3737
assert_eq!(
3838
summary,
39-
"`use_experimental_unified_exec_tool` is deprecated. Use `unified_exec` instead."
39+
"`use_experimental_unified_exec_tool` is deprecated. Use `[features].unified_exec` instead."
4040
.to_string(),
4141
);
4242
assert_eq!(

docs/config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,8 @@ Though using this option may also be necessary if you try to use Codex in enviro
350350

351351
### tools.\*
352352

353+
These `[tools]` configuration options are deprecated. Use `[features]` instead (see [Feature flags](#feature-flags)).
354+
353355
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:
354356

355357
```toml
@@ -358,8 +360,6 @@ web_search = true # allow Codex to issue first-party web searches without prom
358360
view_image = false # disable image uploads (they're enabled by default)
359361
```
360362

361-
`web_search` is deprecated; use the `web_search_request` feature flag instead.
362-
363363
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.
364364

365365
### approval_presets

0 commit comments

Comments
 (0)