Public: anyone can read this; the crew can change it.

checks.concurrency counts a runner's capacity, so adding a runner raises how many checks run at once #15268

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Each registered runner that is live now raises how many checks run at once: by the number of jobs it runs at once, up to the setting's own ceiling of 16. Before this, checks.concurrency counted only the forge's own cells. What changed One function decides the number.

Notes

shipped production is serving it deploy cfe12e4

opened this

Each registered runner that is live now raises how many checks run at once: by the number of jobs it runs at once, up to the setting's own ceiling of 16. Before this, checks.concurrency counted only the forge's own cells.

What changed

  • One function decides the number. capacity(lane) in src/checks/lane_state.ts is still the one place the scheduler and spareSlots read it. It is now the setting plus liveRunnerJobs(db, now), and it adds the runners only when checks are placed on runners. Under the process placement runners never get a check, so they add nothing. The total is capped at CHECKS_CEILING, which is the setting's own maximum of 16 read from CAPACITY, so a crowd of runners can't overload the machine.
  • The forge now learns how many jobs a runner runs. Before, it never knew. A new migration 20261121190000-check-runner-jobs (pinned) adds check_runner.jobs, default 1. src/runner/main.ts sends jobs (its FORGE_RUNNER_JOBS) on every POST /api/v1/runner/claim. The claim handler stores it through noteRunnerJobs and ignores anything that isn't a whole number from 1 to 64. The OpenAPI route lists the new field.
  • A runner that goes quiet stops counting without a restart. liveRunnerJobs adds up the jobs of runners seen within SEEN_FRESH_MS (60 s), the same window runnersAround already uses, and it is read on every pick. A runner that connects is counted at the next tick. One that stops asking drops out once a minute has passed since it was last seen.
  • Text. The help line for "Checks at once" now opens with one sentence on what it counts: the forge's own cells, plus each runner seen in the last minute, up to 16. docs/features/runners.md moves this item out of "Not yet".

Where to look

  • The cap is on the total, not on the setting: with the setting at 16, runners add nothing.
  • The forge's own local-N runners count the same way as runners started by hand. They are the ones that make the cap matter on a single machine.

Not done

  • No page lists runners.
  • Nothing else that reads checks.concurrency (vitals, bottleneck, pipeline) shows the runner-raised number; those readouts still show the bare setting.
  • The setting's ceiling stays 16.

Tests

  • test/checks-runner-capacity.test.ts (new) checks the setting plus live runners, the process placement, a runner dropping out at the edge of the 60 s window, the cap, input validation and the help sentence. The first case fails without the change.
  • test/runner-claim.test.ts gains a case where a claim's jobs is stored.
  • bun scripts/gate.ts --fix and bun x tsc --noEmit are clean.
  • scripts/fast.ts named 3,388 files because the migration reaches everything. Instead I ran the 76 test files covering runners, capacity, migrations, the contract and everything that imports lane_state or runner_jobs: 983 pass, 0 fail.
  • No screenshots: the only visible change is that one help sentence, so the before and after looks are the old and new text.
  • The desk note says production is releasing. This pull only proposes; nothing here touches production.

Try The Try: commit names /admin/capacity, but the page is /settings/capacity. I couldn't amend it because force-pushes are refused.

[{"go":"/settings/capacity","look":"The Checks row's \"Checks at once\" help text","expect":"It starts: How many repository checks run at once on this forge's own cells; each runner seen in the last minute adds the jobs it runs at once, up to 16 in all."},
 {"go":"/settings/capacity","look":"The rest of that help text","expect":"Unchanged after that sentence: lowering it lets running ones finish, and the Empty default from CPUs is still described","ask":"Is one sentence enough to say runners count?"}]

🤖 Generated with Claude Code

Closes #15253

commented

Each registered runner that is live now raises how many checks run at once: by the number of jobs it runs at once, up to the setting's own ceiling of 16. Before this, checks.concurrency counted only the forge's own cells.

What changed

  • One function decides the number. capacity(lane) in src/checks/lane_state.ts is still the one place the scheduler and spareSlots read it. It is now the setting plus liveRunnerJobs(db, now), and it adds the runners only when checks are placed on runners. Under the process placement runners never get a check, so they add nothing. The total is capped at CHECKS_CEILING, which is the setting's own maximum of 16 read from CAPACITY, so a crowd of runners can't overload the machine.
  • The forge now learns how many jobs a runner runs. Before, it never knew. A new migration 20261121190000-check-runner-jobs (pinned) adds check_runner.jobs, default 1. src/runner/main.ts sends jobs (its FORGE_RUNNER_JOBS) on every POST /api/v1/runner/claim. The claim handler stores it through noteRunnerJobs and ignores anything that isn't a whole number from 1 to 64. The OpenAPI route lists the new field.
  • A runner that goes quiet stops counting without a restart. liveRunnerJobs adds up the jobs of runners seen within SEEN_FRESH_MS (60 s), the same window runnersAround already uses, and it is read on every pick. A runner that connects is counted at the next tick. One that stops asking drops out once a minute has passed since it was last seen.
  • Text. The help line for "Checks at once" now opens with one sentence on what it counts: the forge's own cells, plus each runner seen in the last minute, up to 16. docs/features/runners.md moves this item out of "Not yet".

Where to look

  • The cap is on the total, not on the setting: with the setting at 16, runners add nothing.
  • The forge's own local-N runners count the same way as runners started by hand. They are the ones that make the cap matter on a single machine.

Not done

  • No page lists runners.
  • Nothing else that reads checks.concurrency (vitals, bottleneck, pipeline) shows the runner-raised number; those readouts still show the bare setting.
  • The setting's ceiling stays 16.

