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 <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/// <reference types="bun-types" />
|
||||
|
||||
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)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user