fix(vscode): preserve mode on first send - #12009
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Both previously reported WARNINGs remain resolved. The only change since the last review is a pure Prettier reformat of the Files Reviewed (5 files)
Previous Review Summaries (2 snapshots, latest commit 5d5c03f)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 5d5c03f)Status: No Issues Found | Recommendation: Merge Both previously reported WARNINGs are resolved in this update. Files Reviewed (4 files)
Previous review (commit d6fac4a)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (5 files)
Reviewed by claude-sonnet-5 · Input: 24 · Output: 3.9K · Cached: 446K Review guidance: REVIEW.md from base branch |
d6fac4a to
38ec57c
Compare
38ec57c to
5d5c03f
Compare
5d5c03f to
130b256
Compare
Revert the stylistic `const fresh` introduced by Kilo-Org#12009 to the inline ternary at both send sites so session.tsx drops back under the 3000-line max-lines lint cap (3001 -> 2999). The draft-agent seeding contract is preserved: a draftID is minted when there is no session, and the pending agent is seeded before promptAgent(scope) resolves. Update the two prompt-send-contract assertions to the compacted shape.
* fix(vscode): handle multiline bidi prompt input * fix(vscode): resolve pending prompt arrow snaps * fix(vscode): compact session draft-agent seeding under max-lines Revert the stylistic `const fresh` introduced by #12009 to the inline ternary at both send sites so session.tsx drops back under the 3000-line max-lines lint cap (3001 -> 2999). The draft-agent seeding contract is preserved: a draftID is minted when there is no session, and the pending agent is seeded before promptAgent(scope) resolves. Update the two prompt-send-contract assertions to the compacted shape. --------- Co-authored-by: Marius <marius@kilocode.ai>
…-agent-scope fix(vscode): preserve mode on first send
* fix(vscode): handle multiline bidi prompt input * fix(vscode): resolve pending prompt arrow snaps * fix(vscode): compact session draft-agent seeding under max-lines Revert the stylistic `const fresh` introduced by Kilo-Org#12009 to the inline ternary at both send sites so session.tsx drops back under the 3000-line max-lines lint cap (3001 -> 2999). The draft-agent seeding contract is preserved: a draftID is minted when there is no session, and the pending agent is seeded before promptAgent(scope) resolves. Update the two prompt-send-contract assertions to the compacted shape. --------- Co-authored-by: Marius <marius@kilocode.ai>


When the VS Code webview starts a new task, the mode and model selectors operate before the first backend session exists. The draft-id recovery change made first sends allocate a draft UUID before resolving the agent, which meant the model still came from the visible pending mode while the agent lookup fell back to the default mode for the new draft scope. That could run Plan with Code instructions, or Code with Ask instructions when Ask is configured as the default.
This preserves the pending mode by seeding the generated draft scope with the pending agent before resolving the first send agent and variant. When the backend creates the real session, the seeded draft selection is migrated normally and the pending selection is cleared. Existing draft scopes, including Agent Manager pending scopes, are not overwritten.
Fixes #11967
Related to #11974