Skip to content

fix(vscode): restore fresh prompt history recall - #12122

Closed
dengbushi wants to merge 1 commit into
Kilo-Org:mainfrom
dengbushi:fix/vscode-prompt-history-11945
Closed

fix(vscode): restore fresh prompt history recall#12122
dengbushi wants to merge 1 commit into
Kilo-Org:mainfrom
dengbushi:fix/vscode-prompt-history-11945

Conversation

@dengbushi

@dengbushi dengbushi commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #11945

What changed

Restore the newest prompt to keyboard history when it is the first message in a new chat.

Root cause

This regressed in fbe5f4cb from #11442. During the first send, session.sendMessage() synchronously changes the draft key from :new to :pending:<uuid>. PromptInput checked that key before appending the sent draft to history, so the guard returned early and skipped the append.

The fix moves only history.append(draft) before that changed-key guard. Dispatch still happens first, and the guard continues to protect the later UI cleanup/reset from stale state.

Validation

  • Focused prompt-history suites: 38 passed, 0 failed.
  • Extension typecheck, lint, Prettier check, and knip passed.
  • Repository pre-push typecheck passed, including the JetBrains package.

Local limitations

The full VS Code unit suite reproducibly had 39 failures in this Windows environment outside the touched tests (symlink, POSIX-path, and shell-environment assumptions); no clean-main baseline was run, so they are not claimed as pre-existing. A local development extension launch was also not completed because the Windows CLI build path was unavailable, so manual ArrowUp verification is not claimed.

@dengbushi
dengbushi force-pushed the fix/vscode-prompt-history-11945 branch from 7eaedaf to 62a89f2 Compare July 11, 2026 06:55
@dengbushi
dengbushi marked this pull request as ready for review July 11, 2026 06:55
@kilo-code-bot

kilo-code-bot Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .changeset/restore-vscode-prompt-history.md
  • packages/kilo-vscode/tests/unit/prompt-input-connection-guard.test.ts
  • packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
Previous Review Summary (commit 62a89f2)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 62a89f2)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .changeset/restore-vscode-prompt-history.md
  • packages/kilo-vscode/tests/unit/prompt-input-connection-guard.test.ts
  • packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx

Reviewed by gpt-5.6-sol-20260709 · Input: 56.4K · Output: 5.8K · Cached: 358.6K

Review guidance: REVIEW.md from base branch main

@dengbushi
dengbushi force-pushed the fix/vscode-prompt-history-11945 branch from 62a89f2 to d13b75d Compare July 11, 2026 11:22

Copy link
Copy Markdown
Contributor Author

Closing this PR because it has been superseded by #12201, which merged the same root-cause fix: record history.append(draft) after dispatch but before the draft-key guard. #12201 also includes equivalent regression coverage and a changeset, so retaining this PR would duplicate code, tests, and release notes.

@dengbushi dengbushi closed this Jul 14, 2026
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.

Recent prompts are not accessible via the up arrow key

1 participant