Commit Graph

6 Commits

Author SHA1 Message Date
Teknium
5fd5f8b73a fix(usage-window): a model of unknown tier is never promised the earlier reset
Greptile: "Large models retry too early". With a Large model and both the
daily and Large-model allowances full, an expired (300 s) or cold catalog
made current_model_is_top_tier answer False, so _stop_gauge took the daily
gauge and the refusal text, retry time and pool bench promised the daily
reset while the model stays refused until the later Large reset.

current_model_is_top_tier now returns None when the cached catalog has no
row for the model. The stop gauge (and limit_hit, so the card agrees)
counts a full top-tier allowance for an unknown tier, so of the full
allowances that could stop the model the later reset wins. A model the
catalog marks regular keeps the e3fff39 day reset; that test now stamps
its model as a regular catalog row instead of relying on an empty catalog.
2026-10-22 14:34:55 -07:00
Teknium
e65dc92681 fix(usage-window): suggest free models from this profile's own Portal
Greptile: "Suggestions use another Portal's cache". _portal_free_models took
the last nonempty entry of the whole recommended-models cache, which is
keyed by (profile, Portal), so a process serving several profiles could
put another profile's free pick on a limit card. Read the caller's own
(profile, Portal) entry, else that Portal's disk copy in this profile's home.
2026-10-22 13:50:10 -07:00
Teknium
e3fff39ec7 fix(usage-window): name the allowance that stopped this model
Greptile: "Regular models get monthly resets". A full Large-model allowance
won the limit line, retry time and pool bench even when the refused model
is not top tier and its daily allowance is also full, so the line said
"monthly large-model limit · resets in 30 days" while limit_hit (the card)
said "daily". The stop line, window_stop_resets_at_ms and the pool's
reset_at now take the gauge from plan_limits.blocking_gauge with the
model's top-tier mark, the same rule limit_hit reads; a refusal no
all-scope allowance explains still falls back to the top-tier one.
2026-10-22 13:50:10 -07:00
rob-maron
cafa03f7f4 PR review comments 2026-10-21 23:05:11 -04:00
rob-maron
0e29e8a25a fix tests 2026-10-20 22:18:49 -04:00
rob-maron
15307dece7 Usage-window plan support 2026-10-20 21:04:30 -04:00