feat(02-03): retry-aware failure escalation pipeline

- Add MAX_RETRY_ATTEMPTS (2) and RETRY_COOLDOWN_MS (30s) constants
- Replace immediate escalation with retry-then-escalate logic
- Escalation chain: retry same agent -> manager -> CEO -> user notification
- Reset retry count on successful task completion
- Update Reassign on run failure automation rule with afterRetryExhaustion condition
- Add comprehensive unit tests for escalation state machine (11 tests)
This commit is contained in:
ZacharyZhang-NY committed 2026-03-22 03:53:18 -04:00
1 parent 46dee6c66b
commit f3874568a2
3 files changed
+395 -9

No files matched your search

+2 -1
View File
@@ -32,9 +32,10 @@ export const DEFAULT_AUTOMATION_RULES: ReadonlyArray<{
},
{
name: "Reassign on run failure",
description: "When a run fails, attempt to reassign the task to another capable agent.",
description: "When a run fails after exhausting retries, attempt to reassign the task to another capable agent.",
trigger: "run_failed",
action: "reassign_task",
conditionsJson: JSON.stringify({ afterRetryExhaustion: true }),
priority: 75,
},
{