Skip to content

fix(automation): skip scheduled runs while every harness is usage-limited - #418

Merged
danii1 merged 1 commit into
mainfrom
fix/automations-respect-usage-limit
Nov 14, 2026
Merged

danii1 merged 1 commit into
mainfrom
fix/automations-respect-usage-limit

Conversation

@danii1

@danii1 danii1 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Scheduled automations and estimations kept spawning while every harness in the chain was usage-limited. AutomationAcquirer only checked its license-access paused flag. It never checked getWorkerFailover().allExhausted(), which the retry and injected-task acquirers already check.

Seen on a live worker: opencode was limited until 2026-11-20, yet e2e-expander, log-triage, code-release and flaky-test-finder each started on schedule. Each one failed within about 4s and logged the same usage limit again.

Fix

  • Scheduled runs: an occurrence that comes due while no harness can run is skipped. The cursor advances through a new AutomationStateStore.skipDue, so there is no hot loop and no catch-up burst when the limit resets. It logs occurrence skipped: no agent harness is available until ….
  • Run now: dashboard Run now is rejected with the same reason.
  • Pinned harness: entries that pin their own harness are gated only on that harness's window.
  • Estimations: EstimationAcquirer inherits the same gate.
  • The gate can be injected through the harnessBlockedUntil option (used in tests).
  • Added a note to docs/code/worker.md.

Tests

  • New tests in tests/automation-acquirer.test.ts cover the skip and cursor advance, the Run now rejection, the normal path, and the default gate (chain and pinned windows).
  • Full @getdevintern/code suite: 2900 pass, 0 fail. Typecheck and lint are clean.

🤖 Generated with Claude Code

…ited

The automation scheduler only checked its license-access pause flag, so
automations and estimations kept spawning while the harness chain was
exhausted, failing within seconds and re-reporting the limit.

Due occurrences are now skipped (cursor advances, no catch-up burst) and
dashboard Run now is rejected while no harness can run. Entries pinning
their own harness are gated on that harness's window only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@danii1
danii1 merged commit ec078a4 into main Nov 14, 2026
1 check passed
@danii1
danii1 deleted the fix/automations-respect-usage-limit branch November 14, 2026 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant