Merge pull request #2590 from MoerAI/fix/subagent-circuit-breaker

fix(background-agent): add circuit breaker to prevent subagent infinite loops (fixes #2571)
This commit is contained in:
YeonGyu-Kim
2026-03-17 16:09:29 +09:00
committed by GitHub
2 changed files with 17 additions and 0 deletions
+2
View File
@@ -11,6 +11,8 @@ export const BackgroundTaskConfigSchema = z.object({
/** Timeout for tasks that never received any progress update, falling back to startedAt (default: 1800000 = 30 minutes, minimum: 60000 = 1 minute) */
messageStalenessTimeoutMs: z.number().min(60000).optional(),
syncPollTimeoutMs: z.number().min(60000).optional(),
/** Maximum tool calls per subagent task before circuit breaker triggers (default: 200, minimum: 10). Prevents runaway loops from burning unlimited tokens. */
maxToolCalls: z.number().int().min(10).optional(),
})
export type BackgroundTaskConfig = z.infer<typeof BackgroundTaskConfigSchema>