test: add tests for council config schema, prompt content, and config injection

This commit is contained in:
ismeth
2026-02-26 12:48:04 +01:00
committed by YeonGyu-Kim
parent 3dd378fce6
commit a30d0a1427
4 changed files with 168 additions and 1 deletions
@@ -0,0 +1,26 @@
import { describe, expect, it } from "bun:test"
import { createAthenaAgent } from "./agent"
describe("Athena prompt config injection placeholders", () => {
const athenaConfig = createAthenaAgent("anthropic/claude-opus-4-6")
describe("#given the Athena agent prompt", () => {
describe("#when checking for runtime injection placeholders", () => {
it("#then contains RETRY_ON_FAIL placeholder", () => {
expect(athenaConfig.prompt).toContain("{RETRY_ON_FAIL}")
})
it("#then contains STUCK_THRESHOLD_SECONDS placeholder", () => {
expect(athenaConfig.prompt).toContain("{STUCK_THRESHOLD_SECONDS}")
})
it("#then contains quorum reference", () => {
expect(athenaConfig.prompt).toContain("quorum")
})
it("#then contains timeout reference with 30000", () => {
expect(athenaConfig.prompt).toContain("30000")
})
})
})
})
@@ -0,0 +1,24 @@
import { describe, expect, it } from "bun:test"
import { COUNCIL_MEMBER_PROMPT } from "./council-member-agent"
describe("COUNCIL_MEMBER_PROMPT", () => {
describe("#given the prompt constant", () => {
describe("#when checking for required tag instructions", () => {
it("#then contains COUNCIL_MEMBER_RESPONSE tag name", () => {
expect(COUNCIL_MEMBER_PROMPT).toContain("COUNCIL_MEMBER_RESPONSE")
})
it("#then contains Response Format section header", () => {
expect(COUNCIL_MEMBER_PROMPT).toContain("Response Format")
})
it("#then contains opening tag example", () => {
expect(COUNCIL_MEMBER_PROMPT).toContain("<COUNCIL_MEMBER_RESPONSE>")
})
it("#then contains closing tag example", () => {
expect(COUNCIL_MEMBER_PROMPT).toContain("</COUNCIL_MEMBER_RESPONSE>")
})
})
})
})
@@ -9,6 +9,10 @@ describe("council-member-agents", () => {
{ model: "openai/gpt-5.3-codex", name: "GPT" },
{ model: "anthropic/claude-opus-4-6", name: "gpt" },
],
retry_on_fail: 0,
retry_failed_if_others_finished: false,
cancel_retrying_on_quorum: true,
stuck_threshold_seconds: 120,
}
//#when
const result = registerCouncilMemberAgents(config)
@@ -24,6 +28,10 @@ describe("council-member-agents", () => {
{ model: "openai/gpt-5.3-codex", name: "GPT" },
{ model: "anthropic/claude-opus-4-6", name: "Claude" },
],
retry_on_fail: 0,
retry_failed_if_others_finished: false,
cancel_retrying_on_quorum: true,
stuck_threshold_seconds: 120,
}
//#when
const result = registerCouncilMemberAgents(config)
@@ -40,6 +48,10 @@ describe("council-member-agents", () => {
{ model: "openai/gpt-5.3-codex", name: "GPT Codex" },
{ model: "openai/gpt-5.3-codex", name: "Codex GPT" },
],
retry_on_fail: 0,
retry_failed_if_others_finished: false,
cancel_retrying_on_quorum: true,
stuck_threshold_seconds: 120,
}
//#when
const result = registerCouncilMemberAgents(config)
@@ -56,6 +68,10 @@ describe("council-member-agents", () => {
{ model: "openai/gpt-5.3-codex", name: "GPT" },
{ model: "invalid-no-slash", name: "Invalid" },
],
retry_on_fail: 0,
retry_failed_if_others_finished: false,
cancel_retrying_on_quorum: true,
stuck_threshold_seconds: 120,
}
//#when
const result = registerCouncilMemberAgents(config)