2026-03-02 22:18:08 +01:00
|
|
|
/// <reference types="bun-types" />
|
|
|
|
|
|
2026-03-03 00:04:31 +01:00
|
|
|
import { describe, expect, it } from "bun:test"
|
2026-03-02 22:18:08 +01:00
|
|
|
import { createAthenaAgent } from "./agent"
|
2026-03-03 00:04:31 +01:00
|
|
|
import { createAthenaJuniorAgent } from "./athena-junior-agent"
|
2026-03-02 22:18:08 +01:00
|
|
|
|
|
|
|
|
describe("createAthenaAgent", () => {
|
|
|
|
|
describe("#given the agent mode", () => {
|
|
|
|
|
describe("#when accessing the static mode property", () => {
|
2026-03-03 00:04:31 +01:00
|
|
|
it("#then equals 'primary'", () => {
|
|
|
|
|
expect(createAthenaAgent.mode).toBe("primary")
|
2026-03-02 22:18:08 +01:00
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
})
|
|
|
|
|
|
2026-03-03 00:04:31 +01:00
|
|
|
it("#then includes a description containing synthesis strategist", () => {
|
2026-03-02 22:18:08 +01:00
|
|
|
const config = createAthenaAgent("anthropic/claude-opus-4-6")
|
|
|
|
|
expect(config.description).toContain("synthesis strategist")
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
2026-03-03 00:04:31 +01:00
|
|
|
describe("#given the interactive prompt", () => {
|
|
|
|
|
describe("#when checking prompt content", () => {
|
|
|
|
|
it("#then contains Question tool references", () => {
|
2026-03-02 22:18:08 +01:00
|
|
|
const config = createAthenaAgent("anthropic/claude-opus-4-6")
|
|
|
|
|
expect(config.prompt).toContain("Question tool")
|
|
|
|
|
})
|
|
|
|
|
|
2026-03-03 00:04:31 +01:00
|
|
|
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", () => {
|
2026-03-02 22:18:08 +01:00
|
|
|
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>")
|
|
|
|
|
})
|
2026-03-03 00:04:31 +01:00
|
|
|
|
|
|
|
|
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")
|
|
|
|
|
})
|
2026-03-02 22:18:08 +01:00
|
|
|
})
|
|
|
|
|
})
|
2026-03-03 00:04:31 +01:00
|
|
|
})
|
2026-03-02 22:18:08 +01:00
|
|
|
|
2026-03-03 00:04:31 +01:00
|
|
|
describe("createAthenaJuniorAgent", () => {
|
|
|
|
|
describe("#given the agent mode", () => {
|
|
|
|
|
describe("#when accessing the static mode property", () => {
|
|
|
|
|
it("#then equals 'subagent'", () => {
|
|
|
|
|
expect(createAthenaJuniorAgent.mode).toBe("subagent")
|
2026-03-02 22:18:08 +01:00
|
|
|
})
|
2026-03-03 00:04:31 +01:00
|
|
|
})
|
|
|
|
|
})
|
2026-03-02 22:18:08 +01:00
|
|
|
|
2026-03-03 00:04:31 +01:00
|
|
|
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")
|
2026-03-02 22:18:08 +01:00
|
|
|
})
|
|
|
|
|
|
2026-03-03 00:04:31 +01:00
|
|
|
it("#then sets temperature to 0.1", () => {
|
|
|
|
|
const config = createAthenaJuniorAgent("anthropic/claude-opus-4-6")
|
|
|
|
|
expect(config.temperature).toBe(0.1)
|
2026-03-02 22:18:08 +01:00
|
|
|
})
|
|
|
|
|
|
2026-03-03 00:04:31 +01:00
|
|
|
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")
|
2026-03-02 22:18:08 +01:00
|
|
|
})
|
|
|
|
|
})
|
2026-03-03 00:04:31 +01:00
|
|
|
})
|
2026-03-02 22:18:08 +01:00
|
|
|
|
2026-03-03 00:04:31 +01:00
|
|
|
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>")
|
2026-03-02 22:18:08 +01:00
|
|
|
})
|
|
|
|
|
|
2026-03-03 00:04:31 +01:00
|
|
|
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")
|
2026-03-02 22:18:08 +01:00
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|