Skip to content

fix(vscode): fall back to session directory for permission replies - #14738

Merged
brunoagatao merged 1 commit into
mainfrom
fix/permission-unknown-route
Oct 7, 2026
Merged

brunoagatao merged 1 commit into
mainfrom
fix/permission-unknown-route

Conversation

@brunoagatao

Copy link
Copy Markdown
Collaborator

Fixes #14467

What: handlePermissionResponse now falls back to getWorkspaceDirectory(target) when no permission directory is recorded.

Why: After an SSE reconnect/prune, or for child subagent permissions, no directory was recorded. The reply hit Unknown permission route, showed "Failed to update permissions", and left the dialog stuck. question.ts already uses the same fallback.

The old test asserted no fallback; it now asserts the session-directory fallback.

@kilo-code-bot

kilo-code-bot Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

lgtm

The change makes handlePermissionResponse fall back to getWorkspaceDirectory(target) when no permission directory is recorded, matching the existing question.ts fallback. This correctly addresses the SSE-reconnect/prune and child-subagent cases where the reply previously hit Unknown permission route and left the dialog stuck. The backend still validates the requestID against the target directory, so an incorrect fallback degrades to the existing stale/404 path rather than mis-applying a rule. No new resource leaks (no added listeners, timers, or unbounded maps); clearPermissionDirectory is still called on every terminal path.

Files Reviewed (3 files)
  • .changeset/fix-permission-unknown-route.md
  • packages/kilo-vscode/src/kilo-provider/handlers/permission-handler.ts
  • packages/kilo-vscode/tests/unit/permission-recovery.test.ts

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

Review guidance: REVIEW.md from base branch main

@brunoagatao
brunoagatao merged commit 6f5e9ca into main Oct 7, 2026
27 checks passed
@brunoagatao
brunoagatao deleted the fix/permission-unknown-route branch October 7, 2026 12:50
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.

[Bug] Permission dialog gets stuck with "Failed to update permissions" when child subagent triggers permission prompt ("Unknown permission route")

2 participants