feat(vscode): show approval reason outside workspace reads and writes - #13001
Merged
bagatao-anaconda merged 8 commits intoAug 7, 2026
Merged
Conversation
…ason-outside-workspace-reads # Conflicts: # packages/kilo-ui/src/components/message-part.tsx
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (26 files, incremental since d1630fc)
Previous Review Summaries (3 snapshots, latest commit d1630fc)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit d1630fc)Status: No Issues Found | Recommendation: Merge Files Reviewed (20 files, incremental since 0c9b640)
Previous review (commit 0c9b640)Status: No Issues Found | Recommendation: Merge Files Reviewed (28 files)
Previous review (commit 4add8d9)Status: No Issues Found | Recommendation: Merge Files Reviewed (8 files)
Reviewed by kimi-k3 · Input: 101.5K · Output: 14.9K · Cached: 1.4M Review guidance: REVIEW.md from base branch |
johnnyeric
approved these changes
Aug 7, 2026
…ason-outside-workspace-reads-and-writes
bagatao-anaconda
enabled auto-merge
August 7, 2026 17:32
bagatao-anaconda
deleted the
feat/show-approval-reason-outside-workspace-reads-and-writes
branch
August 7, 2026 17:38
5 tasks
t7tran
pushed a commit
to t7tran/kilocode
that referenced
this pull request
Aug 14, 2026
…ason-outside-workspace-reads-and-writes feat(vscode): show approval reason outside workspace reads and writes
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.
Issue
No linked issue.
Context
readhides its tool-row details by default (it's high-frequency and low-risk), so it never showed the auto-approval reason line that other tools already surface viametadata.approval(added in #12494/#12995). On top of that, when a file tool's target path is outside the workspace,assertExternalDirectoryEffectissues anexternal_directorypermission ask before the tool's ownread/write/editask — and the second ask's approval metadata silently clobbered the first's, so even fixing the UI gap alone wouldn't have surfaced why the path was outside the workspace.This PR makes reads and writes outside the workspace show the approval reason, so an auto-approved external read is clearly explained instead of looking like a bypass — without adding noise to the common case of an ordinary in-workspace read.
Implementation
packages/opencode): addedPermissionProvenance.Approval.outsideWorkspaceand a smalltagOutsideWorkspace(approval, permission)helper that marks an approval when it answers anexternal_directoryask.session/tools.ts'sctx.askwiring now tags both the allow and deny paths with this helper — a minimal, single-call-site diff against the shared upstream file.PermissionProvenance.carryApprovalpreviously let a tool's second ask blindly overwrite the first ask'sapprovalmetadata. Since a file tool crossing the workspace boundary asks twice (external_directoryfirst, then its ownread/write/editpermission), the second ask's approval would silently drop theoutsideWorkspacemarker from the first.carryApprovalnow merges that marker forward onto the final approval instead of losing it, while still reporting the real final decision/rule.packages/kilo-ui):ToolApproval/ToolApprovalDisplaycarry the newoutsideWorkspaceflag through to a new line inToolApprovalLine. Thereadtool'shideDetailsis now conditional (!approval()?.approval.outsideWorkspace) instead of hardcoded — so its details (and the approval line) only show when the target was outside the workspace, keeping ordinary reads collapsed.write/editwere not touched; they already showed the approval line when present.ui.approval.outsideWorkspacetoen.ts, following the existingui.approval.*key pattern (other locales fall back to English until translated, same as existing untranslated keys).origin/mainafter fix(vscode): tool approval source display #12995 merged, which introduced a settings-drivenToolApprovalVisibilityProvidertoggle and reordered the approval line's placement inbasic-tool.tsx. Verified ouroutsideWorkspacegating composes correctly with that toggle (disabling "Show Auto-Approval Reason" hides our outside-workspace note too, as expected) and required no changes beyond a two-line import/export merge conflict.packages/opencode/src/session/tools.ts) as close to its original shape as possible per the merge-minimizer conventions — nokilocode_changemarkers needed inprovenance.ts(Kilo-owned path).Screenshots / Video
How to Test
Manual/local verification
bun run extensionto launch the extension in dev mode and manually verified in a real workspace: reading a file inside the workspace stays collapsed with no approval line; reading a file outside the workspace (e.g./tmp/outside-file.txt) shows the expanded approval line with the "path is outside your workspace" note, both on first prompt and after auto-resolving via a saved "always allow" rule. Confirmedwrite/editbehavior for in-workspace files is unchanged from before this change.Reviewer test steps
README.md) — expand the tool row and confirm no approval-reason line appears (unchanged behavior)./tmp/some-file.txt— approve theexternal_directoryprompt, then thereadprompt if asked separately.readtool row in the transcript and confirm it now shows an approval line including "path is outside your workspace".write/editto a file outside the workspace and confirm the same note appears; then repeat with an in-workspacewrite/editand confirm behavior is unchanged from before this PR.