Files
oh-my-opencode/src/agents/athena/agent.test.ts
T
ismeth 149d065d68 feat(athena): split into athena (interactive) and athena-junior (subagent)
Split the Athena council orchestrator into two distinct agents:
- athena: primary mode, interactive prompt with Question tool and switch_agent
- athena-junior: subagent mode, non-interactive prompt with structured JSON output

Key changes:
- Create athena-junior-agent.ts factory (mode=subagent, denies question+call_omo_agent)
- Revert athena agent.ts to primary mode (no env var switching)
- Make buildAthenaRuntimeGuidance mode-aware (strips action_paths for non-interactive)
- Add mode parameter to council_finalize tool
- Register athena-junior in builtin-agents, tool-config, model-requirements
- Replace "athena" with "athena-junior" in call_omo_agent ALLOWED_AGENTS
- Update all tests for new architecture

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-15 16:48:46 +09:00

127 lines
4.7 KiB
TypeScript

/// <reference types="bun-types" />
import { describe, expect, it } from "bun:test"
import { createAthenaAgent } from "./agent"
import { createAthenaJuniorAgent } from "./athena-junior-agent"
describe("createAthenaAgent", () => {
describe("#given the agent mode", () => {
describe("#when accessing the static mode property", () => {
it("#then equals 'primary'", () => {
expect(createAthenaAgent.mode).toBe("primary")
})
})
})
describe("#given the agent config", () => {
describe("#when creating the agent with a model", () => {
it("#then returns config with the specified model", () => {
const config = createAthenaAgent("anthropic/claude-opus-4-6")
expect(config.model).toBe("anthropic/claude-opus-4-6")
})
it("#then sets temperature to 0.1", () => {
const config = createAthenaAgent("anthropic/claude-opus-4-6")
expect(config.temperature).toBe(0.1)
})
it("#then includes tool restrictions denying call_omo_agent", () => {
const config = createAthenaAgent("anthropic/claude-opus-4-6")
expect(config.permission).toBeDefined()
})
it("#then includes a description containing synthesis strategist", () => {
const config = createAthenaAgent("anthropic/claude-opus-4-6")
expect(config.description).toContain("synthesis strategist")
})
})
})
describe("#given the interactive prompt", () => {
describe("#when checking prompt content", () => {
it("#then contains Question tool references", () => {
const config = createAthenaAgent("anthropic/claude-opus-4-6")
expect(config.prompt).toContain("Question tool")
})
it("#then contains Step 2: Council setup section", () => {
const config = createAthenaAgent("anthropic/claude-opus-4-6")
expect(config.prompt).toContain("Step 2: Council setup")
})
it("#then contains agent_handoff section", () => {
const config = createAthenaAgent("anthropic/claude-opus-4-6")
expect(config.prompt).toContain("<agent_handoff>")
})
it("#then does not contain non-interactive output contract", () => {
const config = createAthenaAgent("anthropic/claude-opus-4-6")
expect(config.prompt).not.toContain("<athena_council_result>")
})
it("#then does not contain NEVER use the Question tool constraint", () => {
const config = createAthenaAgent("anthropic/claude-opus-4-6")
expect(config.prompt).not.toContain("NEVER use the Question tool")
})
})
})
})
describe("createAthenaJuniorAgent", () => {
describe("#given the agent mode", () => {
describe("#when accessing the static mode property", () => {
it("#then equals 'subagent'", () => {
expect(createAthenaJuniorAgent.mode).toBe("subagent")
})
})
})
describe("#given the agent config", () => {
describe("#when creating the agent with a model", () => {
it("#then returns config with the specified model", () => {
const config = createAthenaJuniorAgent("anthropic/claude-opus-4-6")
expect(config.model).toBe("anthropic/claude-opus-4-6")
})
it("#then sets temperature to 0.1", () => {
const config = createAthenaJuniorAgent("anthropic/claude-opus-4-6")
expect(config.temperature).toBe(0.1)
})
it("#then includes tool restrictions denying call_omo_agent and question", () => {
const config = createAthenaJuniorAgent("anthropic/claude-opus-4-6")
expect(config.permission).toBeDefined()
})
it("#then includes a description containing Non-interactive", () => {
const config = createAthenaJuniorAgent("anthropic/claude-opus-4-6")
expect(config.description).toContain("Non-interactive")
})
})
})
describe("#given the non-interactive prompt", () => {
describe("#when checking prompt content", () => {
it("#then contains athena_council_result output contract", () => {
const config = createAthenaJuniorAgent("anthropic/claude-opus-4-6")
expect(config.prompt).toContain("<athena_council_result>")
})
it("#then contains NEVER use the Question tool constraint", () => {
const config = createAthenaJuniorAgent("anthropic/claude-opus-4-6")
expect(config.prompt).toContain("NEVER use the Question tool")
})
it("#then does not contain agent_handoff section", () => {
const config = createAthenaJuniorAgent("anthropic/claude-opus-4-6")
expect(config.prompt).not.toContain("<agent_handoff>")
})
it("#then does not contain switch_agent references", () => {
const config = createAthenaJuniorAgent("anthropic/claude-opus-4-6")
expect(config.prompt).not.toContain("switch_agent")
})
})
})
})