fix(ci): refresh runner capacity after nightly admission waits
Portable placement, nightly control admission and the dedicated nightly build wait can reuse a workflow's fixed runner document after sleeping. A busy-to-idle transition is then invisible until overflow or timeout.
Keep the shared document for the first look and request live runner capacity after each existing wait. Injected test readers keep their existing call contract. This extends the first-look policy in #31889 and depends on its shared client option; this PR is stacked on that branch.
Performance
| metric | before | after | delta | harness or run link |
|---|---|---|---|---|
| routing-App runner-list requests/h at 1000 idle first looks/h with fresh state | 0 | 0 | 0 | same document-backed picker entrypoint fixtures |
| routing-App requests/h at 1000 busy control waits/h, capacity idle on first recheck | 0 | 3000 | +3000, intentional live recheck | test_busy_document_is_rechecked_live_after_waiting, one visible group and one-page lists |
| portable/control placement when capacity becomes idle at first recheck | overflow after 180 s | fleet at 30 s | restores fleet placement | busy-document/live-idle entrypoint regressions |
| dedicated build placement when capacity becomes idle at first recheck | no dedicated placement after 60 s | dedicated placement at 30 s | restores dedicated placement | busy-document/live-idle build regression |
The live recheck trades requests for correctness only after capacity was unavailable. No new timer or wait is introduced; existing waits retain their deadlines and cleanup. This table models the named fixture rate, not total installation traffic. No compilation or cache behavior changes.
Observed / Not run
All 38 portable placement, 11 nightly control and 59 nightly build tests pass. The three new busy-document regressions fail at test-only commit 8ec0eddacfff and pass with the fix. git diff --check passes. No application build is needed for these picker reads.
Changelog
none
Agent session: agent session
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes nightly admission waits reusing a workflow's fixed runner document after sleeping, so a busy-to-idle transition no longer stays invisible until overflow or timeout.
Portable placement, nightly control, and the dedicated nightly build picker now keep the shared document only for their first look, then request live runner capacity on each recheck. Runners that become idle during the existing wait window are now found at the first recheck instead of after overflow or timeout, and no new timers or waits are introduced. Injected test readers keep their existing call contract.