mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 12:40:44 +00:00
* fix(core): prevent malformed permission rules from becoming tool-wide catch-alls A permission rule with unbalanced parentheses (e.g. `Bash(rm -rf /)*`) was silently parsed with `specifier: undefined`, causing `matchesRule` to treat it as a catch-all that matches every invocation of the tool. For deny rules this blocked all commands; for allow rules a typo could silently auto-approve everything. Add an `invalid` flag to `PermissionRule`. `parseRule` now marks rules with unbalanced parens as invalid, `matchesRule` short-circuits them to never match, and all entry points (`addSession*Rule`, `addPersistentRule`, `parseRules`) warn on malformed input. `listRules` filters out invalid rules so they don't appear in the /permissions UI. * fix(cli): show error in /permissions dialog when adding malformed rule When a user enters a rule with unbalanced parentheses via the "Add Rule" input in the /permissions dialog, show an inline error message instead of silently accepting and then hiding the invalid rule. Closes #3459 Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com> |
||
|---|---|---|
| .. | ||
| auth | ||
| commands | ||
| components | ||
| contexts | ||
| editors | ||
| hooks | ||
| layouts | ||
| models | ||
| noninteractive | ||
| state | ||
| themes | ||
| utils | ||
| App.test.tsx | ||
| App.tsx | ||
| AppContainer.test.tsx | ||
| AppContainer.tsx | ||
| colors.ts | ||
| CommandFormatMigrationNudge.tsx | ||
| constants.ts | ||
| FeedbackDialog.tsx | ||
| IdeIntegrationNudge.tsx | ||
| keyMatchers.test.ts | ||
| keyMatchers.ts | ||
| semantic-colors.ts | ||
| textConstants.ts | ||
| types.ts | ||