| 6510 | } |
| 6511 | |
| 6512 | static int cbm_remove_qwen_lifecycle_hooks(const char *settings_path, const char *binary_path, |
| 6513 | bool windows) { |
| 6514 | char command[CLI_BUF_8K]; |
| 6515 | char released_command[CLI_BUF_8K]; |
| 6516 | char shell[CLI_BUF_32]; |
| 6517 | if (cbm_build_qwen_hook_command(binary_path, windows, command, sizeof(command), shell, |
| 6518 | sizeof(shell)) != CLI_OK || |
| 6519 | (windows ? cbm_build_augment_command_windows(binary_path, released_command, |
| 6520 | sizeof(released_command)) |
| 6521 | : cbm_build_augment_command(binary_path, released_command, |
| 6522 | sizeof(released_command))) != CLI_OK) { |
| 6523 | return CLI_ERR; |
| 6524 | } |
| 6525 | int lifecycle_result = cbm_remove_paired_lifecycle_hooks_json(settings_path, command); |
| 6526 | int legacy_result = cbm_remove_paired_lifecycle_hooks_json(settings_path, released_command); |
| 6527 | int read_result = remove_hooks_json((hooks_remove_args_t){ |
| 6528 | .settings_path = settings_path, |
| 6529 | .hook_event = "PostToolUse", |
| 6530 | .matcher_str = "ReadFile", |
| 6531 | .match_command_exact = command, |
| 6532 | }); |
| 6533 | return lifecycle_result == CLI_OK && legacy_result == CLI_OK && read_result == CLI_OK ? CLI_OK |
| 6534 | : CLI_ERR; |
| 6535 | } |
| 6536 | |
| 6537 | static int cbm_upsert_factory_hooks(const char *settings_path, const char *binary_path) { |
| 6538 | char command[CLI_BUF_8K]; |
no test coverage detected