Skip to content

feat(node): add Plan Mode and Steer support (Wire 1.5)#127

Merged
tempurai merged 20 commits intomainfrom
feat/plan-mode-and-steer
Mar 18, 2026
Merged

feat(node): add Plan Mode and Steer support (Wire 1.5)#127
tempurai merged 20 commits intomainfrom
feat/plan-mode-and-steer

Conversation

@tempurai
Copy link
Copy Markdown
Collaborator

@tempurai tempurai commented Mar 18, 2026

Summary

  • Upgrade SDK wire protocol from v1.4 to v1.5
  • Add Plan Mode support: set_plan_mode RPC method, StatusUpdate.plan_mode field, capabilities.supports_plan_mode, PlanCard UI component (collapsible) with amber styling, PlanModeButton toggle with optimistic update and streaming exit confirmation
  • Add Steer support: steer RPC method, SteerInput echo event with inline SteerBubble rendering, "Insert Now" button in queue panel
  • Bump kimi-agent-sdk to 0.1.6, vscode extension to 0.4.5

Changes

SDK (agent_sdk/)

  • schema.tsSteerInput, SetPlanModeResult, StatusUpdate.plan_mode, ClientCapabilities.supports_plan_mode
  • protocol.tssendSetPlanMode(), sendSteer(), protocol v1.5, supports_plan_mode capability
  • session.tsSession.planMode, Session.setPlanMode(), Turn.steer()
  • index.ts — export new types and schemas

VSCode (vscode_extension/)

  • shared/bridge.tsSetPlanMode, SteerChat methods
  • handlers/chat.handler.tssetPlanMode, steerChat handlers
  • stores/chat.store.tsplanMode state, UIStep.planMode tag, steer step item type
  • stores/event-handlers.tsStatusUpdate.plan_mode tracking, StepBegin plan tagging, SteerInput rendering
  • components/PlanCard.tsx — collapsible amber card wrapping plan-mode steps
  • components/PlanModeButton.tsx — toggle button (amber theme, like ThinkingButton)
  • components/ChatMessage.tsx — step grouping by planMode, SteerBubble inline rendering
  • components/QueuedMessagesPanel.tsx — "Insert Now" steer button per queue item
  • components/inputarea/InputArea.tsx — PlanModeButton slot, optimistic toggle, exit confirmation dialog

Test plan

  • SDK: 256 tests pass (vitest run)
  • SDK: typecheck clean (tsc --noEmit)
  • SDK: build succeeds (pnpm build)
  • VSCode: typecheck clean (tsc --noEmit)
  • VSCode webview: build succeeds (pnpm build)
  • Manual: toggle Plan Mode button, verify StatusUpdate syncs state
  • Manual: steer via "Insert Now" in queue panel during streaming
  • Manual: verify PlanCard groups plan-mode steps with collapse toggle
  • Manual: verify exit-plan-mode confirmation dialog during streaming
  • Manual: verify SteerInput renders as inline user bubble

🤖 Generated with Claude Code

tempurai added 16 commits March 18, 2026 14:00
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.
@tempurai tempurai force-pushed the feat/plan-mode-and-steer branch from 6a699c5 to 4278119 Compare March 18, 2026 07:10
…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.
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.
@tempurai tempurai merged commit 133b073 into main Mar 18, 2026
6 checks passed
@tempurai tempurai deleted the feat/plan-mode-and-steer branch March 18, 2026 11:43
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.

1 participant