Repository navigation
Description
Problem
Rate-limit failures have a designed recovery path. Every other failure class has
none. A run that fails for any other reason records the raw exception string and
waits for the next cron tick — no classification, no recovery, and no actionable
message for the operator.
Evidence
Rate limiting is handled well — llc/scheduler/heartbeat_scheduler.py:20-24,71-72
computes retry_after with exponential backoff (base 300 s, capped at 4 h),
re-queues the agent in Redis at that time, survives a server restart
(:137-142), and re-queues agents evicted from Redis (:176-199).
Every other failure just records the exception:
heartbeat_scheduler.py:498-501—status=FAILED, error=str(exc)heartbeat_scheduler.py:528—final_status = FAILED
So a run that failed because the agent CLI is not signed in, or because it hung,
or because its workspace vanished, is stored as an opaque str(exc) and simply
retried at the next cron time — with the same outcome, indefinitely.
Two distinct gaps
1. No failure classification. Failures are either rate_limited or an
undifferentiated FAILED. At minimum these are operationally different and should
be distinguishable: not-signed-in (never recoverable without operator action),
transient/crash (a retry may genuinely help), hung/stalled, and
misconfiguration (bad workspace, missing binary).
2. The recorded error is not actionable. str(exc) is an implementation
detail. The operator needs the fix, not the stack trace — e.g. "agent CLI is not
signed in — run <login command>" rather than a CalledProcessError repr.
Related constraint — truthful recovery messaging
If any automatic recovery is added, the recorded outcome must reflect what
actually happened, verified, not what was attempted. "Restarted the agent"
must only be recorded once the replacement was confirmed healthy; a failed
recovery must say so and name the operator action instead. A hopeful message that
is wrong is worse than no message, because it stops the operator investigating.
Relationship to sibling issues
This is the reporting and recovery half of the problem; two siblings supply
inputs to the classification:
- Company OS adapters: no read-only sign-in probe before dispatch — signed-out agents burn scheduler slots #13098 — a sign-in probe makes the "not signed in" class detectable up front
- LLC adapters: no stall or first-output watchdog — a hung run holds a slot for the full 3600s timeout #13099 — stall/first-output deadlines make the "hung" class detectable
This issue is still needed with both in place: they detect two classes, this one
decides what the scheduler does and what the operator sees.
Acceptance criteria
- Failure classes distinguishable in the persisted run record (not one
undifferentiatedFAILED) - Operator-facing error text is actionable — names the likely fix, not the
exception repr; raw exception retained separately for debugging - A permanently-unrecoverable class (e.g. not signed in) stops being
re-dispatched every cron tick, and says why - Any recovery action records only verified outcomes
- Existing rate-limit backoff path unchanged (explicit regression test)
Notes
Confirmed during a capability audit of the LLC adapter layer.
Activity
mrveiss commentedon Jul 31, 2026
Consolidation note — extend the existing enum, do not add a parallel one.
LLCRunStatus(llc/models/enums.py:150-170) already carries real failure granularity:FAILED,INTERRUPTED,TIMEOUT,CANCELLED,RATE_LIMITED,SKIPPED(GH#9951 — not dispatched: no adapter / CLI absent), plus quota-exhausted (GH#10218, explicitly distinct fromRATE_LIMITED).So the classification this issue asks for should extend
LLCRunStatus, not introduce a second failure-reason enum beside it. The enum's own docstring says it exists to consolidate heartbeat and adapter status vocabularies (GH#8261) — a parallel enum would re-fork exactly what that consolidated.Check before adding any new member:
SKIPPEDand the quota state may already cover part of the intended taxonomy.github-actions commentedon Oct 28, 2026
needs-structure: this issue is missing:M<n> - ...:v0.13.0is not a goal milestonephase:M<n>.<k>label whose<n>matches the goal milestone: found noneThe label clears on the next issue event once all three are present (#19522).
[-]LLC scheduler: only rate-limit failures have a recovery path — every other failure is an opaque str(exc) retried on cron[/-][+]Company OS scheduler: only rate-limit failures have a recovery path — every other failure is an opaque str(exc) retried on cron[/+]