Skip to content

refactor(cli): share common bash permission entries - #13648

Merged
marius-kilocode merged 2 commits into
mainfrom
dedupe-c-bash-permissions
Sep 1, 2026
Merged

refactor(cli): share common bash permission entries#13648
marius-kilocode merged 2 commits into
mainfrom
dedupe-c-bash-permissions

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The default Bash permissions and read-only Bash permissions repeat the same 28 allow entries.

Why This Change Was Made

Keep the identical entries in one private constant and spread them into both existing maps. Preserve property order: each wildcard stays first, and all mode-specific rules and deny overrides stay after the common entries. Both exports remain separate objects. No permission policy changes.

User Impact

No intended behavior change. Default, Ask, Plan, and Explore command permissions remain the same.

Evidence

  • Two files only: 7 added lines, 39 removed, net reduction of 32 lines (23 production and 9 allowlist).
  • No new files or tests. All 157 existing tests in ask-agent-permissions, agent-permission-overrides, and plan-mode-subagent-bypass pass.
  • CLI typecheck, focused lint, annotation check, and git diff check pass.
  • Fresh duplication report: 33 to 32 pairs, 614 to 586 duplicated lines, 4367 to 4254 duplicated tokens. Only fingerprint 9044b540f896a694 removed; ratchet passes.
  • Existing tests exercise permission evaluation and actual agent construction. No model requests or manual UI session were needed for this literal-only extraction.

@kilo-code-bot

kilo-code-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/opencode/src/kilocode/agent/index.ts
  • script/kilocode-duplication-allowlist.json

Reviewed by grok-4.6 · Input: 64.2K · Output: 5.9K · Cached: 209.4K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit c861cce into main Sep 1, 2026
31 checks passed
@marius-kilocode
marius-kilocode deleted the dedupe-c-bash-permissions branch September 1, 2026 10:24
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.

2 participants