From 95ec468619386ebb93506ac2091a48e5a558d25c Mon Sep 17 00:00:00 2001 From: swastik-oai Date: Wed, 7 Oct 2026 13:14:55 +0000 Subject: [PATCH] Add a feature flag for Code Mode tool description ordering (#51690) ## What changed Register `code_mode_tool_description_first` as an under-development feature, disabled by default, for placing tool descriptions before namespace descriptions in Code Mode. Add the boolean option to the configuration schema. GitOrigin-RevId: 5d7e2f7cef87a040f9d96b0d97c2697880c12c17 --- codex-rs/core/config.schema.json | 6 ++++++ codex-rs/features/src/lib.rs | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/codex-rs/core/config.schema.json b/codex-rs/core/config.schema.json index 7e81582207..4133cc374e 100644 --- a/codex-rs/core/config.schema.json +++ b/codex-rs/core/config.schema.json @@ -815,6 +815,9 @@ "code_mode_prewarm": { "type": "boolean" }, + "code_mode_tool_description_first": { + "type": "boolean" + }, "code_mode_tool_search": { "type": "boolean" }, @@ -7035,6 +7038,9 @@ "code_mode_prewarm": { "type": "boolean" }, + "code_mode_tool_description_first": { + "type": "boolean" + }, "code_mode_tool_search": { "type": "boolean" }, diff --git a/codex-rs/features/src/lib.rs b/codex-rs/features/src/lib.rs index 44d86eb43f..7cf5bef081 100644 --- a/codex-rs/features/src/lib.rs +++ b/codex-rs/features/src/lib.rs @@ -137,6 +137,8 @@ pub enum Feature { CodeModePrewarm, /// Terminate active code mode cells when their turn is interrupted. CodeModeInterrupt, + /// Put each tool's description before its namespace description in Code Mode. + CodeModeToolDescriptionFirst, /// Restrict model-visible tools to code mode entrypoints (`exec`, `wait`). CodeModeOnly, /// Keep eligible MCP/app and dynamic tools deferred in exec, only in Code Mode Only. @@ -1155,6 +1157,12 @@ pub const FEATURES: &[FeatureSpec] = &[ stage: Stage::UnderDevelopment, default_enabled: false, }, + FeatureSpec { + id: Feature::CodeModeToolDescriptionFirst, + key: "code_mode_tool_description_first", + stage: Stage::UnderDevelopment, + default_enabled: false, + }, FeatureSpec { id: Feature::InstantInterrupt, key: "instant_interrupt",