Skip to content

fix(vscode): dismiss stale permission responses - #11118

Merged
marius-kilocode merged 1 commit into
mainfrom
carnation-trilby
Jun 11, 2026
Merged

fix(vscode): dismiss stale permission responses#11118
marius-kilocode merged 1 commit into
mainfrom
carnation-trilby

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

PR #10822 changed SDK failures produced with throwOnError from structured top-level objects into real Error instances whose HTTP status and response body live under cause. The VS Code permission handler still inspected only top-level fields, so it stopped recognizing the 404 returned when another panel, auto-approve flow, or covered permission rule had already resolved the same request.

That race is expected because multiple mounted views can observe a permission before the backend resolution event reaches all of them. Since the stale detector missed the wrapped shape, selecting persistent permission rules could log Failed to save always-rules, show an error toast, and leave an obsolete prompt visible. This regressed the stale-prompt recovery introduced in #9450.

This change recognizes both the existing direct error shapes and the SDK-wrapped cause.status / cause.body shape. A stale save or reply now clears the request and refreshes pending permissions, while non-404 failures continue through the normal error path. Regression coverage exercises wrapped 404s in both persistence and reply paths and verifies that wrapped server errors are not misclassified.

@kilo-code-bot

kilo-code-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The implementation is correct. isNotFoundError now handles both the legacy direct-shape errors and the new SDK-wrapped Error with cause.status / cause.body, while preserving all existing detection paths. The test additions cover the two new code paths (save 404, reply 404) and add a negative case confirming non-404 SDK errors are not misclassified. The spyOn / mockRestore pair in the 500 test is clean with no leak risk. Changeset and description are both present and user-facing.

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

Fix these issues in Kilo Cloud


Reviewed by claude-4.6-sonnet-20260217 · 243,021 tokens

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit fe4a1ff into main Jun 11, 2026
21 checks passed
@marius-kilocode
marius-kilocode deleted the carnation-trilby branch June 11, 2026 13:03
NJ-2020 pushed a commit to NJ-2020/kilocode that referenced this pull request Jul 4, 2026
…lo-Org#11118)

Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…lo-Org#11118)

Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
fix(vscode): dismiss stale permission responses
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