Repository navigation
fix(dream): keep the served verify hold funded after a main turn overshoots - #24193
Merged
Merged
Conversation
…the pass Prod readback 10-31 (rev 14d7e31): the served hold was spent by main turns that cost more than their pre-call estimate (cache misses on 1.3-2.2M-token passes), so verification still refused with dream_input_token_budget (60 unverified in 5.8 h, about 248/day vs 252 before). Give the verify lane an allowance equal to the staged items' two-call reserve past what the pass has left. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The value judge and the state pass share the verify lane; clear the allowance when verification returns so it never funds them (Luna review R1). 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. |
Git-on-my-level
added a commit
that referenced
this pull request
Nov 1, 2026
…not starve the second (#24209) ## Why #24193 gives Dream's second check (the verifier) its own allowance after a main turn overspends the pass budget. Readback after it went live (revision `908206a`, ro-prod `dream_pass` lines, 11-01 02:10–03:23Z): - The allowance was granted on 11 of 33 passes and helped on some of them. At 02:21Z it got 3 `dismiss_person` edits verified on a pass that had gone over budget. - 12 edits on two over-budget passes were still unverified (`budget_tokens`). On those, the first verifier call cost more than the reserve's per-call estimate, and the second call was refused. ## What - **Allowance doubled.** On a served hold (the default), the allowance is now twice the staged items' two-call reserve (`VERIFY_ALLOWANCE_FACTOR = 2`). The allowance is a cap, so only what the calls actually spend is charged. - **Cap fixed for large reserves.** `verify_need` also takes the doubled reserve on a served hold. Before this, the 192k evidence floor capped a reserve above 96k. - **Calibration telemetry.** - `levers.verify_hold.owed` records the reserve. - `levers.verify_hold.verify_used` records what the verifier actually spent, on both the two-verifier path and the chain path, and 0 when no verifier ran. - Together these let the next readback tune the factor from data. ## Spend - Everything stays on the gemini-3.8-flash reservation. Dream is reserved-only, so this adds no vendor spend. - The extra budget only goes to verifying edits that are already staged. - On an over-budget pass, the verifier may be granted up to the overspend plus 2× reserve. - Spend is checked after each call returns, the same way the main loop checks its own budget, so the last call can go a bit past what was granted. Nothing caps this on the provider side. ## Rollout - No new flag. The existing kill switch `DREAM_VERIFY_HOLD_MODE=shadow` (or `off`) removes the hold, the allowance and the doubling. - Metric that must stay clean: `verify_reasons.budget_tokens` per day should fall from ~250/day (10-31) toward 0, with no rise in failed passes or in `dream_lever_error lever=verify_hold` errors. - The Dream owner reads back after the train and sets the factor from `verify_used / owed`. ## Tests - New tests in `backend/tests/unit/test_dream_verify_hold.py`. Each one fails when its fix is reverted: - a first verifier call that costs 9k against a 9.8k reserve no longer starves the second call; - a 150k reserve is still offered at 300k. - All 46 `tests/unit/test_dream*.py` files pass via `test.sh` under `omi-heavy`. - Luna R1 BLOCK found the cap, the chain-path spend and the no-verifier case. All three are fixed in f7d13a3. Failure-Class: none Line-Count-Exception: backend/utils/dream_agent.py | 1598 -> 1606 | the allowance factor and its calibration fields sit with the verify hold they size; splitting the pass loop is out of scope for this fix 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/24209?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/24209?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F24209&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
YinkaAdepoju
pushed a commit
to YinkaAdepoju/omi
that referenced
this pull request
Nov 1, 2026
…not starve the second Readback after BasedHardware#24193 (rev 908206a, 02:10-03:23Z 11-01): the allowance rescued overshot passes (02:21Z, 3 edits verified), but 12 edits on two passes were still unverified: the first verifier call spent past the reserve's estimate and the second was refused. Pay the reserve twice (only spend is charged) and log the reserve (owed) and the verifier's spend (verify_used) to calibrate the factor. 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.
Why
#24166 (verify hold, live since the 10-31 15:11Z train, revision
*-14d7e31-*) was meant to stop staged Dream edits from being dropped unverified when a pass runs out of budget. A prod readback shows it doesn't (ro-prod,dream_passlines on backend-sync, 10-31 15:30–21:18Z):budget_tokens, and most of those come from passes withverifier_calls 0.dream_input_token_budget.What
DREAM_VERIFY_HOLD_MODE=serve, already the default) gives the main verification call an allowance: the staged items' two-call reserve, minus whatever budget the pass still has. Bothinvoke_once's remaining budget andverify_budgetuse it, so batch sizing matches what the calls can afford.dream_verify.verifycall. It is cleared infinally, so the value judge and the shadow state pass, which share the verify lane, never draw on it.levers.verify_hold.allowancerecords the allowance granted on each pass.Spend
Everything stays on the gemini-3.8-flash reservation; Dream is reserved-only, so there is no new vendor spend. A pass can now go over its token limit by the overshoot already spent plus one two-call reserve for its staged items: 33–80k weighted in the readback, about 3–8% of a heavy pass. That is the same verification #24166 meant to pay for. The judge and state-pass allowances are unchanged.
Rollout
DREAM_VERIFY_HOLD_MODE=shadoworoffremoves both the hold and the allowance.verify_reasons.budget_tokens). It should fall well below 252/day, with no rise infailedpasses ordream_lever_error lever=verify_hold.Tests
backend/tests/unit/test_dream_verify_hold.py:finallyremoved (mutation-checked).tests/unit/test_dream*.pyfiles pass throughtest.shunderomi-heavy.Failure-Class: none
Line-Count-Exception: backend/utils/dream_agent.py | 1586 -> 1598 | the verify-lane allowance lives beside the hold and judge/state allowances it must stay scoped against; splitting the pass loop is out of scope for a one-bug fix
🤖 Generated with Claude Code