refactor(vscode): extract prompt sandbox response handling - #13537
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Reviewed by grok-4.6 · Input: 204.1K · Output: 9.3K · Cached: 300.5K Review guidance: REVIEW.md from base branch |
marius-kilocode
enabled auto-merge
August 28, 2026 10:05
WebReflection
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Sandbox response rules were embedded in the prompt component. Testing late responses, request matching, and retry decisions required source assertions instead of executing the response handler.
Why This Change Was Made
Extract only
sandboxDefaultStatus,sandboxStatus,sandboxStatusError, and the existingconfigUpdateddispatch into a runtime-independent helper. Each response branch has a small function under the normal complexity limit of 20 and reusesapplySandboxStatesand the existing message/state types.Signals, request tracking, retry timers, toast rendering, session identity, drafts, sending, keyboard handling, toolbar, rendering, and the current message subscription stay in
PromptInput. There are no backend, SDK, configuration, or release-note changes.User Impact
No intended behavior change. Preserve handled/unhandled results, stale version/revision ordering, matching request cleanup, default versus session handling, and current-session retry callbacks.
Evidence
Passed from
packages/kilo-vscode:bun run lint bun run typecheck bun run knip bun run check-kilocode-change bun run compile bun test tests/unit/prompt-sandbox-messages.test.ts tests/unit/prompt-input-utils.test.ts tests/unit/prompt-input-connection-guard.test.ts tests/unit/prompt-send-contract.test.tsThe targeted run passed all 165 tests. The new tests execute the real helper with simple state callbacks. Existing source contracts now check the extracted code and its wiring without removing coverage. An independent read-only review found no behavior changes.
Baseline lint passed at
142db490cc. The earliersession.tsxline-cap failure is not present on this base; no lint caps or shared configuration were changed. The build completed using its active-Bun fallback after the pinnedbunxinvocation failed. Its unrelated generated SDK change was discarded.Manual smoke test used isolated VS Code and Kilo storage, a disposable workspace, and a local-only provider. No prompts or model calls were sent. New-chat sandbox toggles received real responses and preserved the draft. Restarting and switching between a draft and a seeded session left the composer usable and restored the draft. The isolated instance and fixture storage were removed.
Manual limit: the empty seeded session received no
sandboxStatus, including after an explicit status request and restart, so its sandbox toggle could not be exercised. Session response handling is covered by the runtime tests; this PR does not change request routing.