[Feat] Integrate DCG with command auto-approval and denial UX - #1062
[Feat] Integrate DCG with command auto-approval and denial UX#1062navedmerchant wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
e655ee2 to
28fb788
Compare
3e1b109 to
5f6e0a8
Compare
|
|
||
| describe("Destructive Command Guard auto-approval precedence", () => { | ||
| const baseState = { | ||
| autoApprovalEnabled: true, |
There was a problem hiding this comment.
All tests here keep autoApprovalEnabled: true. Is there a case worth covering where a user has DCG on but global auto-approval off? The early exit at index.ts:63 handles it, but nothing asserts that DCG never fires when auto-approval is disabled.
| // marks commands blocked by DCG as protected before reaching this check, | ||
| // which keeps the explicit user approval prompt for those commands. | ||
| if (state.destructiveCommandGuardEnabled === true) { | ||
| return { decision: "approve" } |
There was a problem hiding this comment.
When DCG is enabled, this approves all DCG-allowed commands before getCommandDecision runs — so any entries in deniedCommands are silently bypassed. Worth noting in the comment above, or is that intentional and already communicated elsewhere?
Related GitHub Issue
Closes #1058
Completes #1049. Split from #1050.
Description
Completes the feature at the command approval boundary. DCG-approved commands can bypass the legacy allowlist only when command auto-approval and DCG are enabled. DCG-blocked commands are protected and require explicit approval. Disabling DCG preserves existing behavior. Localized reason/rule feedback and a dedicated denied-command chat state are included.
A user can still explicitly approve a DCG-blocked command; denying it does not execute it.
Stack
4 / 4 — base:
feat/dcg-settingThe complete stack tip is tree-identical to the original #1050 branch, so no original change was dropped.
Test Procedure
Result: 41 extension, 7 type-package, and 40 webview tests passed; type-checks, production builds, lint, pre-push checks, and i18n validation passed.
Checklist