From 9eea3224a59ff139b2d8c0cdbba64707178c00f8 Mon Sep 17 00:00:00 2001 From: ismeth Date: Thu, 26 Feb 2026 12:44:02 +0100 Subject: [PATCH] feat(agents): inject council resilience config into Athena prompt at runtime --- src/agents/builtin-agents.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/agents/builtin-agents.ts b/src/agents/builtin-agents.ts index 4cc03d51c..4288d659c 100644 --- a/src/agents/builtin-agents.ts +++ b/src/agents/builtin-agents.ts @@ -202,9 +202,22 @@ export async function createBuiltinAgents( log("[builtin-agents] Some council members were skipped during registration", { skippedMembers }) } + const retryOnFail = councilConfig.retry_on_fail ?? 0 + const retryIfFinished = councilConfig.retry_failed_if_others_finished ?? false + const cancelOnQuorum = councilConfig.cancel_retrying_on_quorum ?? true + const stuckThreshold = councilConfig.stuck_threshold_seconds ?? 120 + + let athenaPrompt = (result["athena"].prompt ?? "") + councilTaskInstructions + athenaPrompt = athenaPrompt + .replace(/\{RETRY_ON_FAIL\}/g, String(retryOnFail)) + .replace(/\{RETRY_FAILED_IF_OTHERS_FINISHED\}/g, String(retryIfFinished)) + .replace(/\{CANCEL_RETRYING_ON_QUORUM\}/g, String(cancelOnQuorum)) + .replace(/\{STUCK_THRESHOLD_SECONDS\}/g, String(stuckThreshold)) + athenaPrompt += `\n\n## Council Resilience Config\n- retry_on_fail: ${retryOnFail}\n- retry_failed_if_others_finished: ${retryIfFinished}\n- cancel_retrying_on_quorum: ${cancelOnQuorum}\n- stuck_threshold_seconds: ${stuckThreshold}` + result["athena"] = { ...result["athena"], - prompt: (result["athena"].prompt ?? "") + councilTaskInstructions, + prompt: athenaPrompt, } } else { result["athena"] = applyMissingCouncilGuard(result["athena"], skippedMembers)