Answer the first round: one clock read, the limit's message and time zone on stderr, plainer help and comments

This commit is contained in:
2026-10-02 22:49:39 +02:00
parent e7ff869398
commit 5a481d3ebf
9 changed files with 36 additions and 27 deletions
+4
View File
@@ -94,6 +94,10 @@ def hit_limit(event: dict) -> bool:
return ends_stream(event) and event.get("api_error_status") == 429
def limit_said(event: dict) -> str:
return result if isinstance(result := event.get("result"), str) else "claude said nothing more"
# {"type": "rate_limit_event", "rate_limit_info": {"status": "rejected", "resetsAt": 1790790000, ...}}
def rejected_until(event: dict) -> int | None:
"""When a usage limit that rejected the request resets, in seconds since the epoch."""