Skip to content

feat: bound automatic run admission - #1297

Merged
jayminwest merged 3 commits into
jayminwest:mainfrom
RogerNavelsaker:feat/automatic-run-capacity
Oct 5, 2026
Merged

jayminwest merged 3 commits into
jayminwest:mainfrom
RogerNavelsaker:feat/automatic-run-capacity

Conversation

@RogerNavelsaker

Copy link
Copy Markdown
Contributor

Summary

  • Bound automatic Warren work with a per-instance concurrency limit (default 1; configurable with WARREN_AUTOMATIC_MAX_CONCURRENT_RUNS).
  • Optionally restrict automatic work to an IANA timezone window using WARREN_AUTOMATIC_RUN_WINDOW=HH:MM-HH:MM@IANA/Timezone; invalid values fail closed.
  • Apply admission to cron/scheduled/CI-fixer/plan-run work and automatic provider retries, while leaving manual runs outside the scheduler gate.
  • Preserve provider/model for automatic retries, preventing a failed local Lemonade run from falling back to cloud.

Verification

  • PATH=/usr/bin:$PATH bun run check:all — 12/12 gates passed.
  • Targeted regression tests: 336 pass, 0 fail.

Context

This change supports local-only automatic model runs and bounded instance capacity. Defaults and env vars are documented in .env.example and docs/design/automatic-run-admission.md.

- CI fixer gets the free slot count, not the whole cap, so one pass
  cannot push automatic runs past WARREN_AUTOMATIC_MAX_CONCURRENT_RUNS.
- Provider retries wait for the admission lock instead of being dropped
  when a scheduler loop holds it; scheduler loops keep try-locking.
- Plan-run ticks gate only the child spawn. Merge polling, timeouts and
  terminal transitions keep running at capacity; a denied spawn returns
  noop and retries next tick.
- Drop a stray empty doc comment in runs-stats.ts.
@jayminwest
jayminwest enabled auto-merge (squash) October 5, 2026 21:22
@jayminwest
jayminwest merged commit 487a204 into jayminwest:main Oct 5, 2026
6 checks passed
@RogerNavelsaker
RogerNavelsaker deleted the feat/automatic-run-capacity branch October 9, 2026 10:51
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.

2 participants