Repository navigation
fix(token_budget_guard): stricter of 5h/7d window binds - #14
Merged
Merged
Conversation
The guard read seven_day only when five_hour was missing. On 2026-10-13 a fresh 5h window (0 %) lifted a manual notaus while the weekly quota stood at 97 %. Now the higher used percentage of both windows decides, with its own resets_at. Regression test: notaus stays with 5h 0 % / 7d 97 % (fails on the old guard, passes now); suite green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FMTv7ecoTBXem1ndYqUtxj
|
Welcome! 👋 Thanks for your first pull request in this repository. A maintainer will review it soon. Please make sure:
Thanks for contributing! |
User rule (2026-10-13): after the 5h window resets, the week decides. More than 10 % of the week left ends sparmodus and notaus; 3-10 % left keeps the sparmodus but lifts the notaus; 3 % or less keeps the notaus. Each window is staged against its own thresholds (new config key thresholds_seven_day, defaults sparmodus 90 / notaus 97 % used), the stricter stage binds, and messages name the binding window. A notaus is now lifted as soon as no window demands it; stage 2 keeps at least the sparmodus. Parametrized tests cover all three bands; suite green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FMTv7ecoTBXem1ndYqUtxj
Member
Author
|
Cloud-Bot-Review (Zweitmodell): ✅ freigabefähig
Generated by Claude Code |
lukisch
commented
Oct 13, 2026
lukisch
left a comment
Member
Author
There was a problem hiding this comment.
Zweitmodell-Review (Freigabe empfohlen): Beide Fenster (5h/7d) werden gegen eigene Schwellen gestuft, die strengere Stufe bindet; Notaus-Recovery bei Stufe 2 fällt auf mindestens manual-spar zurück. Parametrisierte Tests decken die Grenzfälle ab, CI (12 Jobs) grün. Nit: import pytest mitten in der Testdatei nach oben ziehen.
Generated by Claude Code
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.
The guard used seven_day only as a fallback when five_hour was missing, so a fresh 5h window lifted a notaus while the weekly quota was at 97 % (2026-10-13). Now the higher used percentage of both windows decides. Regression test included (fails on old guard), full suite green. Needs second-model review per two-model rule.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FMTv7ecoTBXem1ndYqUtxj