@oneciel-ai/claude-any 0.1.42 → 0.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/claude_any.py +36 -15
- package/docs/README.ja.md +6 -1
- package/docs/README.ko.md +6 -1
- package/docs/README.zh.md +6 -1
- package/docs/manual.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ arguments through unchanged.
|
|
|
48
48
|
|
|
49
49
|
Credits: One Ciel LLC
|
|
50
50
|
|
|
51
|
-
Current version: `0.1.
|
|
51
|
+
Current version: `0.1.43`
|
|
52
52
|
|
|
53
53
|
## Why This Exists
|
|
54
54
|
|
|
@@ -381,6 +381,12 @@ steps under that larger model's supervision.
|
|
|
381
381
|
|
|
382
382
|
## Changelog
|
|
383
383
|
|
|
384
|
+
### 0.1.43
|
|
385
|
+
|
|
386
|
+
- **429 backoff retry**: upstream `429 Too Many Requests` responses are now
|
|
387
|
+
handled as retry/backoff events across all retry attempts instead of leaking
|
|
388
|
+
the raw upstream error after the first backoff.
|
|
389
|
+
|
|
384
390
|
### 0.1.42
|
|
385
391
|
|
|
386
392
|
- **Live stream progress**: the statusline now updates streamed upstream output
|
package/claude_any.py
CHANGED
|
@@ -85,7 +85,7 @@ PROVIDER_LABELS = {
|
|
|
85
85
|
"self-hosted-nim": "Self Hosted NIM",
|
|
86
86
|
}
|
|
87
87
|
APP_NAME = "Claude Any"
|
|
88
|
-
VERSION = "0.1.
|
|
88
|
+
VERSION = "0.1.43"
|
|
89
89
|
CREDITS = "Credits: One Ciel LLC"
|
|
90
90
|
|
|
91
91
|
LOG_LEVELS = {"SILENT": 0, "ERROR": 1, "WARN": 2, "INFO": 3, "DEBUG": 4, "TRACE": 5}
|
|
@@ -4971,19 +4971,30 @@ def upstream_http_error_message(exc: urllib.error.HTTPError, raw: str | None = N
|
|
|
4971
4971
|
UPSTREAM_RETRY_HTTP_CODES: frozenset[int] = frozenset({502, 503, 504})
|
|
4972
4972
|
|
|
4973
4973
|
|
|
4974
|
-
def upstream_retry_message(attempt: int, total: int) -> str:
|
|
4975
|
-
lang = str(load_config().get("language") or "en")
|
|
4976
|
-
if lang == "ko":
|
|
4977
|
-
return f"서버가 응답하지 않아 재시도합니다 ({attempt}/{total})."
|
|
4974
|
+
def upstream_retry_message(attempt: int, total: int) -> str:
|
|
4975
|
+
lang = str(load_config().get("language") or "en")
|
|
4976
|
+
if lang == "ko":
|
|
4977
|
+
return f"서버가 응답하지 않아 재시도합니다 ({attempt}/{total})."
|
|
4978
4978
|
if lang == "ja":
|
|
4979
4979
|
return f"サーバーが応答しないため再試行します ({attempt}/{total})。"
|
|
4980
4980
|
if lang == "zh":
|
|
4981
4981
|
return f"服务器未响应,正在重试 ({attempt}/{total})。"
|
|
4982
|
-
return f"Upstream server did not respond; retrying ({attempt}/{total})."
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
def
|
|
4986
|
-
|
|
4982
|
+
return f"Upstream server did not respond; retrying ({attempt}/{total})."
|
|
4983
|
+
|
|
4984
|
+
|
|
4985
|
+
def upstream_rate_limit_retry_message(attempt: int, total: int) -> str:
|
|
4986
|
+
lang = str(load_config().get("language") or "en")
|
|
4987
|
+
if lang == "ko":
|
|
4988
|
+
return f"Upstream rate limit에 도달해 대기 후 재시도합니다 ({attempt}/{total})."
|
|
4989
|
+
if lang == "ja":
|
|
4990
|
+
return f"Upstream rate limit に達したため、待機して再試行します ({attempt}/{total})。"
|
|
4991
|
+
if lang == "zh":
|
|
4992
|
+
return f"已达到 upstream rate limit,等待后重试 ({attempt}/{total})。"
|
|
4993
|
+
return f"Upstream rate limit reached; waiting before retry ({attempt}/{total})."
|
|
4994
|
+
|
|
4995
|
+
|
|
4996
|
+
def upstream_retry_wait_seconds(attempt: int) -> float:
|
|
4997
|
+
return min(20.0, 2.0 * max(1, attempt))
|
|
4987
4998
|
|
|
4988
4999
|
|
|
4989
5000
|
def retryable_timeout_exception(exc: BaseException) -> bool:
|
|
@@ -5028,10 +5039,15 @@ def post_json_with_rate_retry(
|
|
|
5028
5039
|
except urllib.error.HTTPError as exc:
|
|
5029
5040
|
raw = exc.read().decode("utf-8", errors="ignore")
|
|
5030
5041
|
learn_router_rate_limit_headers(provider, pcfg, model, exc.headers)
|
|
5031
|
-
if exc.code == 429 and attempt
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5042
|
+
if exc.code == 429 and attempt + 1 < max_attempts:
|
|
5043
|
+
retry_no = attempt + 1
|
|
5044
|
+
wait = register_router_rate_limit_backoff(provider, pcfg, model, exc.headers.get("Retry-After"))
|
|
5045
|
+
write_router_activity("retry", provider, model, attempt=retry_no, total=gateway_retries, code=exc.code, wait=wait, tokens=token_estimate, bytes=byte_estimate)
|
|
5046
|
+
router_log("WARN", f"upstream_rate_limit_retry provider={provider} model={model} attempt={retry_no}/{gateway_retries} wait={wait:.2f}s tokens={token_estimate} bytes={byte_estimate}")
|
|
5047
|
+
if retry_notice:
|
|
5048
|
+
retry_notice(upstream_rate_limit_retry_message(retry_no, gateway_retries))
|
|
5049
|
+
time.sleep(wait)
|
|
5050
|
+
continue
|
|
5035
5051
|
if exc.code in UPSTREAM_RETRY_HTTP_CODES and attempt + 1 < max_attempts:
|
|
5036
5052
|
retry_no = attempt + 1
|
|
5037
5053
|
write_router_activity("retry", provider, model, attempt=retry_no, total=gateway_retries, code=exc.code, tokens=token_estimate, bytes=byte_estimate)
|
|
@@ -5092,8 +5108,13 @@ def open_openai_stream_with_rate_retry(
|
|
|
5092
5108
|
except urllib.error.HTTPError as exc:
|
|
5093
5109
|
raw = exc.read().decode("utf-8", errors="ignore")
|
|
5094
5110
|
learn_router_rate_limit_headers(provider, pcfg, model, exc.headers)
|
|
5095
|
-
if exc.code == 429 and attempt
|
|
5111
|
+
if exc.code == 429 and attempt + 1 < max_attempts:
|
|
5112
|
+
retry_no = attempt + 1
|
|
5096
5113
|
wait = register_router_rate_limit_backoff(provider, pcfg, model, exc.headers.get("Retry-After"))
|
|
5114
|
+
write_router_activity("retry", provider, model, attempt=retry_no, total=gateway_retries, code=exc.code, wait=wait, tokens=token_estimate, bytes=byte_estimate, stream=True)
|
|
5115
|
+
router_log("WARN", f"upstream_stream_rate_limit_retry provider={provider} model={model} attempt={retry_no}/{gateway_retries} wait={wait:.2f}s tokens={token_estimate} bytes={byte_estimate}")
|
|
5116
|
+
if retry_notice:
|
|
5117
|
+
retry_notice(upstream_rate_limit_retry_message(retry_no, gateway_retries))
|
|
5097
5118
|
time.sleep(wait)
|
|
5098
5119
|
continue
|
|
5099
5120
|
if exc.code in UPSTREAM_RETRY_HTTP_CODES and attempt + 1 < max_attempts:
|
package/docs/README.ja.md
CHANGED
|
@@ -47,7 +47,7 @@ vLLM、NVIDIA hosted、self-hosted NIM を選択し、通常の Claude Code 引
|
|
|
47
47
|
|
|
48
48
|
Credits: One Ciel LLC
|
|
49
49
|
|
|
50
|
-
現在のバージョン: `0.1.
|
|
50
|
+
現在のバージョン: `0.1.43`
|
|
51
51
|
|
|
52
52
|
## 作られた理由
|
|
53
53
|
|
|
@@ -351,6 +351,11 @@ Windows/Linux 管理、クリーンアップスクリプト、定期的なセキ
|
|
|
351
351
|
|
|
352
352
|
## 変更履歴
|
|
353
353
|
|
|
354
|
+
### 0.1.43
|
|
355
|
+
|
|
356
|
+
- **429 backoff retry**: upstream `429 Too Many Requests` 応答を初回 backoff 後に
|
|
357
|
+
raw error として漏らさず、すべての retry attempt で backoff/retry event として処理します。
|
|
358
|
+
|
|
354
359
|
### 0.1.42
|
|
355
360
|
|
|
356
361
|
- **ライブストリーム進捗**: statusline が upstream streaming の出力進捗を
|
package/docs/README.ko.md
CHANGED
|
@@ -47,7 +47,7 @@ NVIDIA hosted, self-hosted NIM을 선택하고, Claude Code의 일반 인자는
|
|
|
47
47
|
|
|
48
48
|
Credits: One Ciel LLC
|
|
49
49
|
|
|
50
|
-
현재 버전: `0.1.
|
|
50
|
+
현재 버전: `0.1.43`
|
|
51
51
|
|
|
52
52
|
## 왜 만들었나
|
|
53
53
|
|
|
@@ -351,6 +351,11 @@ Windows 이벤트 로그 리뷰, 바이러스/랜섬웨어 침입 시도 정리,
|
|
|
351
351
|
|
|
352
352
|
## 변경 이력
|
|
353
353
|
|
|
354
|
+
### 0.1.43
|
|
355
|
+
|
|
356
|
+
- **429 backoff retry**: upstream `429 Too Many Requests` 응답을 첫 backoff 이후
|
|
357
|
+
raw error로 흘리지 않고, 모든 retry attempt에서 backoff/retry 이벤트로 처리합니다.
|
|
358
|
+
|
|
354
359
|
### 0.1.42
|
|
355
360
|
|
|
356
361
|
- **실시간 스트림 진행 표시**: statusline이 upstream streaming 출력 진행을
|
package/docs/README.zh.md
CHANGED
|
@@ -47,7 +47,7 @@ NIM,并把普通 Claude Code 参数原样传递。
|
|
|
47
47
|
|
|
48
48
|
Credits: One Ciel LLC
|
|
49
49
|
|
|
50
|
-
当前版本: `0.1.
|
|
50
|
+
当前版本: `0.1.43`
|
|
51
51
|
|
|
52
52
|
## 为什么存在
|
|
53
53
|
|
|
@@ -337,6 +337,11 @@ Hermes 格式模型或部分较旧的 Qwen tool template。
|
|
|
337
337
|
|
|
338
338
|
## 更新日志
|
|
339
339
|
|
|
340
|
+
### 0.1.43
|
|
341
|
+
|
|
342
|
+
- **429 backoff retry**:upstream `429 Too Many Requests` 响应现在会在所有 retry
|
|
343
|
+
attempt 中作为 backoff/retry event 处理,不再在首次 backoff 后泄漏 raw error。
|
|
344
|
+
|
|
340
345
|
### 0.1.42
|
|
341
346
|
|
|
342
347
|
- **实时流式进度**:statusline 会持续更新 upstream streaming 输出进度,
|
package/docs/manual.md
CHANGED
package/package.json
CHANGED