Answer the second round: the judge's reset is text, one-line limit messages, plainer docstring
This commit is contained in:
@@ -95,7 +95,8 @@ def hit_limit(event: dict) -> bool:
|
||||
|
||||
|
||||
def limit_said(event: dict) -> str:
|
||||
return result if isinstance(result := event.get("result"), str) else "claude said nothing more"
|
||||
said = " ".join(result.split()) if isinstance(result := event.get("result"), str) else ""
|
||||
return said or "claude gave no message"
|
||||
|
||||
|
||||
# {"type": "rate_limit_event", "rate_limit_info": {"status": "rejected", "resetsAt": 1790790000, ...}}
|
||||
|
||||
@@ -9,6 +9,6 @@ class Failure:
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Limited:
|
||||
"""claude hit a usage limit and said so; resets_at is when the limit resets, in seconds since the epoch, or None when claude did not say."""
|
||||
"""claude hit a usage limit; said is claude's message about it, and resets_at is when the limit resets, in seconds since the epoch, or None when unknown."""
|
||||
resets_at: int | None
|
||||
said: str
|
||||
|
||||
@@ -47,8 +47,8 @@ Exit 1, saying why, when:
|
||||
a judge when claude cannot start or exits non-zero, or its reply misses or mistypes a field,
|
||||
interrupts without a question, or quotes a line the transcript does not hold. A usage limit is
|
||||
not a failure: the worker or the judge is retried 2 minutes after the limit resets, or every 10
|
||||
minutes while claude names no future reset time. The judge's reply never names one. stderr says
|
||||
when the next try is due.
|
||||
minutes when the reset time is unknown or past. The judge's reply gives its reset time only as
|
||||
text, so the judge is always retried every 10 minutes. stderr says when the next try is due.
|
||||
|
||||
Exit 2, when the human is needed and cannot answer:
|
||||
- stdin or stdout is not a terminal, when a model must be picked or an interrupt answered
|
||||
|
||||
Reference in New Issue
Block a user