Skip to content

fix(vscode): preserve draft when toggling sandbox - #11672

Merged
marius-kilocode merged 4 commits into
mainfrom
fix-sandbox-toggle-prompt
Jun 25, 2026
Merged

fix(vscode): preserve draft when toggling sandbox#11672
marius-kilocode merged 4 commits into
mainfrom
fix-sandbox-toggle-prompt

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

Sandbox controls are session-scoped, so toggling them from a new sidebar chat creates a backend session before the first message is sent. That session transition changed the prompt draft key from the new-chat bucket to the created session bucket, which restored an empty draft when no pending draft ID existed.

Preserve the active new-chat draft before requesting the sandbox transition, then migrate its text, review comments, and image attachments into the created session when the matching draftless sessionCreated event arrives. Other draftless session creation remains untouched, preserving draft isolation and normal send behavior.

Comment thread packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx Outdated
@kilo-code-bot

kilo-code-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • 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 cbe29c6)

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

Previous review (commit cbe29c6)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0

Fix these issues in Kilo Cloud

Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx 571 Draft edits made while sandbox session creation is pending can stay behind in the new bucket instead of following the created session.
Files Reviewed (5 files)
  • .changeset/keep-sandbox-toggle-drafts.md - 0 issues
  • packages/kilo-vscode/tests/unit/prompt-drafts.test.ts - 0 issues
  • packages/kilo-vscode/tests/unit/prompt-input-connection-guard.test.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/src/utils/prompt-drafts.ts - 0 issues

Reviewed by gpt-5.4-2026-03-05 · Input: 105.3K · Output: 26.8K · Cached: 1.6M

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode force-pushed the fix-sandbox-toggle-prompt branch from df59613 to 8047854 Compare June 25, 2026 08:33
@marius-kilocode
marius-kilocode merged commit 761b633 into main Jun 25, 2026
24 checks passed
@marius-kilocode
marius-kilocode deleted the fix-sandbox-toggle-prompt branch June 25, 2026 09:01
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…ompt

fix(vscode): preserve draft when toggling sandbox
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