fix(agent): prevent team V2 leads from manually creating tasks before spawn

Strengthen TEAM.md prompt with WRONG/CORRECT examples and NEVER wording
to stop models from calling `team_tasks create` before `spawn` in V2.

Prompt changes:
- V2 leads: explicit WRONG/CORRECT pattern, NEVER create before spawn
- V1 leads: separate workflow with manual create→spawn instructions
- team_tasks summary: de-emphasize "create", highlight auto-creation
- spawn team_task_id: clarify "omit to auto-create (recommended)"

Backend guards:
- Reject spawn with in-progress team_task_id (prevents reuse)
- Log warning on early claim race instead of silently ignoring
This commit is contained in:
viettranx committed 2026-03-14 14:23:15 +07:00
1 parent 8ad425f5f8
commit 08823c057e
4 files changed
+41 -12

No files matched your search

+1 -1
View File
@@ -90,7 +90,7 @@ func (t *SpawnTool) Parameters() map[string]any {
}
props["team_task_id"] = map[string]any{
"type": "string",
"description": "Team task ID to auto-complete when task finishes (for team workflows)",
"description": "Omit to auto-create a task (recommended). Only set for dependency chains with blocked_by tasks.",
}
props["estimated_duration"] = map[string]any{
"type": "number",