feat(node): add Plan Mode and Steer support (Wire 1.5)#127
Merged
Conversation
Add SteerInputSchema, SetPlanModeResultSchema, StatusUpdate.plan_mode, ClientCapabilities.supports_plan_mode, and register SteerInput in WireEvent union and EventSchemas for the Wire 1.5 protocol upgrade.
…to Wire 1.5 - Bump PROTOCOL_VERSION from "1.4" to "1.5" - Add supports_plan_mode: true to client capabilities in sendInitialize - Import SetPlanModeResultSchema and SetPlanModeResult from schema - Add sendSetPlanMode method with schema validation - Add sendSteer method for mid-turn user steering
- Add planMode readonly property and setPlanMode method to Session interface - Add steer method to Turn interface for mid-turn user steering - Implement steer in TurnImpl delegating to ProtocolClient.sendSteer - Implement setPlanMode in SessionImpl with state validation - Track plan mode state via private _planMode field
- Add SteerInput and SetPlanModeResult to type exports from schema - Add SteerInputSchema and SetPlanModeResultSchema to schema exports
Wire up new bridge protocol methods for plan mode toggling and mid-turn steering, connecting the webview RPC layer to the SDK's Wire 1.5 capabilities.
Add backend handlers that delegate to Session.setPlanMode and Turn.steer from the SDK, completing the extension-side RPC dispatch for Wire 1.5 plan mode and mid-turn steering.
Add planMode to ChatState (reset on session reset, persistent across turns), tag top-level steps with planMode flag on StepBegin, extract plan_mode from StatusUpdate events, and add a no-op SteerInput handler for the server echo event.
Adds a visually distinct card with an amber-themed header to wrap plan-mode steps in the chat view.
Introduces groupStepsByPlanMode helper to cluster consecutive steps by their planMode flag and wraps plan-mode groups in PlanCard while preserving connector logic across group boundaries.
Adds a PlanModeButton component with amber styling when active, and integrates it into the InputArea bottom toolbar next to ThinkingButton. Uses optimistic state update with bridge.setPlanMode confirmation.
Adds an amber bolt icon button to queued messages that appears during streaming, allowing users to steer the current turn by inserting a queued message immediately via bridge.steerChat.
Normal groups now use Fragment instead of div wrapper so StepContent elements remain direct children of the spacing container. PlanCard inner div also gets the same spacing class.
SteerInput events from CLI are now displayed as a right-aligned user message bubble within the assistant's ongoing turn, showing what the user injected via steer.
When user clicks plan mode button to turn it OFF while agent is streaming, show a confirmation dialog. This prevents accidentally exiting plan mode in the current turn when the intent was to disable it for the next turn.
6a699c5 to
4278119
Compare
…rgets with UV fallback
…rgets with UV fallback Detect musl libc via ldd to distinguish Alpine from glibc Linux. Alpine platforms use musl-targeted UV binary for CLI installation since no native kimi CLI binary is available for musl.
…rgets with UV fallback
Alpine Linux is only relevant for Remote SSH scenarios where the extension server runs on the remote host. The cli-downloader runtime detection (isMusl) handles this — no separate .vsix needed.
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.
Summary
set_plan_modeRPC method,StatusUpdate.plan_modefield,capabilities.supports_plan_mode, PlanCard UI component (collapsible) with amber styling, PlanModeButton toggle with optimistic update and streaming exit confirmationsteerRPC method,SteerInputecho event with inline SteerBubble rendering, "Insert Now" button in queue panelkimi-agent-sdkto 0.1.6, vscode extension to 0.4.5Changes
SDK (
agent_sdk/)schema.ts—SteerInput,SetPlanModeResult,StatusUpdate.plan_mode,ClientCapabilities.supports_plan_modeprotocol.ts—sendSetPlanMode(),sendSteer(), protocol v1.5,supports_plan_modecapabilitysession.ts—Session.planMode,Session.setPlanMode(),Turn.steer()index.ts— export new types and schemasVSCode (
vscode_extension/)shared/bridge.ts—SetPlanMode,SteerChatmethodshandlers/chat.handler.ts—setPlanMode,steerChathandlersstores/chat.store.ts—planModestate,UIStep.planModetag,steerstep item typestores/event-handlers.ts—StatusUpdate.plan_modetracking,StepBeginplan tagging,SteerInputrenderingcomponents/PlanCard.tsx— collapsible amber card wrapping plan-mode stepscomponents/PlanModeButton.tsx— toggle button (amber theme, like ThinkingButton)components/ChatMessage.tsx— step grouping by planMode, SteerBubble inline renderingcomponents/QueuedMessagesPanel.tsx— "Insert Now" steer button per queue itemcomponents/inputarea/InputArea.tsx— PlanModeButton slot, optimistic toggle, exit confirmation dialogTest plan
vitest run)tsc --noEmit)pnpm build)tsc --noEmit)pnpm build)🤖 Generated with Claude Code