* feat(system-prompt): admit section updates incrementally * docs(system-prompt): accept retirement restart gap * test(system-prompt): cover retirement and reentry before admission * test(system-prompt): align rebase fixtures and persistence history * fix: align section prompt consumers and CI fixtures * test: pin credentials for section snapshot fixtures * test: align remaining snapshots with section admission * test: preserve section metadata in Web and PowerShell replays * refactor(system-prompt): retire sections through Cordis cleanup * chore: refresh section admission history after rebase * fix(system-prompt): advance admission head after compaction * fix(system-prompt): trim sections before admission hashing * docs: move system upgrade guides to current version * docs: add system message contribution cookbook * perf(system-prompt): avoid indexing history for admission * refactor(system-prompt): derive admission from logged sections * test(system-prompt): update lifecycle and compaction consumers * test(system-prompt): refresh CLI section event expectations * test(system-prompt): refresh question composer section metadata * feat(system-prompt): resolve same-name sections by scope * refactor(persona): use ordinary section registrations * refactor(system-prompt): clarify assembly and related control flow * test(system-prompt): reconcile rebased section snapshots * test(python): use current system text helper after rebase * test(system-prompt): refresh CLI expected section blocks * test(system-prompt): reconcile latest master integration * test(agent-loop): seed tools before deferred addition assertion * refactor(compaction): replace system heads when compacting prefixes * refactor(system-prompt): separate source text and notice attribution * fix(system-prompt): preserve legacy instructions in compaction snapshots * refactor(compaction): build system snapshots while reading the summary prefix * refactor(compaction): rebuild current system instructions * refactor(system-prompt): defer compaction rebuild to admission * refactor(system-prompt): remove redundant fixtures and setup * fix(plan-mode): announce committed user transitions * docs(system-prompt): reconcile section lifecycle and compaction design * refactor(system-prompt): consolidate projection version increments * fix(system-prompt): reconcile master integration and replay fixtures * docs(system-prompt): align upgrade guide with current release * refactor(system-prompt): make admission operations explicit * fix(system-prompt): reconcile master API and release changes * docs(system-prompt): regenerate catalogs after master refresh * refactor(llm-pi-ai): delegate text rendering to pi-ai * fix(llm-pi-ai): preserve blank lines between system text parts * refactor(system-prompt): remove redundant retirement metadata * refactor(system-prompt): own admission and use canonical surface targets * refactor(system-prompt): compare captured sections at commitment Assembly fixes section text and lifecycle; PromptAssembly.systemUpdates() compares them with the committed projection when the loop commits. This replaces SystemPrompt.admit(), needsRebuild() and isCurrent(), the SystemAdmission export, the loop's reassembly after compaction, and SessionSurface.systemHeadResetSeq. The projection records a pending rebuild as a boolean that an attributed reset clears. After a compaction inside a step, the rebuilt head uses the sections captured for that step; later source changes arrive as ordinary updates at the next step. * test: await the session read fixture and type a matcher for lint * test(tool-executor-ptc): describe same-name section override on executor replacement Duplicate section names no longer reject a scoped executor; the earlier registration is overridden and returns as an ordinary update when the executor leaves. * docs(upgrade-guide): move system-prompt integrations to v0.2.2-rc.3 The root version on master is 0.2.2-rc.3; verify-upgrade-guides rejects a guide added under an earlier version directory. * refactor(system-prompt): rebuild over system messages without sections A system message without source.sections now marks rebuilding pending, like a compaction summary. The next model attempt replaces the head with current sections and clears later system messages. This removes the separate legacy flag and its appended whole-prompt replacement and notice. Sessions written by earlier releases, migrated logs, and imported DeepSeek conversations take the same path, so the importer and its tests return to their master versions. * test(web): refresh the imported-conversation recording and drop a stray bytecode file The Web recording for a resumed DeepSeek import was recorded while the prompt was appended after the imported history; the head is replaced again, as on master. The .pyc under the macOS signing skill was staged by accident in an earlier merge. * refactor(session): scan system nodes on read surface.systemNodes is read only when a system rebuild is written. Scanning the current surface nodes on each read restores the surface fold's plan types and state to their master definitions, which no longer carry the system message. * refactor(session): rename SystemSurfaceNode.hasContent to isEmpty The flag reports that the logged content array has no blocks. isEmpty matches the documented "empty head" wording and covers a head that was written empty without ever being cleared. * refactor(llm): join system text through extractTextContent extractTextContent gains a trim option that trims each text block and omits blocks left empty. The DeepSeek serializer, the pi-ai converter, and the prompt inspector use it with a blank-line separator in place of three hand-written joins. The pi-ai converter now trims system and developer text like the other two, so whitespace-only blocks are omitted there as well. * test(snapshots): refresh the PowerShell and cordis-inspect recordings The two PowerShell scenarios still held the initial system message as one unattributed block; replay now writes one block per section with its attribution. The cordis-inspect-jsdoc recording embeds the API catalog, which names SystemSurfaceNode.isEmpty since the rename. * test(plan-mode,harness-dev-context): cover a rejected pre-step and a repeated legacy prompt A rejected pre-step must leave a queued plan-mode switch pending and unannounced until the next accepted step. A second unattributed system message with the same legacy paragraphs must keep the admitted paragraphs. * test(web): refresh Web recordings for section-attributed system messages Twenty-seven Web recordings still held the initial system message as one unattributed block. Replay now writes one text block per section with its attribution; twenty-six recordings differ only in that line. plan-review also records the plan-mode switch notice before the first prompt and appends a plan:status update on exit in place of a head replacement and a series header, so its expanded golden gains the notice row. The Creator persona test joins the system text blocks with blank lines, as the adapters do, before matching the persona line. * refactor(system-prompt): require the retry argument of systemUpdates The agent loop passes it on every attempt. A custom loop that omitted it on a retry received a full comparison in place of the pending rebuild, with no diagnostic; the type now makes each caller state which attempt it is. * docs(upgrade-guide): move the system prompt integrations guide to v0.2.2-rc.5 The root version is 0.2.2-rc.5 after the master merge, and verify-upgrade-guides rejects a guide added under an earlier version directory. * test(web): refresh the mention path presence recording for section-attributed system messages * test: align two specs that master left failing The DeepSeek settings spec waited for a saved notice carrying the provider label from before the rename to DeepSeek API. The Windows packaging workflow spec seeded one of the two helpers that the Stage workflow helpers step copies. * chore: remove a Python cache file committed by mistake
description, kind
| description | kind |
|---|---|
| Four task-board tools and shared-task guidance for Team-enabled Sessions. | package-reference |
@deepseek-ai/dsh-tool-agent-team
English | 中文
Summary
This package lets every agent in a subagent tree create, claim, and complete shared tasks. It adds four task schemas and shared-board guidance. Ordinary subagent controls own discovery, messaging, interruption, and inbox waiting. The base bundle loads the service and tools; new Sessions default to Team mode off.
Table of Contents
- Use this package
- Understand the implementation
- Further Exploration
- Model Experience
- Known Limitations and Deferred Work
- Dev Note
Use this package
Team tools are available to each model step only while the root Session enables Team mode. Prompt providers read the same selection when evaluated. Ordinary subagent controls remain available.
Mount this package with @deepseek-ai/dsh-agent-team when models need the shared board. The root and descendants receive identical task schemas and task policy.
When to choose it
Choose it whenever the Team domain is mounted and models should use the board; without it, the board is reachable only through ctx.agentTeams. Teammates are created and reached through the standard subagent, subagent_fork, send_message, list_agents, and interrupt_agent tools, so the composition also needs @deepseek-ai/dsh-tool-subagent and @deepseek-ai/dsh-tool-subagent-control.
Smallest working example
The plugin takes no configuration; mount it beside the Team domain as in the agent-team setup:
- id: tool-agent-team
name: '@deepseek-ai/dsh-tool-agent-team'
A row that sets interrupt, freshProvider, or forkProvider does not activate, and dsh names the key in its startup warning. The upgrade guide maps the removed tools and keys to their replacements, and the generated configuration catalog records the empty configuration.
Ask the Lead to start a subagent to review the diff, add a review task, and wait for its result. The description explains the subagent’s work; the returned name addresses it.
What the model can do
The task tools complement the ordinary subagent controls:
- Manage the task board —
team_task_create,team_task_list,team_task_get, andteam_task_updateadd, browse, read, and update shared tasks. - Wait for inbox input —
wait_agentbelongs to@deepseek-ai/dsh-tool-subagent-controland remains available without this package. - Create and reach teammates —
subagent,subagent_fork,send_message,list_agents, andinterrupt_agentcome from the subagent tool packages and are unchanged by this package.
Task owner arguments accept the names that list_agents shows: lead, a full name such as reviewer/checker, or a Session id. Task results report owner as that name, or as the Session id when the owner has no name; unowned: true filters tasks without an owner, while unowned: false selects assigned tasks. The owner and unowned filters cannot be combined. The Team service authorizes ownerId Session ids and saves the full name in ownerName at assignment. The root may reassign to itself or any reachable continuable descendant; historical roster records grant no authority. Other agents claim ready tasks themselves. Updates enforce ownership and revision checks.
write_scopes accepts advisory file or directory prefixes relative to the workspace root, with no absolute paths or .. segments. Omit it or pass [] when creating a task with no workspace writes. For edit, omission keeps existing scopes and [] clears them.
What success and failure look like
Task tools return compact JSON task views or pages. Stale revisions, unauthorized actions, and unready tasks return errors.
Understand the implementation
Implementation internals — click to expand
This section explains the design decisions behind the adapter and points at the code that realizes them; the observable behavior is fully covered in Use this package.
Design philosophy
The adapter is built on four commitments:
- Session-selected tools. Shared tool registrations select availability from each caller’s root Session; the service resolves tree authority when called.
- One tool family. Team registers no messaging, listing, or interruption tool; the standard subagent tools serve Leads and teammates alike.
- Declared results, compact JSON. Every tool declares its complete result schema and renders that value as compact JSON, so the compiler checks
executeagainst what the model is promised and no result spends tokens on indentation. - The domain owns authority. Tools delegate to
ctx.agentTeams, which enforces Lead authority and revision checks; the adapter adds no weaker path.
The subagent teammates Agent Note owns the model-facing and scoping decisions.
Source map
| File | Role |
|---|---|
src/index.ts |
Plugin entry, removed-key rejection, Team policy and four conditional task tools |
Policy and tools
One plugin registration provides a dynamic team:policy section and four conditional task tools. Each provider reads the caller’s root Session selection, including fork children. An unavailable root disables Team tools and guidance. Tree authority comes from ctx.subagents.rootOf(agent); task owners remain Session ids in ctx.agentTeams. Owner arguments resolve through ctx.subagents.resolveName(), which grants no authority. Results replace the saved ownerId and ownerName fields with owner: ownerName ?? ownerId. Displaying a task or editing its content requires no descendant catalog reads. Identity, discovery, communication, and waiting belong to subagent controls and keep that ownership when Team mode switches; enabling Team mode removes only their result report instruction. The subagent runtime delivers final results.
Scoped registration and teardown
Tool when conditions resolve at step preparation, including the first step of new, forked, and resumed Agents. Policy text is evaluated during prompt assembly. After the policy has been admitted, disabling Team mode appends a notice withdrawing it; unloading this plugin appends its retirement notice on the next accepted assembly. An already prepared step retains its tool selection, but task operations check the current mode before starting. Plugin disposal removes all registrations through their owning effects.
Further Exploration
Read these pages when the package-level contract is not enough. They move from the domain service to the exact schemas and the decisions behind the design.
- agent-team package — the
ctx.agentTeamsdomain service behind these tools. - Agent Teams subsystem — durable Team types and service API.
- Subagent control tools — messaging, listing, interruption, and inbox waiting.
- Generated tool catalog — every tool schema the model receives.
- Subagent teammates Agent Note — model-facing, scoping, and tool-family decisions.
Model Experience
Team policy system prompt
What the model sees
Every Team member's system prompt carries one team:policy section; the Lead and every teammate see the same text:
Team policy
Agent Teams is available in this session.
The Team Lead and all teammates share the same working directory and filesystem. Edits are immediately visible to every member. Split write work into disjoint scopes, record expected write scopes on shared tasks, and use task dependencies when work must be ordered. Write-scope overlap is advisory, not a lock.
Use the names returned by subagent, subagent_fork, or list_agents as owner when assigning or filtering shared tasks. The root can reassign tasks to itself or any continuable descendant; other agents claim ready tasks themselves. Shared-task workflow is list, get, claim with the current revision, perform the work, then complete. Task readiness never starts an owner. The root agent must wait for required teammates before giving the final answer.
Task changes do not end wait_agent calls, add inbox messages, or start idle agents. Use send_message when another agent needs to act on a task.
Token effect
The section is a fixed cost on every request of every Team member.
KV Cache effect
The text is identical for the Lead and every descendant and does not change while the plugin stays loaded, so it keeps a stable system-prompt prefix, including between a parent and its subagent_fork child. Loading or unloading the plugin changes the system prompt of every member and invalidates their cached prefixes.
Task tool schemas
What the model sees
Every member receives the same four task schemas in the generated tool catalog. Results are compact JSON task views or pages. Root-only reassignment is enforced at execution, not through different schemas.
Token effect
The four schemas are a fixed cost per request. Tool results add compact JSON; team_task_list returns at most 100 tasks per page. An owner name is usually shorter than the 36-character Session id it replaces.
KV Cache effect
The schemas are identical for the Lead and every descendant, including subagent_fork children, so a fork's tool list matches its parent's request prefix. Tool results append after the reusable prefix. Loading or unloading the plugin changes every member's tool list and invalidates their cached prefixes.
Known Limitations and Deferred Work
These limits describe what the policy and tools cannot guarantee for a team. They are current package constraints, not a comparison with other collaboration surfaces.
- Prompt policy is coordination, not confinement — it cannot stop Bash or external processes from writing overlapping files.
- Task authority needs a live root — tool availability does not guarantee that the caller’s root remains available when an operation executes.
- No Web controls — browser task-board presentation is outside this runtime package.
Dev Note
Working context for maintainers — click to expand
None.