| 11528 | const char *instr_path; |
| 11529 | } mcp_uninstall_args_t; |
| 11530 | static void uninstall_agent_mcp_instr(mcp_uninstall_args_t paths, bool dry_run, |
| 11531 | int (*remove_fn)(const char *, const char *)) { |
| 11532 | const char *name = paths.name; |
| 11533 | const char *instr_path = paths.instr_path; |
| 11534 | if (!dry_run) { |
| 11535 | char binary_path[CLI_BUF_1K]; |
| 11536 | cbm_agent_installed_binary_path(cbm_get_home_dir(), binary_path, sizeof(binary_path)); |
| 11537 | int remove_result = remove_fn(binary_path, paths.config_path); |
| 11538 | if (remove_result < CLI_OK) { |
| 11539 | record_agent_config_error(true, name, "mcp_uninstall", paths.config_path); |
| 11540 | } else if (remove_result > CLI_OK) { |
| 11541 | printf("%s: preserved modified or foreign MCP entry\n", name); |
| 11542 | } |
| 11543 | } |
| 11544 | printf("%s: removed MCP config entry\n", name); |
| 11545 | if (instr_path) { |
| 11546 | if (!dry_run) { |
| 11547 | if (cbm_remove_instructions(instr_path) != CLI_OK) { |
| 11548 | record_agent_config_error(true, name, "instructions_uninstall", instr_path); |
| 11549 | } |
| 11550 | } |
| 11551 | printf(" removed instructions\n"); |
| 11552 | } |
| 11553 | } |
| 11554 | |
| 11555 | static bool uninstall_codex_activation_pointer(const char *path, bool dry_run) { |
| 11556 | return path && (dry_run || cbm_remove_instructions(path) == CLI_OK); |
no test coverage detected