fix(quota): review fixes for #1229 — per-run guard cushion, Settings default, stale comments - #1239
Merged
brillout merged 2 commits intoJul 26, 2026
Conversation
Edit) The continuous boundary starts the week at zero, so the offset-less per-run guard paused the user's own first run of the week the moment the agent reported its first whole percent of usage — the stepped line it replaced had always kept at least the current day's seventh in hand. The guard now carries the same half-day cushion unattended work gets by default (a fixed one, deliberately not the auto-spend slider: holding unattended work back must never tighten the gate on work the user asked for), and the changeset no longer claims the continuous boundary left the guard untouched. Also rounds quotaHeadroom's refusal reason to one decimal (the half-day default is 100/14, and fifteen digits of it said less), and corrects the week fixtures' '5 days 19 hours' comments — the gap is 4 days 19 hours. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019H7kazhsBn6Roz3xd5xdv3
…pped-boundary comments (#960 Edit) The Settings page's 'Spend offset' box still fell back to 0 when the preference was unset, showing a value the daemon no longer uses now that the real default is the half-day cushion — it reads the shared default (to one decimal; saved values are integers, so the rounding only ever trims the default). Also updates the comments that still explained thresholds by 'the boundary steps a day at a time', which stopped being true when the boundary went continuous, and RoutineWork's pointer at the usage panel's removed autoPm toggle. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019H7kazhsBn6Roz3xd5xdv3
5 tasks
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
Review fixes for #1229, targeting its branch so they land inside that PR when merged.
1. The continuous boundary silently tightened the gate on the user's own runs (real regression).
startConsumptionGuard— the per-run gate every non-transparent CLI run starts — callsquotaBoundaryStatuswith nolimitOffset, so its stop line was the raw continuous boundary. The steppedday/7line it replaced always kept at least the current day's seventh in hand (14.3 points at day start); the continuous line starts the week at zero, so half an hour into a fresh week, the first whole percent the agent reports outruns it and the user's own session is paused ("Quota boundary reached — pausing the session"). Reproduced against the branch:percentUsed 1% >= boundary 0.3%→ paused, where main's stepped gate (14.29%) carried on. It also inverted the PR's own philosophy — unattended work got the half-day cushion while user-asked work got none, letting auto PM spend past the point where user runs pause. The guard now carries the same fixed half-day cushion (DEFAULT_SPEND_OFFSET), deliberately not the user's slider: the slider sets where unattended work stands down, and holding it back must never tighten the gate on work the user asked for. Thequota-boundary-continuouschangeset claimed the change was "purely a change to what auto PM and the panel treat as 'on pace'" — the guard was measuring against the same line; the changeset now says so.2. Settings showed a spend-offset the daemon isn't using. The Settings page's "Spend offset" box still fell back to
0when the preference is unset, while the limit actually in force is now the half-day default (+7.1). It now shows the shared default, rounded to one decimal (saved values are integers, so the rounding only ever trims the default).3.
quotaHeadroom's refusal reason printed the raw double. With the fractional default in force it read(+7.142857142857143 on the week's 32%); now(+7.1 …).4. Stale comments from the stepped era. The eager-consumption threshold in
Quota.tsx,ONE_DAY_PERCENTinquota-bar.ts, and thequotaTonetest all still justified themselves with "the boundary steps a day at a time", which the final commit of #1229 made untrue; RoutineWork's comment still pointed at the usage panel's removedautoPmtoggle. Also corrected the test fixtures' "resets in 5 days 19 hours" comments — the fixture's gap (Jul 20 12:00 → Jul 25 07:00 UTC) is 4 days 19 hours (the ~31.5% figure beside it was already right).Test plan
quotaHeadroomtest pinning the one-decimal offset in the refusal reasontsc --noEmitcleanGenerated by Claude Code