Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:

# If assets/ changed, add crates that depend on those assets
if echo "$CHANGED_FILES" | grep -qP '^assets/'; then
FILE_CHANGED_PKGS=$(printf '%s\n%s\n%s\n%s' "$FILE_CHANGED_PKGS" "settings" "storybook" "assets" | sort -u)
FILE_CHANGED_PKGS=$(printf '%s\n%s\n%s' "$FILE_CHANGED_PKGS" "settings" "assets" | sort -u)
fi

# Combine all changed packages
Expand Down
4 changes: 2 additions & 2 deletions assets/settings/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@
"terminal": true,
"thinking": true,
"update_plan": true,
"web_search": true,
"search_web": true,
},
},
"ask": {
Expand All @@ -1095,7 +1095,7 @@
"spawn_agent": true,
"thinking": true,
"update_plan": true,
"web_search": true,
"search_web": true,
},
},
"minimal": {
Expand Down
2 changes: 1 addition & 1 deletion crates/agent/src/tools/web_search_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl AgentTool for WebSearchTool {
type Input = WebSearchToolInput;
type Output = WebSearchToolOutput;

const NAME: &'static str = "web_search";
const NAME: &'static str = "search_web";

fn kind() -> acp::ToolKind {
acp::ToolKind::Fetch
Expand Down
6 changes: 6 additions & 0 deletions crates/migrator/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,9 @@ pub(crate) mod m_2026_04_01 {

pub(crate) use settings::restructure_profiles_with_settings_key;
}

pub(crate) mod m_2026_04_10 {
mod settings;

pub(crate) use settings::rename_web_search_to_search_web;
}
64 changes: 64 additions & 0 deletions crates/migrator/src/migrations/m_2026_04_10/settings.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
use anyhow::Result;
use serde_json::Value;

use crate::migrations::migrate_settings;

const AGENT_KEY: &str = "agent";
const PROFILES_KEY: &str = "profiles";
const SETTINGS_KEY: &str = "settings";
const TOOL_PERMISSIONS_KEY: &str = "tool_permissions";
const TOOLS_KEY: &str = "tools";
const OLD_TOOL_NAME: &str = "web_search";
const NEW_TOOL_NAME: &str = "search_web";

pub fn rename_web_search_to_search_web(value: &mut Value) -> Result<()> {
migrate_settings(value, &mut migrate_one)
}

fn migrate_one(object: &mut serde_json::Map<String, Value>) -> Result<()> {
migrate_agent_value(object)?;

// Root-level profiles have a `settings` wrapper after m_2026_04_01,
// but `migrate_settings` calls us with the profile map directly,
// so we need to look inside `settings` too.
if let Some(settings) = object.get_mut(SETTINGS_KEY).and_then(|v| v.as_object_mut()) {
migrate_agent_value(settings)?;
}

Ok(())
}

fn migrate_agent_value(object: &mut serde_json::Map<String, Value>) -> Result<()> {
let Some(agent) = object.get_mut(AGENT_KEY).and_then(|v| v.as_object_mut()) else {
return Ok(());
};

if let Some(tools) = agent
.get_mut(TOOL_PERMISSIONS_KEY)
.and_then(|v| v.as_object_mut())
.and_then(|tp| tp.get_mut(TOOLS_KEY))
.and_then(|v| v.as_object_mut())
{
rename_key(tools);
}

if let Some(profiles) = agent.get_mut(PROFILES_KEY).and_then(|v| v.as_object_mut()) {
for (_profile_name, profile) in profiles.iter_mut() {
if let Some(tools) = profile
.as_object_mut()
.and_then(|p| p.get_mut(TOOLS_KEY))
.and_then(|v| v.as_object_mut())
{
rename_key(tools);
}
}
}

Ok(())
}

fn rename_key(tools: &mut serde_json::Map<String, Value>) {
if let Some(value) = tools.remove(OLD_TOOL_NAME) {
tools.insert(NEW_TOOL_NAME.to_string(), value);
}
}
Loading
Loading