Repository navigation
Fix quota learning re-anchors and stale session checks - #16
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens Codexometer’s quota-learning and session-attention behavior to avoid false “learning reset” events and stale CHECK SESSION signals in grouped sessions, while also making local API-EQ accounting monotonic when daemon model resolution is pending.
Changes:
- Refines API-EQ quota learning to preserve clean movement across reset-time revisions, re-anchor only on validated discontinuities/resets, and surface persistent
RESTARTED: ...reasons instead of silently dropping to0/5PP. - Separates pending daemon model-resolution calls from finalized priced/unpriced totals and defers quota observations while accounting is pending or changes during the quota request bracket.
- Suppresses inferred
CHECK SESSIONat the grouped-root level when any linked agent shows fresh activity or an exact “working” daemon status; updates docs and bumps version tov0.7.4.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the updated estimator semantics, attention suppression rules, and bumps the documented version to v0.7.4. |
| main_test.go | Updates version expectations and includes pending-call equality in demo accounting comparisons. |
| internal/version/version.go | Bumps maintained fallback source version to 0.7.4. |
| internal/version/version_test.go | Updates fallback version test to expect 0.7.4. |
| internal/ui/quota_api_eq.go | Implements re-anchoring/restart-reason logic, preserves earliest reset boundaries, and includes pending-call counters in observation stability. |
| internal/ui/quota_api_eq_test.go | Adds coverage for reset-time revisions/inactivity, boundary passing, accounting rebases, and pending-call deferral behavior. |
| internal/ui/model.go | Defers quota observations when pending accounting exists (even if counters are stable). |
| internal/ui/model_test.go | Adds test ensuring pending-call presence forces observation deferral. |
| internal/codex/live_usage.go | Tracks pending daemon model resolutions separately, finalizes accounting monotonicly, and improves grouped CHECK SESSION suppression based on fresh activity/exact working status. |
| internal/codex/live_usage_test.go | Adds tests for grouped attention suppression and pending daemon reroute accounting behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
API-EQ learning could unexpectedly fall from accumulated clean movement to zero when the backend revised a future rolling-window reset timestamp or when shared-daemon model resolution retroactively changed accounting counters. Separately, a quiet overnight child rollout could contribute CHECK SESSION to an otherwise freshly active grouped root.
What changed
Verification
Regression coverage includes reset-time revisions, true reset boundaries, accounting rebases, pending reroute accounting, long inactivity without quota movement, and an overnight grouped child whose root resumes activity.