From 61ccd7f9a77c9c92fd4e994a78040df85fe8c429 Mon Sep 17 00:00:00 2001 From: ismeth Date: Mon, 2 Mar 2026 22:28:13 +0100 Subject: [PATCH] fix(athena): include MODE=all agents in uiSelectedModel passthrough The general-agents.ts isPrimaryAgent check only considered mode=primary, causing Athena (now mode=all) to lose uiSelectedModel resolution. Also adds metadata tests for non-interactive triggers. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- .../athena/athena-config-injection.test.ts | 31 ++++++++++++++++++- src/agents/builtin-agents/general-agents.ts | 2 +- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/agents/athena/athena-config-injection.test.ts b/src/agents/athena/athena-config-injection.test.ts index 077c8c752..dfdb7779f 100644 --- a/src/agents/athena/athena-config-injection.test.ts +++ b/src/agents/athena/athena-config-injection.test.ts @@ -1,7 +1,7 @@ /// import { describe, expect, it } from "bun:test" -import { createAthenaAgent } from "./agent" +import { ATHENA_PROMPT_METADATA, createAthenaAgent } from "./agent" describe("Athena prompt config injection placeholders", () => { const athenaConfig = createAthenaAgent("anthropic/claude-opus-4-6") @@ -131,3 +131,32 @@ describe("Athena prompt config injection placeholders", () => { }) }) }) + +describe("Athena prompt metadata", () => { + describe("#given ATHENA_PROMPT_METADATA", () => { + describe("#when checking triggers", () => { + it("#then includes a Non-interactive council trigger", () => { + const hasNonInteractiveTrigger = ATHENA_PROMPT_METADATA.triggers.some((t) => + t.domain.includes("Non-interactive"), + ) + expect(hasNonInteractiveTrigger).toBe(true) + }) + }) + + describe("#when checking useWhen entries", () => { + it("#then includes an entry mentioning oh-my-opencode run", () => { + const hasCLIEntry = ATHENA_PROMPT_METADATA.useWhen.some((entry) => + entry.includes("oh-my-opencode run"), + ) + expect(hasCLIEntry).toBe(true) + }) + + it("#then includes an entry mentioning structured council output", () => { + const hasStructuredEntry = ATHENA_PROMPT_METADATA.useWhen.some((entry) => + entry.includes("structured") || entry.includes("agent-to-agent"), + ) + expect(hasStructuredEntry).toBe(true) + }) + }) + }) +}) diff --git a/src/agents/builtin-agents/general-agents.ts b/src/agents/builtin-agents/general-agents.ts index 61f6fa718..9541d23c2 100644 --- a/src/agents/builtin-agents/general-agents.ts +++ b/src/agents/builtin-agents/general-agents.ts @@ -67,7 +67,7 @@ export function collectPendingBuiltinAgents(input: { } } - const isPrimaryAgent = isFactory(source) && source.mode === "primary" + const isPrimaryAgent = isFactory(source) && (source.mode === "primary" || source.mode === "all") let resolution = applyModelResolution({ uiSelectedModel: (isPrimaryAgent && override?.model === undefined) ? uiSelectedModel : undefined,