Files
deepseek-harness/packages/client/ui-plan
imccyu 76796df39b test: close the two coverage tails on the plan surfaces
The plan unit's same-reference gate for a repeated identical /plan selection
(the one uncovered branch in plan-mode/index.ts) gains an explicit case, and
ui-plan's empty node-half apply is exercised the way sibling surface plugins
do (the ui-conversation no-op precedent). Both files read 100% across all
four axes under the CI coverage lane's per-file thresholds.
2026-07-28 21:49:53 +08:00
..

@deepseek-ai/dsh-client-ui-plan

English | 中文

Plan-mode composer control, a pure browser surface plugin. The browser half occupies the conversation-declared conversation.input.plan single seat with a pending-aware mode selector; the node half is an empty apply (the roster row). Plan behavior itself — the /plan command, the boundary-committed plan/mode state, the plan projection unit, and the policy section — is owned by @deepseek-ai/dsh-plan-mode, composed independently on the host roster.

Reads ride the generic projection pair: the control renders the host-computed plan projection ({ active, pending }) through the standard-kit useProjection; an absent key is capability absence and hides the control, so a host without plan-mode (or a Draft with no session) shows no seat content. Writes ride the standard command channel: selecting a mode executes /plan or /plan off through command.execute, whose logged command/run immediately folds into a pending projection frame and whose request-boundary plan/mode commit resolves it — the control never holds client-side plan state, displays only host-confirmed values, and stays available while generation runs (switching never cancels a turn; the pending target applies at the next model-request boundary).

The transparent native select mirrors keyboard focus onto the visible chip and carries a dynamic accessible description of the committed and pending modes. Admission failures (matched: false, business errors, transport faults) surface as an inline error without mutating the displayed mode.

The model exits plan mode through the stable exit_plan_mode tool; its plan review uses the composed Web question channel.

Model Experience

Indirectly, through the /plan command lines the control dispatches: @deepseek-ai/dsh-plan-mode owns the model-visible policy section, the exit-tool schema, and the logged state those lines drive, while this package only renders the projection and sends what a user could equally type.

KV Cache effect

Entering or leaving plan mode changes the active plan:policy system-prompt section and therefore the request prefix; the control itself adds no prompt content.

Known Limitations and Deferred Work

  • Plan mode is guidance, not an execution sandbox — deployments that require enforced read-only planning must compose the independent sandbox and approval policies.
  • The control belongs to the default composer — a pending whole-composer interaction such as plan review temporarily replaces the InputBar and its mode control.
  • No Draft-time selection — before a session exists there is no projection and the seat stays empty; plan mode is selected after the first prompt creates the session.