feat(search_tool): gate search_tool on model supports_search_tool field (#14502)

This commit is contained in:
Anton Panasenko
2026-03-12 16:03:50 -07:00
committed by GitHub
parent a2546d5dff
commit 651717323c
14 changed files with 50 additions and 17 deletions

View File

@@ -5,6 +5,7 @@ use anyhow::Result;
use codex_core::CodexAuth;
use codex_core::config::Config;
use codex_core::features::Feature;
use codex_protocol::openai_models::ModelsResponse;
use codex_protocol::protocol::AskForApproval;
use codex_protocol::protocol::EventMsg;
use codex_protocol::protocol::McpInvocation;
@@ -93,6 +94,17 @@ fn configure_apps(config: &mut Config, apps_base_url: &str) {
.disable(Feature::AppsMcpGateway)
.expect("test config should allow feature update");
config.chatgpt_base_url = apps_base_url.to_string();
config.model = Some("gpt-5-codex".to_string());
let mut model_catalog: ModelsResponse =
serde_json::from_str(include_str!("../../models.json")).expect("valid models.json");
let model = model_catalog
.models
.iter_mut()
.find(|model| model.slug == "gpt-5-codex")
.expect("gpt-5-codex exists in bundled models.json");
model.supports_search_tool = true;
config.model_catalog = Some(model_catalog);
}
fn configured_builder(apps_base_url: String) -> TestCodexBuilder {