Skip to content

fix(vscode): allow copying full provider errors while retrying - #15127

Open
hdcodedev wants to merge 6 commits into
Kilo-Org:mainfrom
hdcodedev:fix/vscode-retry-error-copy
Open

hdcodedev wants to merge 6 commits into
Kilo-Org:mainfrom
hdcodedev:fix/vscode-retry-error-copy

Conversation

@hdcodedev

@hdcodedev hdcodedev commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Issue

Fixes #15037

Context

Long provider errors were clipped in the VS Code WebView while a request was retrying. The hidden text contained the reason the request failed and the setting needed to resolve it. The retry row now lets the user copy the full message.

Implementation

  • Added a localized Copy error button that writes the complete retry message to the clipboard.
  • Added a Storybook retry state with the reproduced long provider error and browser tests at narrow and wide widths covering visibility, keyboard activation, mouse activation, clipboard contents, and state cleanup.

Screenshots / Video

Before

provider-error-truncated.mp4

After

provider-error-truncated-after.mp4
Screenshot 2026-10-15 at 21 36 59

How to Test

Manual/local verification

  • (human) Verified the implementation.
  • (agent) bun run typecheck from packages/kilo-vscode passed.
  • (agent) bun run lint from packages/kilo-vscode passed.
  • (agent) bunx playwright test tests/session-dock-stability.spec.ts --workers=2 from packages/kilo-vscode passed: 18 tests.
  • (agent) bun run check-kilocode-change from packages/kilo-vscode passed.
  • (agent) The push hook ran bun turbo typecheck --filter=!@kilocode/kilo-jetbrains and passed.

Reviewer test steps

The following fixture uses the same HTTP 503 response, error message, and model configuration as the recorded reproduction. It runs locally and requires no provider account.

Set up the local provider fixture

From the Kilo checkout, run this in a macOS/Linux shell with Node.js, Bun, and VS Code installed:

fixture=$(mktemp -d)
mkdir -p "$fixture/.kilo"
git -C "$fixture" init -q
cat > "$fixture/.kilo/kilo.json" <<'JSON'
{
  "model": "repro/error-model",
  "small_model": "repro/error-model",
  "provider": {
    "repro": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Local Error Repro",
      "options": {
        "baseURL": "http://127.0.0.1:18937/v1",
        "apiKey": "local-test"
      },
      "models": {
        "error-model": {
          "name": "Long Provider Error"
        }
      }
    }
  }
}
JSON
cat > "$fixture/provider.mjs" <<'JS'
import http from 'node:http'
import fs from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const dir = path.dirname(fileURLToPath(import.meta.url))
const message = 'The selected model cannot process this request because your workspace privacy policy restricts inference to Europe and the United States. This model is currently available through providers that require global routing. To resolve this error, open workspace privacy settings and set Allowed Regions to Global.'
fs.writeFileSync(path.join(dir, 'message.txt'), message)
const server = http.createServer((req, res) => {
  if (req.url === '/health') { res.writeHead(200); res.end('ready'); return }
  let body = ''
  req.on('data', chunk => body += chunk)
  req.on('end', () => {
    fs.appendFileSync(path.join(dir, 'requests.jsonl'), JSON.stringify({path:req.url,body,time:Date.now()})+'\n')
    const status = Number(fs.readFileSync(path.join(dir, 'status.txt'), 'utf8'))
    console.log('HTTP ' + status + ': ' + message)
    res.writeHead(status, {'Content-Type':'application/json', 'retry-after':'60'})
    res.end(JSON.stringify({error:{message,type:'invalid_request_error',code:'region_not_allowed'}}))
  })
})
fs.writeFileSync(path.join(dir, 'provider.pid'), String(process.pid))
server.listen(18937, '127.0.0.1', () => console.log('provider ready on 18937'))
JS
echo 503 > "$fixture/status.txt"

# Build and open this workspace in an isolated extension development host.
bun run extension:isolated -- --workspace "$fixture"

