You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(platform): a task run that ran out of memory with its retries spent is announced up to 30 minutes late #4717
When a task agent run fails with resource_exhausted (its sandbox hit its memory limit), failAgentRunFromTurn holds the task.agent_retry job for 2, 10 or 30 minutes (services/platform/backend/domains/tasks/agent-runs.ts:712-732, schedule in services/platform/backend/core/tasks/task_auto_retry.ts:30-50). The hold is chosen from the failure code alone — it does not ask whether the retry budget has room. Verified on main at 73d03a9.
When the budget is already spent, no retry follows: the held job only wakes up to retire the run, and only then does retireAutoRetry (services/platform/backend/domains/tasks/run-failure-notice.ts:76-96) call announceAgentRunFailed. The people the run answers to learn of the final failure 2–30 minutes late, while every other final failure is announced in the failing transaction (agent-runs.ts:733-738). Meanwhile the run card already reads the failure as final, because failedRunRetryPending re-derives the budget (agent-runs.ts:761-779) — card and notification disagree for up to half an hour.
Suggested fix
Decide in the same transaction: compute resolveAutoRetryBudget(await loadTaskRetryHistory(tx, run.taskId)).retry (the walk failedRunRetryPending already uses) and set decideAfter only when a retry will follow; otherwise enqueue the job without startAfter (or retire and announce at once). Test: a resource_exhausted failure with the budget spent announces in the failing transaction.
Activity
fix(platform): announce a spent out-of-memory retry at once
fix(platform): announce a spent out-of-memory retry at once