| 11747 | const char *instr_path; |
| 11748 | } mcp_uninstall_args_t; |
| 11749 | static void uninstall_agent_mcp_instr(mcp_uninstall_args_t paths, bool dry_run, |
| 11750 | int (*remove_fn)(const char *, const char *)) { |
| 11751 | const char *name = paths.name; |
| 11752 | const char *instr_path = paths.instr_path; |
| 11753 | if (!dry_run) { |
| 11754 | char binary_path[CLI_BUF_1K]; |
| 11755 | cbm_agent_installed_binary_path(cbm_get_home_dir(), binary_path, sizeof(binary_path)); |
| 11756 | int remove_result = remove_fn(binary_path, paths.config_path); |
| 11757 | if (remove_result < CLI_OK) { |
| 11758 | record_agent_config_error(true, name, "mcp_uninstall", paths.config_path); |
| 11759 | } else if (remove_result > CLI_OK) { |
| 11760 | printf("%s: preserved modified or foreign MCP entry\n", name); |
| 11761 | } |
| 11762 | } |
| 11763 | printf("%s: removed MCP config entry\n", name); |
| 11764 | if (instr_path) { |
| 11765 | if (!dry_run) { |
| 11766 | if (cbm_remove_instructions(instr_path) != CLI_OK) { |
| 11767 | record_agent_config_error(true, name, "instructions_uninstall", instr_path); |
| 11768 | } |
| 11769 | } |
| 11770 | printf(" removed instructions\n"); |
| 11771 | } |
| 11772 | } |
| 11773 | |
| 11774 | static bool uninstall_codex_activation_pointer(const char *path, bool dry_run) { |
| 11775 | return path && (dry_run || cbm_remove_instructions(path) == CLI_OK); |
no test coverage detected