# Keep this terminal running during the test.
node "$fixture/provider.mjs"

Wait for provider ready on 18937. The fixture returns the complete error message with HTTP 503 and retry-after: 60. The workspace configuration selects repro/error-model at http://127.0.0.1:18937/v1 using the placeholder key local-test.

  1. In the launched VS Code window, open Kilo and confirm the selected model is Long Provider Error. Select it in the model picker if needed.
  2. Send Reply with OK. and wait for the retry row. Confirm the long status is clipped while Copy error and Cancel remain visible.
  3. Click Copy error, focus the chat input, and paste without sending. Confirm the pasted draft contains the entire fixture message, from The selected model cannot process this request through Allowed Regions to Global..
  4. Click Cancel. Confirm retrying stops, the retry controls disappear, and the pasted draft remains in the input. Stop the provider with Ctrl+C in its terminal when finished.

For a separate deterministic UI check, run bun run --cwd packages/kilo-vscode storybook from the Kilo checkout and open http://localhost:6007/?path=/story/chat--chat-view-session-dock-stability. Click toggle busy, then toggle retry. Verify Copy error with a mouse click and with Tab followed by Enter, pasting after each activation to check the complete message. Click toggle retry again to hide the copy control, then toggle busy to return to idle. The automated coverage runs with bunx playwright test tests/session-dock-stability.spec.ts --workers=2 from packages/kilo-vscode.

Blocked checks and substitute verification

  • None.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

Get in Touch

@github-actions github-actions Bot added area:vscode VS Code extension community Opened by someone outside the Kilo team needs-triage Waiting for a maintainer to look labels Oct 15, 2026
@hdcodedev
hdcodedev force-pushed the fix/vscode-retry-error-copy branch from afb0763 to 58d78fb Compare October 15, 2026 18:41
@hdcodedev
hdcodedev marked this pull request as ready for review October 15, 2026 19:21
@hdcodedev hdcodedev changed the title fix(vscode): show and copy provider errors while retrying fix(vscode): allow copying full provider errors while retrying Oct 15, 2026
<span class="sr-only">{language.t("session.messages.scrollToBottom")}</span>
</Button>
<Show when={isRetrying()}>
<Button

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: The new copy action gives no user-visible confirmation

Unlike the existing ToolErrorCard copy button (packages/ui/src/components/tool-error-card.tsx), which flips to a transient "Copied" state, this button stays on "Copy error" after activation and a failed clipboard write is only logged to the console. A short-lived confirmation (and/or a visible error surface) would tell the user the copy actually happened.

This is a suggestion only — if the constant label is deliberate to keep the retry row from reflowing, ignore it.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. The toast uses the app’s default bottom-right position. We can adjust it if needed.

Screenshot 2026-10-15 at 21 47 15

@kilo-code-bot

kilo-code-bot Bot commented Oct 15, 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/src/components/shared/WorkingIndicator.tsx 130 New copy button gives no success/failure feedback
Files Reviewed (4 files)
  • .changeset/quiet-retries-show-errors.md - ok (patch, user-facing wording)
  • packages/kilo-vscode/tests/session-dock-stability.spec.ts - ok
  • packages/kilo-vscode/webview-ui/src/components/shared/WorkingIndicator.tsx - 1 suggestion
  • packages/kilo-vscode/webview-ui/src/stories/chat.stories.tsx - ok

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash · Input: 64.3K · Output: 26.1K · Cached: 1.7M

Review guidance: REVIEW.md from base branch main

@github-actions github-actions Bot added the priority:p1 High: fixes and regressions. Set from the title. Change by hand. label Oct 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:vscode VS Code extension community Opened by someone outside the Kilo team needs-triage Waiting for a maintainer to look priority:p1 High: fixes and regressions. Set from the title. Change by hand.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VS Code: provider error messages are truncated in the WebView; important details get hidden

1 participant