From 459a79eb85400af759e9220c7bafb4429ae07516 Mon Sep 17 00:00:00 2001 From: rhan-oai Date: Sat, 5 Sep 2026 01:14:48 +0000 Subject: [PATCH] Use static instructions for the Default collaboration mode (#42904) ## What changed Write Default and Plan directly into the default mode instructions and use the text without template rendering. Remove the mode-name formatting helpers and the `codex-utils-template` dependency from `codex-models-manager`. Update the instruction test to retain checks for `request_user_input` availability guidance while removing placeholder assertions. GitOrigin-RevId: d6afa478c30f991baa9ef4d5459e84354f29ce17 --- codex-rs/Cargo.lock | 1 - .../templates/default.md | 2 +- codex-rs/models-manager/Cargo.toml | 1 - .../src/collaboration_mode_presets.rs | 28 +------------------ .../src/collaboration_mode_presets_tests.rs | 8 +----- 5 files changed, 3 insertions(+), 37 deletions(-) diff --git a/codex-rs/Cargo.lock b/codex-rs/Cargo.lock index fdb11e5b5a..edd0b9a78b 100644 --- a/codex-rs/Cargo.lock +++ b/codex-rs/Cargo.lock @@ -3986,7 +3986,6 @@ dependencies = [ "codex-otel", "codex-protocol", "codex-utils-output-truncation", - "codex-utils-template", "pretty_assertions", "serde", "serde_json", diff --git a/codex-rs/collaboration-mode-templates/templates/default.md b/codex-rs/collaboration-mode-templates/templates/default.md index 4a4350a9eb..61c086d551 100644 --- a/codex-rs/collaboration-mode-templates/templates/default.md +++ b/codex-rs/collaboration-mode-templates/templates/default.md @@ -2,7 +2,7 @@ You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active. -Your active mode changes only when new developer instructions with a different `...` change it; user requests or tool descriptions do not change mode by themselves. Known mode names are {{KNOWN_MODE_NAMES}}. +Your active mode changes only when new developer instructions with a different `...` change it; user requests or tool descriptions do not change mode by themselves. Known mode names are Default and Plan. ## request_user_input availability diff --git a/codex-rs/models-manager/Cargo.toml b/codex-rs/models-manager/Cargo.toml index 2655bb2e7f..ab1bf70c8a 100644 --- a/codex-rs/models-manager/Cargo.toml +++ b/codex-rs/models-manager/Cargo.toml @@ -20,7 +20,6 @@ codex-login = { workspace = true } codex-otel = { workspace = true } codex-protocol = { workspace = true } codex-utils-output-truncation = { workspace = true } -codex-utils-template = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } tokio = { workspace = true, features = ["fs", "sync", "time"] } diff --git a/codex-rs/models-manager/src/collaboration_mode_presets.rs b/codex-rs/models-manager/src/collaboration_mode_presets.rs index 72731c52d3..b8fc3da738 100644 --- a/codex-rs/models-manager/src/collaboration_mode_presets.rs +++ b/codex-rs/models-manager/src/collaboration_mode_presets.rs @@ -2,16 +2,7 @@ use codex_collaboration_mode_templates::DEFAULT as COLLABORATION_MODE_DEFAULT; use codex_collaboration_mode_templates::PLAN as COLLABORATION_MODE_PLAN; use codex_protocol::config_types::CollaborationModeMask; use codex_protocol::config_types::ModeKind; -use codex_protocol::config_types::TUI_VISIBLE_COLLABORATION_MODES; use codex_protocol::openai_models::ReasoningEffort; -use codex_utils_template::Template; -use std::sync::LazyLock; - -const KNOWN_MODE_NAMES_TEMPLATE_KEY: &str = "KNOWN_MODE_NAMES"; -static COLLABORATION_MODE_DEFAULT_TEMPLATE: LazyLock