Skip to content

fix(cli): accept cooperation context for debug rule mutations - #781

Open
Shizuku-in wants to merge 2 commits into
Tencent:mainfrom
Shizuku-in:fix/cli-debug-rule-context
Open

Shizuku-in wants to merge 2 commits into
Tencent:mainfrom
Shizuku-in:fix/cli-debug-rule-context

Conversation

@Shizuku-in

Copy link
Copy Markdown

Problem

The CLI rejected --context and --observation for debug rule_add, rule_disable, rule_enable, and rule_remove because its dispatch check only allowed replay to carry those flags. Omitting them caused shared-tab cooperation checks to reject the request, leaving CLI users unable to manage interception or mock rules.

Fix

Use DebugAction::cooperation_guarded() in the CLI, matching the MCP implementation. All four rule mutations now accept the IDs returned by sync. Unguarded debug actions continue to reject these flags.

Verification

Before the fix, the regression test failed on rule_add with invalid_params. It now verifies that all four commands forward the supplied context_id and observation_id to a mock daemon over IPC.

All 9 target_control_cli integration tests passed:

cargo test --locked -p bsk --test integration target_control_cli::

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant