Skip to content

fix(vscode): report failed mention drops and GitHub comment batches - #14113

Merged
marius-kilocode merged 2 commits into
mainfrom
quality/error-handling-prs-0914
Sep 14, 2026
Merged

marius-kilocode merged 2 commits into
mainfrom
quality/error-handling-prs-0914

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Two error paths added or extended by the drag-to-mention and GitHub inline-comment work silently reported success when nothing happened.

Why This Change Was Made

  • insertToken uses document.execCommand("insertText") but always returned true. The surrounding code already notes that execCommand can silently no-op. When that happens, insertDrop claimed the drag was consumed, so the caller did not restore the sidebar order and no mention appeared.
  • postAllGithub documents that it stops at the first failure, but a rejected github.send rejected the whole batch. Its caller has no finally, so sendAllPending stayed true and the button remained disabled with no error shown.

User Impact

  • A mention drop that did not insert is no longer treated as a handled drag.
  • A failed GitHub batch reports the error and keeps the failed and unposted comments for retry instead of leaving the control stuck.

Evidence

  • bun test tests/unit/comments-github.test.ts tests/unit/use-file-mention.test.ts -> 62 pass, 0 fail.
  • Related module batch (comments-github, use-file-mention, diff-comment-form, inline-comment-form, send-all-button, agent-manager-arch, pr-review-actions) -> 195 pass, 0 fail.
  • bun run lint -> exit 0.
  • Both new regression tests fail on the pre-fix code.

insertDrop now returns false when execCommand silently no-ops without
changing the editor, so drag callers do not treat a failed insert as a
consumed drag. postAllGithub now converts a rejected or synchronously
throwing send into the batch failure result, so it stops at the first
failure and the review UI clears its pending state instead of hanging.
Comment thread packages/kilo-vscode/webview-ui/diff-viewer/comments-github.ts
@kilo-code-bot

kilo-code-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/diff-viewer/comments-github.ts 135 User-facing fix has no changeset entry
Files Reviewed (4 files)
  • packages/kilo-vscode/webview-ui/diff-viewer/comments-github.ts - 1 issue
  • packages/kilo-vscode/webview-ui/src/hooks/useFileMention.ts - no issues
  • packages/kilo-vscode/tests/unit/comments-github.test.ts - no issues
  • packages/kilo-vscode/tests/unit/use-file-mention.test.ts - no issues

The two changes are correct and well-tested: postAllGithub now converts a rejected/synchronously-throwing send into a batch failure so sendAllToGithub clears sendAllPending and surfaces the error, and insertToken reports the drop as unhandled when execCommand leaves the textarea unchanged so drag callers no longer treat a silent no-op as a consumed drag. The new async send wrapper and the rejection branch are complementary and the regression tests cover both paths.

Fix these issues in Kilo Cloud


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

Review guidance: REVIEW.md from base branch main

…error-handling-prs-0914

# Conflicts:
#	packages/kilo-vscode/webview-ui/diff-viewer/comments-github.ts
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