feat(config): Add multi-agent support with pluggable registry

Implements agent abstraction layer to support multiple AI coding agents.

Built-in presets (E2E tested):
- Claude Code (default)
- Gemini CLI
- OpenAI Codex

Key changes:
- Add AgentRegistry with built-in presets and custom agent support
- Add TownSettings with default_agent and custom agents map
- Add Agent field to RigSettings for per-rig agent selection
- Update ResolveAgentConfig for hierarchical config resolution
- Update spawn paths to use configured agent instead of hardcoded claude

Configuration hierarchy (first match wins):
1. Rig's Runtime config (backwards compat)
2. Rig's Agent -> custom agents -> built-in presets
3. Town's default_agent setting
4. Fallback to Claude

Additional agents (aider, opencode, etc.) can be added via config file:
settings/agents.json

Addresses Issue #10: Agent Agnostic Engine with Multi-provider support

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
mayor
2026-01-04 14:46:54 -05:00
committed by Raymond Weitekamp
parent 8dea4acf8c
commit ea1a41f1f5
7 changed files with 709 additions and 20 deletions

View File

@@ -122,7 +122,9 @@ func SpawnPolecatForSling(rigName string, opts SlingSpawnOptions) (*SpawnedPolec
fmt.Printf("Polecat created. Agent must be started manually.\n\n")
fmt.Printf("To start the agent:\n")
fmt.Printf(" cd %s\n", polecatObj.ClonePath)
fmt.Printf(" claude --dangerously-skip-permissions\n\n")
// Use rig's configured agent command
agentCmd := config.ResolveAgentConfig(townRoot, r.Path).BuildCommand()
fmt.Printf(" %s\n\n", agentCmd)
fmt.Printf("Agent will discover work via gt prime on startup.\n")
return &SpawnedPolecatInfo{