diff --git a/packages/team/tool-agent-team/README.md b/packages/team/tool-agent-team/README.md index b4551a4e0c..4f07156a0e 100644 --- a/packages/team/tool-agent-team/README.md +++ b/packages/team/tool-agent-team/README.md @@ -126,11 +126,9 @@ Every Team member's system prompt carries one `team:policy` section; the Lead an ```markdown Agent Teams is available in this session. -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. +Record expected write scopes on shared tasks and use task dependencies when work must be ordered. Write-scope overlap is advisory, not a lock. -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. - -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. +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. ``` diff --git a/packages/team/tool-agent-team/README.zh.md b/packages/team/tool-agent-team/README.zh.md index bb3cfd68d4..e459a6a512 100644 --- a/packages/team/tool-agent-team/README.zh.md +++ b/packages/team/tool-agent-team/README.zh.md @@ -126,11 +126,9 @@ kind: "package-reference" ```markdown Agent Teams is available in this session. -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. +Record expected write scopes on shared tasks and use task dependencies when work must be ordered. Write-scope overlap is advisory, not a lock. -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. - -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. +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. ``` diff --git a/packages/team/tool-agent-team/src/index.ts b/packages/team/tool-agent-team/src/index.ts index e9dc4ed227..b007e7bf6a 100644 --- a/packages/team/tool-agent-team/src/index.ts +++ b/packages/team/tool-agent-team/src/index.ts @@ -26,11 +26,9 @@ const REMOVED_CONFIG_KEYS = ['interrupt', 'freshProvider', 'forkProvider'] as co /** Model-facing collaboration guidance shared by Lead and teammates. */ const TEAM_POLICY = `Agent Teams is available in this session. -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. +Record expected write scopes on shared tasks and use task dependencies when work must be ordered. Write-scope overlap is advisory, not a lock. -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. - -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. +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.` 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 4ccafc6d92..879015eb64 100644 --- a/packages/team/tool-agent-team/tests/tool-team.spec.ts +++ b/packages/team/tool-agent-team/tests/tool-team.spec.ts @@ -878,7 +878,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('Agent Teams is available')).toBe(enabled) - expect(prompt?.includes('record expected write scopes on shared tasks')).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-default-enabled/system-prompt.1.expected.md b/snapshots/sdk/team-default-enabled/system-prompt.1.expected.md index 98602d0999..05dc468460 100644 --- a/snapshots/sdk/team-default-enabled/system-prompt.1.expected.md +++ b/snapshots/sdk/team-default-enabled/system-prompt.1.expected.md @@ -4,11 +4,9 @@ You are a coding agent powered by the deepseek-v4-flash model. Agent Teams is available in this session. -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. +Record expected write scopes on shared tasks and use task dependencies when work must be ordered. Write-scope overlap is advisory, not a lock. -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. - -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. +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. diff --git a/snapshots/sdk/team-default-enabled/system-prompt.expected.md b/snapshots/sdk/team-default-enabled/system-prompt.expected.md index 98602d0999..05dc468460 100644 --- a/snapshots/sdk/team-default-enabled/system-prompt.expected.md +++ b/snapshots/sdk/team-default-enabled/system-prompt.expected.md @@ -4,11 +4,9 @@ You are a coding agent powered by the deepseek-v4-flash model. Agent Teams is available in this session. -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. +Record expected write scopes on shared tasks and use task dependencies when work must be ordered. Write-scope overlap is advisory, not a lock. -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. - -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. +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. diff --git a/snapshots/sdk/team-session-mode/system-prompt.expected.md b/snapshots/sdk/team-session-mode/system-prompt.expected.md index bd0e9ce4cf..e68dad9cc3 100644 --- a/snapshots/sdk/team-session-mode/system-prompt.expected.md +++ b/snapshots/sdk/team-session-mode/system-prompt.expected.md @@ -18,11 +18,9 @@ You are a coding agent powered by the deepseek-v4-flash model. Agent Teams is available in this session. -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. +Record expected write scopes on shared tasks and use task dependencies when work must be ordered. Write-scope overlap is advisory, not a lock. -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. - -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. +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. diff --git a/snapshots/session/team-session-mode/system-prompt.expected.md b/snapshots/session/team-session-mode/system-prompt.expected.md index e1c8badcd9..68747cdffd 100644 --- a/snapshots/session/team-session-mode/system-prompt.expected.md +++ b/snapshots/session/team-session-mode/system-prompt.expected.md @@ -24,11 +24,9 @@ Verify your work by running the code or tests. Keep answers brief and factual. Agent Teams is available in this session. -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. +Record expected write scopes on shared tasks and use task dependencies when work must be ordered. Write-scope overlap is advisory, not a lock. -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. - -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. +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. diff --git a/snapshots/session/team-targets/system-prompt.expected.md b/snapshots/session/team-targets/system-prompt.expected.md index ea49ddd128..197e56b936 100644 --- a/snapshots/session/team-targets/system-prompt.expected.md +++ b/snapshots/session/team-targets/system-prompt.expected.md @@ -7,11 +7,9 @@ Verify your work by running the code or tests. Keep answers brief and factual. Agent Teams is available in this session. -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. +Record expected write scopes on shared tasks and use task dependencies when work must be ordered. Write-scope overlap is advisory, not a lock. -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. - -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. +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.