Wait out a usage limit and retry, without counting it as a failed run

This commit is contained in:
2026-10-02 22:45:27 +02:00
parent 796d7d4901
commit e7ff869398
11 changed files with 106 additions and 23 deletions
+2
View File
@@ -21,6 +21,7 @@ class Effects:
execv: typing.Callable[[str, list[str]], None]
git: typing.Callable[[list[str], str], subprocess.CompletedProcess[str]]
input: typing.Callable[[str], str]
now: typing.Callable[[], float]
on_terminal: typing.Callable[[], bool]
python: typing.Callable[[list[str]], subprocess.CompletedProcess[str]]
sleep: typing.Callable[[float], None]
@@ -46,6 +47,7 @@ def system_effects() -> Effects:
execv=os.execv,
git=lambda args, cwd: subprocess.run(["git", *args], capture_output=True, cwd=cwd, text=True),
input=input,
now=time.time,
on_terminal=lambda: sys.stdin.isatty() and sys.stdout.isatty(),
python=lambda args: subprocess.run([sys.executable, *args], capture_output=True, text=True),
sleep=time.sleep,