Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: show permission reasons before approval - #14079

Open
shabeeth2 wants to merge 3 commits into
Kilo-Org:mainfrom
shabeeth2:feat/permission-reasons
Open

feat: show permission reasons before approval#14079
shabeeth2 wants to merge 3 commits into
Kilo-Org:mainfrom
shabeeth2:feat/permission-reasons

Conversation

@shabeeth2

@shabeeth2 shabeeth2 commented Sep 12, 2026

Copy link
Copy Markdown

Issue

Fixes #14061

Context

Permission prompts show the requested command or filesystem scope, but do not consistently explain how that access relates to the user's task.

Implementation

Carry task descriptions through existing permission metadata and display a separate italicized Reason in the CLI and VS Code extension. Commands, paths, patterns, and approval controls remain unchanged.

Require a description in the model-facing read schema while preserving compatibility for direct calls that omit it. Missing or blank descriptions preserve existing metadata instead of substituting a generic reason. OpenCode integration uses narrow annotated hooks with Kilo-owned helpers.

Screenshots / Video

permission-reason-cli-evidence permission-reason-vscode-extention

CLI and VS Code screenshots are attached above and show the verified behavior.

How to Test

Human verification

The contributor tested the rebuilt CLI and development extension with: Read C:\Windows\System32\drivers\etc\hosts and explain how localhost names are resolved. Both screenshots show a labeled, italicized task reason separate from the requested scope and approval controls.

Reviewer steps

  1. Request a read outside the workspace and inspect the Reason, scope, and approval controls.
  2. Request a shell command requiring approval and inspect the Reason above the command.

Agent verification and limitations

  • Focused read-permission regression: 1 passed, including omitted and blank descriptions.
  • Earlier focused attachment and CLI rendering checks passed; VS Code transport, recovery, localization, and component checks: 135 passed.
  • Typechecks, VS Code lint, knip, compile, and OpenCode annotation checks passed during development.
  • The Windows equivalent forbidden-marker check passed; the native shell command requires unavailable !/grep support.
  • A broader OpenCode run timed out in three existing session scenarios (subagent exploration after a rejected read and both continue_loop_on_deny cases). Baseline comparison has not established their cause; this is not a claim that the full suite passes.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

@shabeeth2

Copy link
Copy Markdown
Author

Closing for now; the branch will be revised and a new PR opened later.

@shabeeth2 shabeeth2 closed this Sep 12, 2026
@shabeeth2 shabeeth2 reopened this Sep 13, 2026
@shabeeth2
shabeeth2 marked this pull request as ready for review September 13, 2026 00:23
@kilo-code-bot

kilo-code-bot Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Reviewed the full diff against current HEAD (e23ff25). Reconciled existing discussion: there are no inline review comments, so nothing is duplicated.

Notes from the review (no action required):

  • KiloRead.context closes over the original ctx, so the injected ask cannot recurse; description is merged without altering patterns/always, preserving permission matching.
  • KiloRead.schema derives from the cached JSON schema and returns a new object with a new required array, so the shared fromSchema cache is not mutated. sanitizeOpenAISchema preserves both properties.description and required.
  • Suppression of the reason for skill-shell and background-process approvals is consistent in effect across the CLI, TUI, and VS Code: the suppressed requests either carry no description (skill shell) or only surface on bash (background process).
  • No new subscriptions, timers, workers, or listeners are introduced, and the new test fixtures dispose their render roots and clean up temp files in finally blocks; no memory leaks identified.
Files Reviewed (39 files)
  • .changeset/permission-task-context.md
  • packages/kilo-vscode/tests/fixtures/permission-reason-render.tsx
  • packages/kilo-vscode/tests/unit/kilo-provider-utils.test.ts
  • packages/kilo-vscode/tests/unit/permission-reason-render.test.ts
  • packages/kilo-vscode/tests/unit/permission-recovery.test.ts
  • packages/kilo-vscode/webview-ui/src/components/chat/PermissionDock.tsx
  • packages/kilo-vscode/webview-ui/src/i18n/{ar,br,bs,da,de,en,es,fa,fr,it,ja,ko,nl,no,pl,ru,th,tr,uk,zh,zht}.ts
  • packages/kilo-vscode/webview-ui/src/styles/permission-dock.css
  • packages/opencode/src/cli/cmd/run/footer.permission.tsx
  • packages/opencode/src/kilocode/cli/cmd/run/footer.permission.tsx
  • packages/opencode/src/kilocode/tool/read.ts
  • packages/opencode/src/session/prompt.ts
  • packages/opencode/src/tool/read.ts
  • packages/opencode/src/tool/shell/prompt.ts
  • packages/opencode/test/kilocode/bash-permission-metadata.test.ts
  • packages/opencode/test/kilocode/cli/cmd/run/permission-description.test.tsx
  • packages/opencode/test/kilocode/read-permission-description.test.ts
  • packages/opencode/test/kilocode/session-prompt-permission-refresh.test.ts
  • packages/tui/src/routes/session/permission.tsx

Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

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.

Show why an agent needs permission before approval

1 participant