feat(athena): complete delegation routing fix with mode-aware delegation table

- Re-add ATHENA_PROMPT_METADATA with tight triggers and avoidWhen guardrails
- Update switch_agent tool description with permanent handoff guardrail
- Make buildDelegationTable mode-aware: switch_agent for primary, task() for subagent
- Pass agent mode through general-agents to AvailableAgent interface
- Improve primary agent error messages in subagent-resolver with alternatives
- Add council-first bias to Athena interactive prompt
- Update athena-junior trigger text for clearer task() invocation guidance
- Add tests for ATHENA_PROMPT_METADATA shape, triggers, useWhen, avoidWhen
This commit is contained in:
ismeth
2026-03-03 13:21:40 +01:00
committed by YeonGyu-Kim
parent 7ffdd15b52
commit efc53de531
5 changed files with 69 additions and 46 deletions
+4 -1
View File
@@ -1,5 +1,5 @@
import type { AgentConfig } from "@opencode-ai/sdk"
import type { BuiltinAgentName, AgentOverrides, AgentPromptMetadata } from "../types"
import type { AgentMode, BuiltinAgentName, AgentOverrides, AgentPromptMetadata } from "../types"
import type { CategoryConfig, GitMasterConfig } from "../../config/schema"
import type { BrowserAutomationProvider } from "../../config/schema"
import type { AvailableAgent } from "../dynamic-agent-prompt-builder"
@@ -110,10 +110,13 @@ export function collectPendingBuiltinAgents(input: {
const metadata = agentMetadata[agentName]
if (metadata) {
const mode = isFactory(source) ? source.mode : (config.mode as AgentMode | undefined)
availableAgents.push({
name: agentName,
description: config.description ?? "",
metadata,
mode,
})
}
}