diff --git a/packages/team/tool-agent-team/README.md b/packages/team/tool-agent-team/README.md index 5a31f50702..81a275a705 100644 --- a/packages/team/tool-agent-team/README.md +++ b/packages/team/tool-agent-team/README.md @@ -126,9 +126,9 @@ Every Team member's system prompt carries one `team:policy` section; the Lead an ```markdown A shared task board is available in this session. Task owners are agent ids from list_agents. The root can reassign tasks to itself or any continuable descendant; other agents claim ready tasks themselves. -Use the shared task board to coordinate work split across agents. Before delegating, use team_task_list to reuse existing tasks and team_task_create for missing work. Give each task clear acceptance criteria, record expected edits in write_scopes, and set blocked_by when work depends on another task. Split parallel writes into disjoint file or directory scopes. Include the task id in the subagent prompt or send_message so the assignee knows which task to claim. +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. -Read assigned tasks with team_task_get, claim ready tasks with team_task_update using the current revision, perform the work, then complete the task. Keep task descriptions and dependencies current as the work changes. Before the final answer, check the board and collect the results of all required tasks; report any unfinished work. Dependencies determine readiness; overlapping write scopes are advisory, not locks. Task readiness does not start an agent. +Shared-task workflow is list, get, claim with the current revision, perform the work, then complete. Task readiness never starts an owner. The Lead 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. ``` diff --git a/packages/team/tool-agent-team/README.zh.md b/packages/team/tool-agent-team/README.zh.md index 7a2aa5d075..8f59bce11d 100644 --- a/packages/team/tool-agent-team/README.zh.md +++ b/packages/team/tool-agent-team/README.zh.md @@ -126,9 +126,9 @@ kind: "package-reference" ```markdown A shared task board is available in this session. Task owners are agent ids from list_agents. The root can reassign tasks to itself or any continuable descendant; other agents claim ready tasks themselves. -Use the shared task board to coordinate work split across agents. Before delegating, use team_task_list to reuse existing tasks and team_task_create for missing work. Give each task clear acceptance criteria, record expected edits in write_scopes, and set blocked_by when work depends on another task. Split parallel writes into disjoint file or directory scopes. Include the task id in the subagent prompt or send_message so the assignee knows which task to claim. +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. -Read assigned tasks with team_task_get, claim ready tasks with team_task_update using the current revision, perform the work, then complete the task. Keep task descriptions and dependencies current as the work changes. Before the final answer, check the board and collect the results of all required tasks; report any unfinished work. Dependencies determine readiness; overlapping write scopes are advisory, not locks. Task readiness does not start an agent. +Shared-task workflow is list, get, claim with the current revision, perform the work, then complete. Task readiness never starts an owner. The Lead 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. ``` diff --git a/packages/team/tool-agent-team/src/index.ts b/packages/team/tool-agent-team/src/index.ts index 0301b438d1..36117ba378 100644 --- a/packages/team/tool-agent-team/src/index.ts +++ b/packages/team/tool-agent-team/src/index.ts @@ -26,9 +26,9 @@ const REMOVED_CONFIG_KEYS = ['interrupt', 'freshProvider', 'forkProvider'] as co /** Model-facing collaboration guidance shared by Lead and teammates. */ const TEAM_POLICY = `A shared task board is available in this session. Task owners are agent ids from list_agents. The root can reassign tasks to itself or any continuable descendant; other agents claim ready tasks themselves. -Use the shared task board to coordinate work split across agents. Before delegating, use team_task_list to reuse existing tasks and team_task_create for missing work. Give each task clear acceptance criteria, record expected edits in write_scopes, and set blocked_by when work depends on another task. Split parallel writes into disjoint file or directory scopes. Include the task id in the subagent prompt or send_message so the assignee knows which task to claim. +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. -Read assigned tasks with team_task_get, claim ready tasks with team_task_update using the current revision, perform the work, then complete the task. Keep task descriptions and dependencies current as the work changes. Before the final answer, check the board and collect the results of all required tasks; report any unfinished work. Dependencies determine readiness; overlapping write scopes are advisory, not locks. Task readiness does not start an agent. +Shared-task workflow is list, get, claim with the current revision, perform the work, then complete. Task readiness never starts an owner. The Lead 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.` diff --git a/packages/team/tool-agent-team/tests/tool-team.spec.ts b/packages/team/tool-agent-team/tests/tool-team.spec.ts index d5ec81724f..93b8c3f9e1 100644 --- a/packages/team/tool-agent-team/tests/tool-team.spec.ts +++ b/packages/team/tool-agent-team/tests/tool-team.spec.ts @@ -245,7 +245,7 @@ describe('dsh-tool-team', () => { expect(teamTools(leadAssembly)).toEqual(TEAM_TOOLS) const leadPrompt = renderPrompt(leadAssembly) expect(leadPrompt).toContain('A shared task board is available in this session') - expect(leadPrompt).toContain('Task readiness does not start an agent') + expect(leadPrompt).toContain('Task readiness never starts an owner') expect(leadPrompt).toContain('Task changes do not end wait_agent calls') expect(renderContextSnapshot(leadAssembly)).toContain(leadIdentity(lead)) expect((await ctx.systemPrompt.assemble()).contexts.some(context => context.name === 'team:identity')).toBe(false) @@ -819,7 +819,7 @@ describe('dsh-tool-team', () => { const system = request.messages.find(message => message.role === 'system') const prompt = system?.content.flatMap(block => block.type === 'text' ? [block.text] : []).join('\n') expect(prompt?.includes('A shared task board is available')).toBe(enabled) - expect(prompt?.includes('Before delegating, use team_task_list to reuse existing tasks and team_task_create for missing work.')).toBe(enabled) + expect(prompt?.includes('record expected write scopes on shared tasks')).toBe(enabled) expect(runtimeContextText(request)).toContain(leadIdentity(lead)) const contexts = request.messages.findLast(message => message.source?.kind === 'runtime-context')?.source const initial = adapter.requests[0]!.messages.findLast(message => message.source?.kind === 'runtime-context')?.source diff --git a/snapshots/sdk/team-session-mode/system-prompt.expected.md b/snapshots/sdk/team-session-mode/system-prompt.expected.md index 195a516ffd..5b4357439f 100644 --- a/snapshots/sdk/team-session-mode/system-prompt.expected.md +++ b/snapshots/sdk/team-session-mode/system-prompt.expected.md @@ -18,9 +18,9 @@ You are a coding agent powered by the deepseek-v4-flash model. A shared task board is available in this session. Task owners are agent ids from list_agents. The root can reassign tasks to itself or any continuable descendant; other agents claim ready tasks themselves. -Use the shared task board to coordinate work split across agents. Before delegating, use team_task_list to reuse existing tasks and team_task_create for missing work. Give each task clear acceptance criteria, record expected edits in write_scopes, and set blocked_by when work depends on another task. Split parallel writes into disjoint file or directory scopes. Include the task id in the subagent prompt or send_message so the assignee knows which task to claim. +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. -Read assigned tasks with team_task_get, claim ready tasks with team_task_update using the current revision, perform the work, then complete the task. Keep task descriptions and dependencies current as the work changes. Before the final answer, check the board and collect the results of all required tasks; report any unfinished work. Dependencies determine readiness; overlapping write scopes are advisory, not locks. Task readiness does not start an agent. +Shared-task workflow is list, get, claim with the current revision, perform the work, then complete. Task readiness never starts an owner. The Lead 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. diff --git a/snapshots/session/team-session-mode/system-prompt.expected.md b/snapshots/session/team-session-mode/system-prompt.expected.md index 201d458d96..a098ef4e63 100644 --- a/snapshots/session/team-session-mode/system-prompt.expected.md +++ b/snapshots/session/team-session-mode/system-prompt.expected.md @@ -24,9 +24,9 @@ Verify your work by running the code or tests. Keep answers brief and factual. A shared task board is available in this session. Task owners are agent ids from list_agents. The root can reassign tasks to itself or any continuable descendant; other agents claim ready tasks themselves. -Use the shared task board to coordinate work split across agents. Before delegating, use team_task_list to reuse existing tasks and team_task_create for missing work. Give each task clear acceptance criteria, record expected edits in write_scopes, and set blocked_by when work depends on another task. Split parallel writes into disjoint file or directory scopes. Include the task id in the subagent prompt or send_message so the assignee knows which task to claim. +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. -Read assigned tasks with team_task_get, claim ready tasks with team_task_update using the current revision, perform the work, then complete the task. Keep task descriptions and dependencies current as the work changes. Before the final answer, check the board and collect the results of all required tasks; report any unfinished work. Dependencies determine readiness; overlapping write scopes are advisory, not locks. Task readiness does not start an agent. +Shared-task workflow is list, get, claim with the current revision, perform the work, then complete. Task readiness never starts an owner. The Lead 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. diff --git a/snapshots/session/team-targets/system-prompt.expected.md b/snapshots/session/team-targets/system-prompt.expected.md index e5415ae3e5..9b695dd5c3 100644 --- a/snapshots/session/team-targets/system-prompt.expected.md +++ b/snapshots/session/team-targets/system-prompt.expected.md @@ -7,9 +7,9 @@ Verify your work by running the code or tests. Keep answers brief and factual. A shared task board is available in this session. Task owners are agent ids from list_agents. The root can reassign tasks to itself or any continuable descendant; other agents claim ready tasks themselves. -Use the shared task board to coordinate work split across agents. Before delegating, use team_task_list to reuse existing tasks and team_task_create for missing work. Give each task clear acceptance criteria, record expected edits in write_scopes, and set blocked_by when work depends on another task. Split parallel writes into disjoint file or directory scopes. Include the task id in the subagent prompt or send_message so the assignee knows which task to claim. +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. -Read assigned tasks with team_task_get, claim ready tasks with team_task_update using the current revision, perform the work, then complete the task. Keep task descriptions and dependencies current as the work changes. Before the final answer, check the board and collect the results of all required tasks; report any unfinished work. Dependencies determine readiness; overlapping write scopes are advisory, not locks. Task readiness does not start an agent. +Shared-task workflow is list, get, claim with the current revision, perform the work, then complete. Task readiness never starts an owner. The Lead 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.