| 10297 | } |
| 10298 | |
| 10299 | static void uninstall_copilot_durable_context(const char *home, bool dry_run) { |
| 10300 | char config_dir[CLI_BUF_1K]; |
| 10301 | char hook_path[CLI_BUF_1K]; |
| 10302 | char skills_dir[CLI_BUF_1K]; |
| 10303 | char agent_path[CLI_BUF_1K]; |
| 10304 | char binary_path[CLI_BUF_1K]; |
| 10305 | cbm_copilot_config_dir(home, config_dir, sizeof(config_dir)); |
| 10306 | snprintf(hook_path, sizeof(hook_path), "%s/hooks/codebase-memory-mcp.json", config_dir); |
| 10307 | snprintf(skills_dir, sizeof(skills_dir), "%s/skills", config_dir); |
| 10308 | snprintf(agent_path, sizeof(agent_path), "%s/agents/codebase-memory.agent.md", config_dir); |
| 10309 | cbm_agent_installed_binary_path(home, binary_path, sizeof(binary_path)); |
| 10310 | if (!dry_run && cbm_remove_copilot_hooks(hook_path, binary_path) != CLI_OK) { |
| 10311 | record_agent_config_error(true, "Copilot", "lifecycle_hook_uninstall", hook_path); |
| 10312 | } |
| 10313 | uninstall_agent_skill("Copilot", skills_dir, dry_run); |
| 10314 | uninstall_tiered_agent_profiles( |
| 10315 | (cbm_tiered_profile_set_t){ |
| 10316 | .label = "Copilot", |
| 10317 | .verify_path = agent_path, |
| 10318 | .binary_path = binary_path, |
| 10319 | .legacy_verify_content = legacy_copilot_verify_agent_content, |
| 10320 | .dialect = CBM_GRAPH_DIALECT_COPILOT, |
| 10321 | }, |
| 10322 | dry_run); |
| 10323 | printf(" removed SessionStart + SubagentStart hooks\n"); |
| 10324 | } |
| 10325 | |
| 10326 | static int cbm_remove_managed_instructions(const char *instructions_path) { |
| 10327 | if (cbm_remove_instructions(instructions_path) != CLI_OK) { |
no test coverage detected