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
On reaching threshold (Threshold evaluation and date-sensitive Agent SDK credit meter handling #33): set a waiting-for-usage state in the state store and signal a graceful stop — the current atomic step finishes cleanly and progress is committed before stopping (a known marker, unlike a crash; resume needs no discard — contrast §18.4).
Reset time known: if the last successful read gave a resets_at for the governing meter, sleep until that time plus a small buffer, then resume — no probing.
Reset time unknown: probe with the cheapest possible call (tiny max_tokens, trivial prompt) on the specific exhausted model tier (a Sonnet probe does not prove the Opus weekly reset). 200 → resume; 429 → keep waiting.
Probe interval is exponential backoff: start 5 min, double on each failed probe (5 → 10 → 20 → 40), cap 30 min, reset to 5 min on success.
Implement the hard pause and automatic resume: the floor of the usage-control model.
Spec: §6.3 (hard pause — finish atomic step, commit, stop), §6.4 (Pause and resume —
two-tier reset detection, resume point).
Acceptance criteria
waiting-for-usagestate in the state store and signal a graceful stop — the current atomic step finishes cleanly and progress is committed before stopping (a known marker, unlike a crash; resume needs no discard — contrast §18.4).resets_atfor the governing meter, sleep until that time plus a small buffer, then resume — no probing.max_tokens, trivial prompt) on the specific exhausted model tier (a Sonnet probe does not prove the Opus weekly reset). 200 → resume; 429 → keep waiting.Depends on: #30
Depends on: #3
Depends on: #24
Depends on: #17