From 446901d7aab5f2b06d7a8d4805d4923e2a1aa46b Mon Sep 17 00:00:00 2001 From: ismeth Date: Thu, 12 Feb 2026 14:12:26 +0100 Subject: [PATCH] feat(04-01): add Athena primary agent factory and exports - implement createAthenaAgent with primary-mode model behavior and prompt metadata - export Athena factory and metadata through athena and root agent barrels --- src/agents/athena/agent.ts | 70 ++++++++++++++++++++++++++++++++++++++ src/agents/athena/index.ts | 1 + 2 files changed, 71 insertions(+) create mode 100644 src/agents/athena/agent.ts diff --git a/src/agents/athena/agent.ts b/src/agents/athena/agent.ts new file mode 100644 index 00000000..7068dd0c --- /dev/null +++ b/src/agents/athena/agent.ts @@ -0,0 +1,70 @@ +import type { AgentConfig } from "@opencode-ai/sdk" +import type { AgentMode, AgentPromptMetadata } from "../types" +import { isGptModel } from "../types" +import { createAgentToolRestrictions } from "../../shared/permission-compat" + +const MODE: AgentMode = "primary" + +export const ATHENA_PROMPT_METADATA: AgentPromptMetadata = { + category: "advisor", + cost: "EXPENSIVE", + promptAlias: "Athena", + triggers: [ + { + domain: "Cross-model synthesis", + trigger: "Need consensus analysis and disagreement mapping before selecting implementation targets", + }, + { + domain: "Execution planning", + trigger: "Need prioritized action targets from council findings without direct delegation", + }, + ], + useWhen: [ + "You need Athena to synthesize multi-model council outputs into concrete findings", + "You need agreement-level confidence before selecting what to execute next", + "You need prioritized action targets while keeping final execution control in the caller", + ], + avoidWhen: [ + "Single-model questions that do not need council synthesis", + "Tasks requiring direct implementation by Athena in this phase", + ], +} + +const ATHENA_SYSTEM_PROMPT = `You are Athena, a primary synthesis strategist for multi-model council workflows. + +Your role in this phase: +- Synthesize council outputs into evidence-grounded findings. +- Distinguish consensus from disagreement and flag uncertainty. +- Recommend prioritized action targets the caller can execute. + +Constraints in this phase: +- Do NOT execute delegation workflows. +- Do NOT run confirmation-gated delegation logic (reserved for Phase 5). +- Stay analysis-first and recommendation-oriented. + +Output requirements: +- Keep conclusions concrete, reference supporting evidence from council responses, and call out confidence level. +- Provide clear next action targets ordered by impact and confidence. +- Explicitly identify disagreement areas and false-positive risk.` + +export function createAthenaAgent(model: string): AgentConfig { + const restrictions = createAgentToolRestrictions(["write", "edit", "task"]) + + const base = { + description: + "Primary synthesis strategist for multi-model council outputs. Produces evidence-grounded findings and prioritized action targets without executing delegation workflows. (Athena - OhMyOpenCode)", + mode: MODE, + model, + temperature: 0.1, + ...restrictions, + prompt: ATHENA_SYSTEM_PROMPT, + color: "#1F8EFA", + } as AgentConfig + + if (isGptModel(model)) { + return { ...base, reasoningEffort: "medium" } as AgentConfig + } + + return { ...base, thinking: { type: "enabled", budgetTokens: 32000 } } as AgentConfig +} +createAthenaAgent.mode = MODE diff --git a/src/agents/athena/index.ts b/src/agents/athena/index.ts index 82830b4d..4ddaaf57 100644 --- a/src/agents/athena/index.ts +++ b/src/agents/athena/index.ts @@ -1,4 +1,5 @@ export * from "./types" +export * from "./agent" export * from "./model-parser" export * from "./council-prompt" export * from "./council-orchestrator"