diff --git a/focus_project/.pre-commit-config.yaml b/focus_project/.pre-commit-config.yaml index 3d056ee..c1c0547 100644 --- a/focus_project/.pre-commit-config.yaml +++ b/focus_project/.pre-commit-config.yaml @@ -117,7 +117,7 @@ repos: # Kept in step with pyproject.toml, so pylint resolves the crdt_sync # imports instead of scoring every one of them as import-error. - crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.11.1#subdirectory=crdt-sync - - earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.23.0#subdirectory=earned_time + - earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.24.0#subdirectory=earned_time - repo: https://github.com/PyCQA/bandit rev: 1.9.4 diff --git a/focus_project/pyproject.toml b/focus_project/pyproject.toml index 7bec286..988745e 100644 --- a/focus_project/pyproject.toml +++ b/focus_project/pyproject.toml @@ -8,7 +8,7 @@ version = "0.10.0" description = "Time-boxed focus projects: replace chosen gates, pay a daily-minutes gate" requires-python = ">=3.14" # Stdlib only on purpose: guards import it from the system python. -dependencies = ["earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.23.0#subdirectory=earned_time"] +dependencies = ["earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.24.0#subdirectory=earned_time"] [tool.setuptools.packages.find] include = ["focus_project*"] diff --git a/focus_project/requirements.txt b/focus_project/requirements.txt index 94b0713..832ef7b 100644 --- a/focus_project/requirements.txt +++ b/focus_project/requirements.txt @@ -2,7 +2,7 @@ # floor is satisfied by anything newer, so it tells a checker nothing # about whether this repo is actually current. bandit[toml]==1.9.4 -earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.23.0#subdirectory=earned_time +earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.24.0#subdirectory=earned_time mypy==2.4.1 pre-commit==4.7.0 pylint==4.1.4 diff --git a/leetcode_coach/leetcode_coach/claude_cli.py b/leetcode_coach/leetcode_coach/claude_cli.py index ca7a945..a12433c 100644 --- a/leetcode_coach/leetcode_coach/claude_cli.py +++ b/leetcode_coach/leetcode_coach/claude_cli.py @@ -8,6 +8,7 @@ checker treats it as "haiku did not answer" and falls back. The signal for a spent plan is the synthetic reply "You've hit your session limit · resets 3pm (Europe/Warsaw)" (error rate_limit, HTTP 429), as recorded in real transcripts on 2026-09-26. +Claude Code's banners ("5-hour limit reached", "Weekly limit reached") count too. """ from __future__ import annotations @@ -23,7 +24,11 @@ from typing import Any _LOG = logging.getLogger(__name__) -LIMIT_RE = re.compile(r"hit your (?:\w+ )?limit|usage limit reached", re.IGNORECASE) +LIMIT_RE = re.compile( + r"hit your (?:\w+ )?limit" + r"|(?:usage|session|weekly|daily|opus|sonnet|\d+-hour) limit reached", + re.IGNORECASE, +) RATE_LIMIT_STATUS = 429 diff --git a/leetcode_coach/leetcode_coach/tests/test_leetcode_repl.py b/leetcode_coach/leetcode_coach/tests/test_leetcode_repl.py index 05c256d..7c218d2 100644 --- a/leetcode_coach/leetcode_coach/tests/test_leetcode_repl.py +++ b/leetcode_coach/leetcode_coach/tests/test_leetcode_repl.py @@ -24,6 +24,10 @@ LAUNCHER = Path(leetcode_repl.__file__).with_name("leetcode") ({"result": "You\u2019ve hit your weekly limit · resets Mon"}, True), ({"result": "", "api_error_status": 429}, True), ({"result": "x", "_stderr": "Claude AI usage limit reached|1790427600"}, True), + ({"result": "5-hour limit reached ∙ resets 2am"}, True), + ({"result": "Weekly limit reached ∙ resets Mon 9am"}, True), + ({"result": "Opus weekly limit reached"}, True), + ({"result": "Python's recursion limit reached 1000 frames"}, False), ({"result": "Does your loop hit every element?"}, False), ], ) diff --git a/rtdb_relay/pyproject.toml b/rtdb_relay/pyproject.toml index 86af03d..baf73dc 100644 --- a/rtdb_relay/pyproject.toml +++ b/rtdb_relay/pyproject.toml @@ -5,7 +5,7 @@ description = "Sealed request relay over Firebase RTDB: PC worker (Python) + Flu requires-python = ">=3.14" dependencies = [ "crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.11.1#subdirectory=crdt-sync", - "httpx==0.28.1", + "httpx==0.29.0", ] # Ship the library and its tests (consumers run the contract vectors).