fix(athena): force athena-junior to background and exempt from hard TTL

Council sessions are long-running: athena-junior launches members then
waits for them via background_wait. Two changes prevent premature kills:

- Force run_in_background=true when subagent_type resolves to athena-junior,
  avoiding the 10-minute sync poll timeout (MAX_POLL_TIME_MS)
- Exempt athena-junior from the 30-minute TASK_TTL_MS hard cutoff since
  council members have their own independent TTLs
- Fix missing bulk_launch field in AthenaOverrideConfigSchema (type error)
This commit is contained in:
ismeth
2026-03-03 17:14:38 +01:00
committed by YeonGyu-Kim
parent 5e71d84a69
commit 513a5c90b1
3 changed files with 133 additions and 1 deletions
+12 -1
View File
@@ -240,6 +240,17 @@ export function createDelegateTask(options: DelegateTaskToolOptions): ToolDefini
fallbackChain = resolution.fallbackChain
}
// Athena-junior council sessions are long-running (members do deep work).
// Force background to avoid the 10-minute sync poll timeout.
const isAthenaJunior = agentToUse.toLowerCase() === "athena-junior"
if (isAthenaJunior && !runInBackground) {
log("[task] Forcing athena-junior to background — council sessions exceed sync poll timeout", {
originalRunInBackground: args.run_in_background,
agentToUse,
})
}
const effectiveRunInBackground = runInBackground || isAthenaJunior
const systemContent = buildSystemContent({
skillContent,
skillContents,
@@ -251,7 +262,7 @@ export function createDelegateTask(options: DelegateTaskToolOptions): ToolDefini
availableSkills,
})
if (runInBackground) {
if (effectiveRunInBackground) {
return executeBackgroundTask(args, ctx, options, parentContext, agentToUse, categoryModel, systemContent, fallbackChain)
}