Tests

  • test/checks-runner-capacity.test.ts (new) checks the setting plus live runners, the process placement, a runner dropping out at the edge of the 60 s window, the cap, input validation and the help sentence. The first case fails without the change.
  • test/runner-claim.test.ts gains a case where a claim's jobs is stored.
  • bun scripts/gate.ts --fix and bun x tsc --noEmit are clean.
  • scripts/fast.ts named 3,388 files because the migration reaches everything. Instead I ran the 76 test files covering runners, capacity, migrations, the contract and everything that imports lane_state or runner_jobs: 983 pass, 0 fail.
  • No screenshots: the only visible change is that one help sentence, so the before and after looks are the old and new text.
  • The desk note says production is releasing. This pull only proposes; nothing here touches production.

Try The Try: commit names /admin/capacity, but the page is /settings/capacity. I couldn't amend it because force-pushes are refused.

[{"go":"/settings/capacity","look":"The Checks row's \"Checks at once\" help text","expect":"It starts: How many repository checks run at once on this forge's own cells; each runner seen in the last minute adds the jobs it runs at once, up to 16 in all."},
 {"go":"/settings/capacity","look":"The rest of that help text","expect":"Unchanged after that sentence: lowering it lets running ones finish, and the Empty default from CPUs is still described","ask":"Is one sentence enough to say runners count?"}]

🤖 Generated with Claude Code

commented

Each registered runner that is live now raises how many checks run at once: by the number of jobs it runs at once, up to the setting's own ceiling of 16. Before this, checks.concurrency counted only the forge's own cells.

What changed

  • One function decides the number. capacity(lane) in src/checks/lane_state.ts is still the one place the scheduler and spareSlots read it. It is now the setting plus liveRunnerJobs(db, now), and it adds the runners only when checks are placed on runners. Under the process placement runners never get a check, so they add nothing. The total is capped at CHECKS_CEILING, the setting's own maximum of 16, so a crowd of runners can't overload the machine.
  • The forge now learns how many jobs a runner runs. A new migration 20261121190000-check-runner-jobs (pinned) adds check_runner.jobs, default 1. src/runner/main.ts sends jobs (its FORGE_RUNNER_JOBS) on every POST /api/v1/runner/claim. The claim handler stores it through noteRunnerJobs and ignores anything that isn't a whole number from 1 to 64. The OpenAPI route lists the new field.
  • A runner that goes quiet stops counting without a restart. liveRunnerJobs adds up the jobs of runners seen within SEEN_FRESH_MS (60 s), the same window runnersAround uses, and it is read on every pick. A runner that connects is counted at the next tick. One that stops asking drops out a minute after it was last seen.
  • Text. The help line for "Checks at once" now opens with one sentence on what it counts: the forge's own cells, plus each runner seen in the last minute, up to 16. docs/features/runners.md moves this item out of "Not yet".
  • Gate fix. The first push failed the gate's "both doors" rule (no terminal screen or how-to for the new migration). The jobs field is plumbing between a runner and the forge with nothing new to open, so a commit carries a No door: line saying so. Main is merged in so the branch runs main's version of that rule.

Where to look

  • The cap is on the total, not on the setting: with the setting at 16, runners add nothing.
  • The forge's own local-N runners count the same way as runners started by hand.
  • The terminal's capacity screen shows each setting's reason, not its help, so the new sentence appears on the web page and in the doc but not in the terminal.
  • The gate still prints a note that liveRunnerJobs looks like countThread in src/core/issues.ts (0.71). It doesn't fail the gate; they are counts over different tables, so I left them apart.

Not done

  • No page lists runners.
  • The vitals, bottleneck and pipeline readouts still show the bare setting, not the number raised by runners.
  • The setting's ceiling stays 16.

Tests

  • test/checks-runner-capacity.test.ts (new) checks the setting plus live runners, the process placement, a runner dropping out at the edge of the 60 s window, the cap, input validation and the help sentence. The first case fails without the change.
  • test/runner-claim.test.ts gains a case where a claim's jobs is stored.
  • After merging main: the gate, run with FORGE_CHECK_BASE=origin/main, passes; bun x tsc --noEmit is clean; 150 tests pass and none fail across the runner, capacity and schema-migration test files. Before the merge, 983 tests across 76 files covering runners, capacity, migrations, the contract and what imports lane_state or runner_jobs also passed.
  • No screenshots: the only visible change is that one help sentence, so the before and after looks are the old and new text.
  • The desk note says production is releasing. This pull only proposes; nothing here touches production.

Try The Try: commit names /admin/capacity, but the page is /settings/capacity. I couldn't amend it because force-pushes are refused.

[{"go":"/settings/capacity","look":"The Checks row's \"Checks at once\" help text","expect":"It starts: How many repository checks run at once on this forge's own cells; each runner seen in the last minute adds the jobs it runs at once, up to 16 in all."},
 {"go":"/settings/capacity","look":"The rest of that help text","expect":"Unchanged after that sentence: lowering it lets running ones finish, and the Empty default from CPUs is still described","ask":"Is one sentence enough to say runners count?"}]

🤖 Generated with Claude Code

Approved

Clean. capacity() is the single reader: setting plus liveRunnerJobs, runner placement only, capped at the setting ceiling. The jobs count is validated at the boundary (whole number 1 to 64), behind runner-token auth. Staleness uses the existing SEEN_FRESH_MS window, so no restart is needed. The migration is additive and pinned. Tests cover the sum, the process placement, the window edge, the cap, input validation and the claim round trip. The runners how-to is in docs/features and README is untouched. Not changed, and fine to follow up: the vitals and bottleneck readouts still show the bare setting.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs