enable search config change

This commit is contained in:
Ahmed Ibrahim
2025-08-28 13:04:59 -07:00
parent 1a92267a40
commit 9286c891c0

View File

@@ -1083,13 +1083,14 @@ async fn submission_loop(
let mut updated_config = (*config).clone();
updated_config.model = effective_model.clone();
updated_config.model_family = effective_family.clone();
updated_config.tools_web_search_request = enable_web_search.unwrap_or(false);
updated_config.tools_web_search_request =
enable_web_search.unwrap_or(config.tools_web_search_request);
if let Some(model_info) = get_model_info(&effective_family) {
updated_config.model_context_window = Some(model_info.context_window);
}
let client = ModelClient::new(
Arc::new(updated_config),
Arc::new(updated_config.clone()),
auth_manager,
provider,
effective_effort,
@@ -1102,14 +1103,14 @@ async fn submission_loop(
.clone()
.unwrap_or(prev.sandbox_policy.clone());
let new_cwd = cwd.clone().unwrap_or_else(|| prev.cwd.clone());
// TODO: we need to not have both updated config and global config
let tools_config = ToolsConfig::new(&ToolsConfigParams {
model_family: &effective_family,
approval_policy: new_approval_policy,
sandbox_policy: new_sandbox_policy.clone(),
include_plan_tool: config.include_plan_tool,
include_apply_patch_tool: config.include_apply_patch_tool,
include_web_search_request: enable_web_search.unwrap_or(false),
include_web_search_request: updated_config.tools_web_search_request,
use_streamable_shell_tool: config.use_experimental_streamable_shell_tool,
include_view_image_tool: config.include_view_image_tool,
});
@@ -1188,6 +1189,7 @@ async fn submission_loop(
sess.session_id,
);
// TODO: we need to not have both updated config and global config
let fresh_turn_context = TurnContext {
client,
tools_config: ToolsConfig::new(&ToolsConfigParams {