feat: wire agent.delegate tool with sub-agent configs

- Export createAgentDelegateTool through builtin/index.ts → tools/index.ts
- Register agent.delegate in routing.ts with lazy orchestrator pattern
- Add agent.delegate + agents.list to messaging and coding policy profiles
- Add group:agents tool group to policy.ts
- Add research/code/comms agent config examples to default.yaml
- Add research/code/comms agent configs to user config.yaml
- Add 11 tests for agent-delegate tool (all pass)
- Typecheck clean, no regressions
This commit is contained in:
William Valentin
2026-02-17 10:28:29 -08:00
parent 288ef5ac3c
commit 776b47f80f
16 changed files with 890 additions and 4 deletions
+63
View File
@@ -186,6 +186,35 @@ models:
# Then reference them in fallback_chain:
# fallback_chain: [ollama, llamacpp, local]
# Optional: external CLI backends for non-tool conversation turns.
# - native remains available unless you disable it.
# - set `default` to route normal text turns to a backend by default.
# - per-agent override is available via `agent_configs.<name>.backend`.
# backends:
# default: codex # claude_code | opencode | codex | gemini
# native:
# enabled: true
# claude_code:
# enabled: false
# # path: /usr/local/bin/claude
# # args: ["--print", "{prompt}"]
# # timeout_ms: 120000
# opencode:
# enabled: false
# # path: /usr/local/bin/opencode
# # args: ["-p", "{prompt}"]
# # timeout_ms: 120000
# codex:
# enabled: false
# # path: /usr/local/bin/codex
# # args: ["-p", "{prompt}"]
# # timeout_ms: 120000
# gemini:
# enabled: false
# # path: /usr/local/bin/gemini
# # args: ["-p", "{prompt}"]
# # timeout_ms: 120000
# Optional: Kubernetes / homelab awareness tools (k8s.pods, k8s.deployments, k8s.logs)
# k8s:
# enabled: false
@@ -422,3 +451,37 @@ hooks:
# wake_phrase: "hey flynn"
# timeout_ms: 120000
# allow_manual_toggle: true
# ── Sub-Agent Configs ────────────────────────────────────────────────
# Named agent configurations for delegation via agent.delegate tool.
# Each agent gets a focused system prompt, model tier, and tool profile.
#
# agent_configs:
# research:
# model_tier: default
# tool_profile: messaging
# system_prompt: |
# You are a research agent. Your job is to find, verify, and synthesize
# information from the web. Be thorough but concise. Cite sources when
# possible. Return structured findings — not conversational filler.
# Use web.search to find sources, web.fetch to read them, and file.write
# to save findings when asked.
#
# code:
# model_tier: complex
# tool_profile: coding
# system_prompt: |
# You are a code agent. Your job is to read, write, debug, refactor,
# and review code. You have full access to the filesystem and shell.
# Be precise. Read files before modifying them. Run tests after changes.
# Use file.edit/file.patch for surgical edits, not full file rewrites.
# Commit conventions: conventional commits, small atomic changes.
#
# comms:
# model_tier: fast
# tool_profile: messaging
# system_prompt: |
# You are a communications agent. Your job is to draft messages,
# summarize emails, triage inbox items, and prepare quick replies.
# Be concise and match the operator's tone. Skip marketing emails.
# Never send messages without explicit instruction — draft only.