| 11569 | } |
| 11570 | |
| 11571 | static void uninstall_copilot_durable_context(const char *home, bool dry_run) { |
| 11572 | char config_dir[CLI_BUF_1K]; |
| 11573 | char hook_path[CLI_BUF_1K]; |
| 11574 | char skills_dir[CLI_BUF_1K]; |
| 11575 | char agent_path[CLI_BUF_1K]; |
| 11576 | char binary_path[CLI_BUF_1K]; |
| 11577 | cbm_copilot_config_dir(home, config_dir, sizeof(config_dir)); |
| 11578 | snprintf(hook_path, sizeof(hook_path), "%s/hooks/codebase-memory-mcp.json", config_dir); |
| 11579 | snprintf(skills_dir, sizeof(skills_dir), "%s/skills", config_dir); |
| 11580 | snprintf(agent_path, sizeof(agent_path), "%s/agents/codebase-memory.agent.md", config_dir); |
| 11581 | cbm_agent_installed_binary_path(home, binary_path, sizeof(binary_path)); |
| 11582 | if (!dry_run && cbm_remove_copilot_hooks(hook_path, binary_path) != CLI_OK) { |
| 11583 | record_agent_config_error(true, "Copilot", "lifecycle_hook_uninstall", hook_path); |
| 11584 | } |
| 11585 | uninstall_agent_skill("Copilot", skills_dir, dry_run); |
| 11586 | uninstall_tiered_agent_profiles( |
| 11587 | (cbm_tiered_profile_set_t){ |
| 11588 | .label = "Copilot", |
| 11589 | .verify_path = agent_path, |
| 11590 | .binary_path = binary_path, |
| 11591 | .legacy_verify_content = legacy_copilot_verify_agent_content, |
| 11592 | .dialect = CBM_GRAPH_DIALECT_COPILOT, |
| 11593 | }, |
| 11594 | dry_run); |
| 11595 | printf(" removed SessionStart + SubagentStart hooks\n"); |
| 11596 | } |
| 11597 | |
| 11598 | static int cbm_remove_managed_instructions(const char *instructions_path) { |
| 11599 | if (cbm_remove_instructions(instructions_path) != CLI_OK) { |
no test coverage detected