Accept story 34: Per-Project Agent Configuration and Role Definitions
Replace single [agent] config with multi-agent [[agent]] roster system. Each agent has name, role, model, allowed_tools, max_turns, max_budget_usd, and system_prompt fields that map to Claude CLI flags at spawn time. - AgentConfig expanded with structured fields, validated at startup (panics on duplicate names, empty names, non-positive budgets/turns) - Backwards-compatible: legacy [agent] format auto-wraps with deprecation warning - AgentPool uses composite "story_id:agent_name" keys for concurrent agents - agent_name added to AgentEvent variants, AgentInfo, start/stop/subscribe APIs - GET /agents/config returns roster, POST /agents/config/reload hot-reloads - POST /agents/start accepts optional agent_name, /agents/stop requires it - SSE route updated to /agents/:story_id/:agent_name/stream - Frontend: roster badges, agent selector dropdown, composite-key state - Project root initialized to cwd at startup so config endpoints work immediately Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,31 @@ path = "."
|
||||
setup = ["cargo check"]
|
||||
teardown = []
|
||||
|
||||
[agent]
|
||||
command = "claude"
|
||||
args = []
|
||||
prompt = "Read .story_kit/README.md, then pick up story {{story_id}}"
|
||||
[[agent]]
|
||||
name = "supervisor"
|
||||
role = "Coordinates work, reviews PRs, decomposes stories."
|
||||
model = "opus"
|
||||
max_turns = 50
|
||||
max_budget_usd = 10.00
|
||||
system_prompt = "You are a senior engineering lead. Coordinate the work, review code, and ensure quality."
|
||||
|
||||
[[agent]]
|
||||
name = "coder-1"
|
||||
role = "Full-stack engineer. Implements features across all components."
|
||||
model = "sonnet"
|
||||
max_turns = 30
|
||||
max_budget_usd = 5.00
|
||||
|
||||
[[agent]]
|
||||
name = "coder-2"
|
||||
role = "Full-stack engineer. Implements features across all components."
|
||||
model = "sonnet"
|
||||
max_turns = 30
|
||||
max_budget_usd = 5.00
|
||||
|
||||
[[agent]]
|
||||
name = "reviewer"
|
||||
role = "Reviews code changes, runs tests, checks quality gates."
|
||||
model = "sonnet"
|
||||
max_turns = 20
|
||||
max_budget_usd = 3.00
|
||||
|
||||
Reference in New Issue
Block a user