Skip to content

fix(quota): review fixes for #1229 — per-run guard cushion, Settings default, stale comments - #1239

Merged
brillout merged 2 commits into
claude/framework-issue-960-psx76qfrom
claude/pr-1229-review-fixes-x3qhf7
Jul 26, 2026
Merged

fix(quota): review fixes for #1229 — per-run guard cushion, Settings default, stale comments#1239
brillout merged 2 commits into
claude/framework-issue-960-psx76qfrom
claude/pr-1229-review-fixes-x3qhf7

Conversation

@brillout

Copy link
Copy Markdown
Member

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 — calls quotaBoundaryStatus with no limitOffset, so its stop line was the raw continuous boundary. The stepped day/7 line 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. The quota-boundary-continuous changeset 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 0 when 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_PERCENT in quota-bar.ts, and the quotaTone test 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 removed autoPm toggle. 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

  • New guard test: half an hour into a fresh week, 1% used no longer pauses the run; 9% (past the cushion) still does
  • New quotaHeadroom test pinning the one-decimal offset in the refusal reason
  • Framework quota tests 79/79; full suite matches the branch's known baseline (only the 10 environmental daemon/serve failures + the pre-existing ticket-format spec failure already diagnosed on the base)
  • Dashboard suite 550/550, tsc --noEmit clean

Generated by Claude Code

claude added 2 commits July 26, 2026 19:48
 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
@brillout
brillout merged commit 5391c82 into claude/framework-issue-960-psx76q Jul 26, 2026
1 check failed
@brillout
brillout deleted the claude/pr-1229-review-fixes-x3qhf7 branch July 26, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants