Open every line loop-claude prints with the machine's local time
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import sys
|
||||
import typing
|
||||
|
||||
from loop_claude.effects import Effects
|
||||
from failure import Failure
|
||||
from claude_code.reply import Limited
|
||||
from loop_claude.terminal import say
|
||||
from loop_claude.stop import Stop
|
||||
|
||||
T = typing.TypeVar("T")
|
||||
@@ -24,7 +24,7 @@ def retried(who: str, attempt: typing.Callable[[], T | Failure | Limited], effec
|
||||
failures = 0
|
||||
now = effects.now()
|
||||
wait = limit_wait(result, now)
|
||||
print(f"the {who} hit a usage limit ({result.said}); retrying at {effects.local_time(now + wait)}", file=sys.stderr, flush=True)
|
||||
say(f"the {who} hit a usage limit ({result.said}); retrying at {effects.local_time(now + wait)}", effects)
|
||||
effects.sleep(wait)
|
||||
continue
|
||||
if not isinstance(result, Failure):
|
||||
@@ -34,7 +34,7 @@ def retried(who: str, attempt: typing.Callable[[], T | Failure | Limited], effec
|
||||
failures += 1
|
||||
if failures == FAILURES_RUNNING:
|
||||
return Stop(1, f"the {who} failed three times running: {result.reason}")
|
||||
print(f"retrying the {who} in a minute: {result.reason}", file=sys.stderr)
|
||||
say(f"retrying the {who} in a minute: {result.reason}", effects)
|
||||
effects.sleep(RETRY_DELAY)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user