feat(agents): wire agent_definitions and opencode.json agents into precedence chain

- Modified agent-config-handler.ts to load and integrate both new agent sources
- Added loadAgentDefinitions() and readOpencodeConfigAgents() calls in loading phase
- Integrated both sources into agent precedence chains (both Sisyphus-enabled and disabled paths)
- Added detailed logging for new agent sources
- Added filtering logic to respect disabled_agents configuration
- Extended agent-config-handler.test.ts with 7 new integration tests
- All tests passing (18/18 integration, 65/65 loader suite)

Wave 3 of agent definitions enhancement complete.
This commit is contained in:
Brandon Webb
2026-04-14 13:34:30 -04:00
committed by YeonGyu-Kim
parent 5755a90c3b
commit 39bda91bc7
5 changed files with 298 additions and 4 deletions
@@ -9,6 +9,7 @@ import type { ClaudeCodeAgentConfig } from "./types"
interface OpencodeConfigWithAgents {
agents?: Record<string, unknown>
agent?: Record<string, unknown>
agent_definitions?: string | string[]
}
@@ -103,8 +104,10 @@ export function readOpencodeConfigAgents(directory: string): Record<string, Clau
const configDir = path.dirname(configPath)
if (parseResult.data.agents && typeof parseResult.data.agents === "object") {
for (const [agentName, agentData] of Object.entries(parseResult.data.agents)) {
const agentsToLoad = parseResult.data.agents || parseResult.data.agent
if (agentsToLoad && typeof agentsToLoad === "object") {
for (const [agentName, agentData] of Object.entries(agentsToLoad)) {
const converted = convertInlineAgent(agentData)
if (converted) {
result[agentName] = converted