| 11788 | } |
| 11789 | |
| 11790 | static void uninstall_copilot_durable_context(const char *home, bool dry_run) { |
| 11791 | char config_dir[CLI_BUF_1K]; |
| 11792 | char hook_path[CLI_BUF_1K]; |
| 11793 | char skills_dir[CLI_BUF_1K]; |
| 11794 | char agent_path[CLI_BUF_1K]; |
| 11795 | char binary_path[CLI_BUF_1K]; |
| 11796 | cbm_copilot_config_dir(home, config_dir, sizeof(config_dir)); |
| 11797 | snprintf(hook_path, sizeof(hook_path), "%s/hooks/codebase-memory-mcp.json", config_dir); |
| 11798 | snprintf(skills_dir, sizeof(skills_dir), "%s/skills", config_dir); |
| 11799 | snprintf(agent_path, sizeof(agent_path), "%s/agents/codebase-memory.agent.md", config_dir); |
| 11800 | cbm_agent_installed_binary_path(home, binary_path, sizeof(binary_path)); |
| 11801 | if (!dry_run && cbm_remove_copilot_hooks(hook_path, binary_path) != CLI_OK) { |
| 11802 | record_agent_config_error(true, "Copilot", "lifecycle_hook_uninstall", hook_path); |
| 11803 | } |
| 11804 | uninstall_agent_skill("Copilot", skills_dir, dry_run); |
| 11805 | uninstall_tiered_agent_profiles( |
| 11806 | (cbm_tiered_profile_set_t){ |
| 11807 | .label = "Copilot", |
| 11808 | .verify_path = agent_path, |
| 11809 | .binary_path = binary_path, |
| 11810 | .legacy_verify_content = legacy_copilot_verify_agent_content, |
| 11811 | .dialect = CBM_GRAPH_DIALECT_COPILOT, |
| 11812 | }, |
| 11813 | dry_run); |
| 11814 | printf(" removed SessionStart + SubagentStart hooks\n"); |
| 11815 | } |
| 11816 | |
| 11817 | static int cbm_remove_managed_instructions(const char *instructions_path) { |
| 11818 | if (cbm_remove_instructions(instructions_path) != CLI_OK) { |
no test coverage detected