MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / migrate_installed_agents

Function migrate_installed_agents

src/agents/mod.rs:1263–1270  ·  view source on GitHub ↗

Backfill `installed_agents` for users upgrading from older versions. Always scans every agent and adds any that have tracedecay configured (e.g. an `~/.claude.json` MCP server entry) but are absent from `installed_agents`. Without the additive scan, a user who installed agent A first and agent B later would have only A in the list, so `tracedecay reinstall` would silently skip B and its tool perm

(home: &Path, config: &mut crate::user_config::UserConfig)

Source from the content-addressed store, hash-verified

1261/// `tracedecay reinstall` would silently skip B and its tool permissions
1262/// would never be refreshed when new tools ship.
1263pub fn migrate_installed_agents(home: &Path, config: &mut crate::user_config::UserConfig) {
1264 let additions = detect_missing_installed_agents(home, &config.installed_agents);
1265 if additions.is_empty() {
1266 return;
1267 }
1268 config.installed_agents.extend(additions);
1269 config.save();
1270}
1271
1272#[cfg(test)]
1273#[allow(clippy::unwrap_used, clippy::expect_used)]

Calls 3

is_emptyMethod · 0.45
saveMethod · 0.45