Files
deepseek-harness/packages/client/ui-subagent
_Kerman 2f74ac98ba Merge remote-tracking branch 'origin/master' into xtr/agent-loop-message-machine
# Conflicts:
#	.agents/notes/archived/feature/2026-07-21-tui-steering-queue-badge.i18n.yaml
#	.agents/notes/archived/simplification/2026-06-20-drop-unconsumed-llm-assembled-surfaces.i18n.yaml
#	.agents/notes/archived/simplification/2026-07-04-prune-producerless-vocabulary-variants.i18n.yaml
#	.agents/notes/archived/simplification/2026-07-04-remove-agent-steering-mirror.i18n.yaml
#	.agents/notes/implemented/architecture/2026-07-22-unified-send-and-coalesced-user-messages.i18n.yaml
#	.agents/notes/implemented/feature/2026-07-07-session-prefix.i18n.yaml
#	.agents/notes/implemented/simplification/2026-07-02-remove-stream-chunk-mirror.i18n.yaml
#	docs/core-data-structures/session.i18n.yaml
#	docs/event-producer-consumer.md
#	examples/acp-agent/tests/snapshots/code-mode-workspace-context/session.jsonl
#	examples/acp-agent/tests/snapshots/hook-cc-promptsubmit-context/session.jsonl
#	examples/acp-agent/tests/snapshots/hook-codex-promptsubmit-context/session.jsonl
#	examples/acp-agent/tests/snapshots/subagent-fork/session.1.jsonl
#	examples/acp-agent/tests/snapshots/subagent-mixed/session.2.jsonl
#	packages/core/session/README.i18n.yaml
#	packages/host/apiproxy/src/api-proxy.ts
#	packages/support/acp-snapshot/README.i18n.yaml
#	packages/support/acp-snapshot/README.md
#	packages/support/acp-snapshot/README.zh.md
2026-07-27 09:57:51 +08:00
..

@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.