fix(vscode): stop duplicate permission prompts (#408)#421
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
d2ce0f9 to
cba4b10
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes duplicate permission prompts in the VS Code webview (#408) by removing redundant UI rendering and implementing proper permission queue management with deduplication.
Changes:
- Added
permission-queue.tshelper functions withupsertPermissionandremoveSessionPermissionsto prevent duplicate permission entries - Integrated permission queue helpers into session context for proper state management
- Removed the custom permission dock from
ChatViewto eliminate duplicate rendering (permissions are now rendered only by kilo-ui'sMessagecomponent) - Scoped permissions by
sessionIDinDataBridgeto ensure only current session permissions are passed to UI components
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/kilo-vscode/webview-ui/src/context/permission-queue.ts |
New helper functions for permission queue management with upsert and session-based cleanup logic |
packages/kilo-vscode/webview-ui/src/context/session.tsx |
Integrated permission queue helpers: upsertPermission in handlePermissionRequest and removeSessionPermissions in session deletion |
packages/kilo-vscode/webview-ui/src/components/chat/ChatView.tsx |
Removed duplicate custom permission dock UI, keeping only the kilo-ui Message component rendering |
packages/kilo-vscode/webview-ui/src/App.tsx |
Scoped permissions by current sessionID in DataBridge before passing to DataProvider |
packages/kilo-vscode/tests/unit/permission-queue.test.ts |
Comprehensive unit tests for permission queue helpers covering append, update, and removal scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Thank you for the contribution! Looks good to me. The bot found this - seems safe to do:
Removing the ChatView permission dock entirely introduces a regression for permissions that don't have a tool field. The ToolPartDisplay in message-part.tsx:542 guards with if (!next || !next.tool) return undefined, so permissions without tool will have no UI rendered anywhere, while blocked() still hides PromptInput — deadlocking the user.
This happens today with doom-loop detection (processor.ts:157), which calls PermissionNext.ask() without setting tool.
Instead of removing the permission dock entirely, gate it so it only renders for permissions that lack tool:
<Show when={permissionRequest()} keyed>
{(perm) => (
<Show when={!perm.tool}>
{/* existing permission dock JSX, unchanged */}
</Show>
)}
</Show>Permissions with tool render inline via ToolPartDisplay (no duplicates — your fix). Permissions without tool (doom-loop, or any future permission type) still have a fallback UI. You'd just need to keep the decide function, responding signal, useLanguage import, and the dock JSX from dev — and wrap it in the extra <Show when={!perm.tool}>.
81a141a to
cba4b10
Compare
…-rendering-by-tool-presence Codex-generated pull request
|
@iscekic is attempting to deploy a commit to the Kilo Code Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
markijbema
left a comment
There was a problem hiding this comment.
I don't think packages/app should be changed, as that isnt used and/or shouldnt be used
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (5 files)
|
Fixes #408
Context
Fixes duplicate/stacked permission prompts in the VS Code webview (
#408).The UI was showing the same permission request in two places at once:
@kilocode/kilo-uiMessagerendering)ChatViewIt could also accumulate duplicate permission entries when the same permission event was delivered more than once.
Implementation
ChatViewso permission actions render in a single place.DataBridgepermissions by currentsessionIDbefore passing toDataProvider.upsertPermission(replace byid, no duplicates)removeSessionPermissions(cleanup on session delete)Screenshots
How to Test
/etc/hosts/tmp/kilo-permission-test/a.txt/tmp/kilo-permission-test/b.txtGet in Touch
thomas07374