Files
deepseek-harness/packages/client/ui-subagent/README.md
T
imccyu cbe8735d7c feat(web): wire startup Workspace selection and sync docs
- Mount WorkspacesService.startInitialSelection in the runtime apply (the
  one-shot baseline follower shipped in 98633b5aa without a caller): a
  restored current session wins, an explicit clear stays cleared, a failed
  connect retries on the next baseline projection.
- Cover the policy in client-apply and the assembled workspace-flow
  snapshot; startup now lands in the recent Workspace's blank session, so
  the draft-carry scenario starts from the hero directly.
- Bring docs along: startup-selection paragraphs in the session-scope RFC
  note (both languages), bilingual README pairs for the four new client
  packages, doc-graph regeneration with client-declared events exempt from
  the dispatcher requirement (client dispatch sites are structurally
  invisible to the host-side ts.Program), and pairing re-records.
2026-07-27 06:24:09 +08:00

2.7 KiB

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

English | 中文

Subagent reference source, browser half: registers the @-trigger subagent source into ctx.slash. Candidates are zero-RPC — filtered from the root ctx.sessions.list snapshot captured at registration (children of the per-call projection's session: parentId matches, running, displayTitle contains the query); picking a candidate lands the literal @label text through the slash pipeline (decision 21 plain-text reference), and the source codec projects both faces as @label — the model serialization stays the raw label until the @ consumption feature defines a model representation. The source implements no matchSpace/matchEnter hooks — subagent references never enter command adjudication and ride ordinary prompts into the default sink.

A session with no running children is simply candidate-less. This phase ships "menu + reference text" only; what consuming an @label means (steering the child, resuming a disposed one) is future business work.

The /client export surface is the plugin body (apply/inject) only; the source object is internal to the registration effect.

Model Experience

Subagent label text in the user prompt

What the model sees

A picked candidate lands the literal @label (the child session's display title) in the draft; the text reaches the model verbatim inside the ordinary user message (session.prompt), with no dedicated content block, prompt section, or host-side resolution. No consumption semantics exist yet: the model sees plain text and interprets it unaided.

Token effect

Conditional and tiny: only a pick (or hand-typing the same text) adds the label's characters to that one user message. Menu browsing adds zero model tokens (candidates never leave the browser).

KV Cache effect

Append-only: the reference is part of a new user message appended after the reusable history prefix. This package never edits earlier request tokens.

Known Limitations and Deferred Work

  • @ consumption semantics are unbuilt — the reference is inert text; wiring it to steer/message the named child (and whether resuming a disposed child is allowed) awaits its own design decision in the ledger.
  • Candidates are running children only — completed or disposed subagents never appear, and the roster is the scoped session's direct children (no grandchildren, no cross-session agents).
  • Labels are display titles, not stable ids — two children sharing a display title produce indistinguishable references, and a title change orphans previously inserted text. Acceptable while references are inert; a consumption feature must bind to session ids.