Repository navigation
Dream: recheck reserved capacity before giving up the sweep; hold paid ramp at 0% - #23041
Merged
Merged
Conversation
With on-demand off, drain() gates every hourly sweep on one available_model(mode='reserved') call. When the 3.8 evidence is older than DREAM_RESERVATION_FRESH_SECONDS, that call starts the probe that would refresh it but answers no_states immediately, so the sweep records waiting and no owner runs for an hour (prod 2026-10-21 12:00Z: candidates=1 waiting=1 no_states). Recheck up to 4 times, 30s apart, before reporting reserved_capacity. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Manifest follow-up to the live DREAM_AGENT_PAID_PERCENT=0 rollback, so trains stop re-applying 5. The listed owner stays eligible. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #23016, which moved Dream onto the 3.8 reservation with on-demand off. It is live in f162bdb.
dream_agent.drain()now gates every hourly sweep on a singledream_capacity.available_model(mode='reserved')call. When the shared 3.8 evidence is older thanDREAM_RESERVATION_FRESH_SECONDS(15 min), that call:no_statesstraight away.So the sweep records
waitingand gives up, and no owner runs for the hour.In prod, the 12:00Z sweep on 2026-10-21 logged
Dream sweep candidates=1 ... waiting=1withdream_capacity_decision reason=no_states, and no pass ran. Before #23016 the allowlisted owner ran on-demand, which skipped this gate, so the gap never showed.Fix: when the first check is closed, recheck up to 4 times, 30 s apart, before reporting
reserved_capacity. That is at most 2 minutes, well insideDRAIN_TIMEOUT_SECONDS. Per-passrun_passadmission is unchanged: its worker already retrieswaitingevery 60 s.Also: hold the paid ramp at 0%. At 13:00Z the first 5% sweep failed about 17 cohort passes within seconds (
error_type=other, applied=0, no on-demand spend). That breaks the ramp's clean metric (<2 failed/h). The rollout lead setDREAM_AGENT_PAID_PERCENT=0live, and this commit sets'0'in the prod overlay so trains don't re-apply 5. The listed owner stays eligible. The failure cause is being diagnosed separately; the ramp resumes only after it is fixed.Tests
backend/test.shwithBACKEND_UNIT_TEST_FILE_LIST, under nice/taskpolicy with 2 workers:All passed. New:
test_sweep_rechecks_after_stale_evidence_before_giving_up, which opens on the third check and fails on main. The existing closed-sweep test now asserts 1 + 4 checks. These results are unit level only.Live check after deploy: hourly sweeps show
completeorwaitingper owner instead of a sweep-levelreserved_capacitywait, and owner passes resume.Review
GLM-5.3 (zcode) returned SHIP-WITH-NITS. It confirmed:
asyncio.timeout(1680), the 1710 s middleware limit and the 1740 s Scheduler deadline, with no retries and no overlap;Nits, accepted as is:
waiting;deadlinewith TTL fences, as designed.Product invariants affected
Matched only because
backend/deploy/runtime_env.yamlchanged (the Dream paid percent). Memory intake and promotion are unchanged.Failure class
Failure-Class: none
🤖 Generated with Claude Code