Skip to content

Company OS scheduler: only rate-limit failures have a recovery path — every other failure is an opaque str(exc) retried on cron #13116

Open

Description

@mrveiss

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:

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
    undifferentiated FAILED)
  • 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

  1. mrveiss commented on Jul 31, 2026

    @mrveiss
    OwnerAuthor

    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 from RATE_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: SKIPPED and the quota state may already cover part of the intended taxonomy.

  2. modified the milestones: Backlog, v0.13.0 on Sep 12, 2026
  3. added
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Oct 28, 2026
  4. github-actions commented on Oct 28, 2026

    @github-actions
    Contributor

    needs-structure: this issue is missing:

    • a goal milestone M<n> - ...: v0.13.0 is not a goal milestone
    • a phase:M<n>.<k> label whose <n> matches the goal milestone: found none

    The label clears on the next issue event once all three are present (#19522).

  5. changed the title [-]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[/+] on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions