Commit Graph

4 Commits

Author SHA1 Message Date
959f0068f5 docs: fix subagents load path to ~/.pi/agent/subagents 2026-05-12 16:49:18 -04:00
84bcff94a0 refactor: load subagents from user config (~/.pi/subagents/)
- Discover prompts from ~/.pi/subagents/*.md instead of bundled prompts/
- Only register the subagent tool when at least one subagent exists
- Remove directory path from tool description (agents listed dynamically)
2026-05-12 16:35:37 -04:00
5c5cdb3aec refactor(subagent): split responsibilities and isolate child prompt
- Extract validateAgent, toToolResult, runAgentWithRetries so index.ts
  is wiring only; orchestration, validation, and result shaping each own
  their concern.
- Separate runner internals: createRunState, handleEvent (pure event
  reducer), spawnPi (process lifecycle), runOnce (single attempt).
- Track attempt/maxAttempts on SubagentStatus; surface "try x/y" in the
  UI without overwriting the user-facing task with the retry preamble.
- Replace pi's default system prompt (--system-prompt) instead of
  appending, so the subagent .md body is authoritative.
- Document prompt-replacement and retry/cache semantics in AGENTS.md.
2026-05-12 15:02:49 -04:00
9488aab237 feat(subagent): add sticky child finalization 2026-05-12 12:48:26 -04:00