fix(cli): keep workspace flags intact in bash auto-approve suggestions - #10388
Closed
markijbema wants to merge 7 commits into
Closed
fix(cli): keep workspace flags intact in bash auto-approve suggestions#10388markijbema wants to merge 7 commits into
markijbema wants to merge 7 commits into
Conversation
Permission rule suggestions ran tokens straight through BashArity.prefix, which is purely positional. For 'pnpm --filter web typecheck' that produced the chip 'pnpm --filter *' because '--filter' counted as the second token of pnpm's arity-2 entry. Add a Kilo-owned KiloFlagArity wrapper that recognizes a small set of '<command> <flag> <arg>' pairs (pnpm --filter, npm --workspace, git -C, cargo --package, ...), strips them before the dictionary lookup, and re-injects them after. Wire bash.ts and bash-hierarchy.ts to use it. Real logic + tests live under src/kilocode/, so the upstream diff is one imported module and one swapped function call.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The incremental diff since the last review (
No new issues introduced. All previously reviewed logic remains clean. Files Reviewed (7 files)
Reviewed by claude-4.6-sonnet-20260217 · 179,588 tokens Review guidance: REVIEW.md from base branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Permission rule chips for bash commands collapsed
pnpm --filter web typechecktopnpm --filter *becauseBashArity.prefixis purely positional and--filteraccidentally counted as the second token of pnpm's arity-2 entry.This adds a Kilo-owned
KiloFlagAritywrapper that recognizes<command> <flag> <arg>pairs (pnpm --filter/-F,npm --workspace/-w,yarn --cwd,git -C,cargo --package/-p/--manifest-path), strips them before the upstream lookup, and re-injects them after. Result: the chip becomespnpm --filter web typecheck *.Merge-conflict isolation
All real logic and tests live under
packages/opencode/src/kilocode/permission/andpackages/opencode/test/kilocode/permission/. The upstream diff against opencode is two lines inpackages/opencode/src/tool/bash.ts(one new import, one swapped function call), both behind// kilocode_changemarkers.src/permission/arity.tsis unchanged.Related: #10384