You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ecb4011
Browse filesBrowse the repository at this point in the historyBrowse files
Warn at startup when Albert daily quota is likely exhausted
Two complementary signals, surfaced as a single WarningMessage banner
when the TUI mounts:
- Persistent state: when the server returns a daily-quota 429 (rpd/tpd),
write the model name, reason, body excerpt and UTC timestamp to
~/.albert-code/throttle_state.json. On the next launch the file is
re-read and shown as a warning, with automatic decay at the next
midnight UTC reset. Cleared on a successful call against the same
model.
- Live estimate: fetch /v1/me/usage on startup, sum prompt_tokens since
midnight UTC for the active model, compare to the documented EXP TPD
(DOCUMENTED_MODEL_LIMITS). Warn at >= 80%, hard-warn at >= 95%. Best
effort: /me/usage only returns the last N events so the estimate is a
lower bound.
Threading: model.name is now passed alongside model.alias from
complete()/complete_streaming() down to _handle_429 so the persisted
event records the full model identifier (matches what /v1/models and
DOCUMENTED_MODEL_LIMITS expect).
New file albert_code/core/llm/quota_state.py with save/load/clear
helpers. THROTTLE_STATE_FILE added to global_paths.py.
0 commit comments