Answer the second round: the judge's reset is text, one-line limit messages, plainer docstring

This commit is contained in:
2026-10-02 22:52:16 +02:00
parent 5a481d3ebf
commit b37b2e91f7
5 changed files with 10 additions and 7 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
## Unreleased
- `loop-claude` waits out a usage limit and retries, without counting it as a failure: 2 minutes past the reset, or every 10 minutes when claude names none. It prints what claude said about the limit and when the next try is due.
- `loop-claude` waits out a usage limit and retries, without counting it as a failure: 2 minutes past the reset, or every 10 minutes when the reset time is unknown. It prints what claude said about the limit and when the next try is due.
- Install the `claude-security` plugin (README → Install): larv-review's full security scan now runs once you confirm its cost; an unattended larv-review reports the scan as not run. `settings.json` silences the plugin's scan tip after `git push`.
- systems-architect and product-owner-reviewer can no longer edit what they review; stability-reviewer keeps its shell to run tests, and loses Claude Code's file-editing tools.
- Every project's `todo.md` takes one shape, and larv-review's gate checks it: one table of items, each scored by the formula and goal weights the file states and held to its bar, an item under the bar dropped unless its Exempt cell says why. `bin/rank_todo.py` ranks the table, and `rank_todo.py --help` shows a valid file.
+2 -1
View File
@@ -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, ...}}
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
+4 -2
View File
@@ -270,9 +270,11 @@ class Limits(unittest.TestCase):
rejected = [{"type": "rate_limit_event", "rate_limit_info": {"status": "rejected", "resetsAt": resets_at}} for resets_at in (NOW + 60, NOW + 600)]
allowed = {"type": "rate_limit_event", "rate_limit_info": {"status": "allowed", "resetsAt": NOW + 9000}}
limited = {"type": "result", "api_error_status": 429, "result": "You've hit your session limit"}
fake = FakeEffects(streams=[Streamed(1, rejected[1], allowed, rejected[0], limited), Streamed(1, {"type": "result", "api_error_status": 429}), Streamed(0, rejected[0], {"type": "result"})])
fake = FakeEffects(streams=[Streamed(1, rejected[1], allowed, rejected[0], limited), Streamed(1, {"type": "result", "api_error_status": 429}), Streamed(1, {"type": "result", "api_error_status": 429, "result": " \n"}), Streamed(1, {"type": "result", "api_error_status": 429, "result": "limit\n resets 7pm"}), Streamed(0, rejected[0], {"type": "result"})])
self.assertEqual(worker.run_worker("/r", [], fake.effects()), Limited(NOW + 600, "You've hit your session limit"))
self.assertEqual(worker.run_worker("/r", [], fake.effects()), Limited(None, "claude said nothing more"))
self.assertEqual(worker.run_worker("/r", [], fake.effects()), Limited(None, "claude gave no message"))
self.assertEqual(worker.run_worker("/r", [], fake.effects()), Limited(None, "claude gave no message"))
self.assertEqual(worker.run_worker("/r", [], fake.effects()), Limited(None, "limit resets 7pm"))
self.assertIsNone(worker.run_worker("/r", [], fake.effects()))
def test_the_judge_reports_a_limit_whatever_its_exit_code(self):