@oh-my-pi/pi-ai 14.9.2 → 14.9.3
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/CHANGELOG.md +5 -0
- package/package.json +3 -3
- package/src/providers/anthropic.ts +11 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [14.9.3] - 2026-05-10
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- Anthropic provider now retries generic transient connect failures (`unable to connect`, `fetch failed`, `connection error`, etc.) by falling back to the shared `isRetryableError` allowlist after the provider-specific patterns. Previously these errors bypassed the hand-curated regex in `isProviderRetryableError` and aborted the stream on the first attempt, while the OpenAI SDK and Codex `fetchWithRetry` paths already handled them.
|
|
9
|
+
|
|
5
10
|
## [14.9.0] - 2026-05-10
|
|
6
11
|
|
|
7
12
|
### Added
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-ai",
|
|
4
|
-
"version": "14.9.
|
|
4
|
+
"version": "14.9.3",
|
|
5
5
|
"description": "Unified LLM API with automatic model discovery and provider configuration",
|
|
6
6
|
"homepage": "https://github.com/can1357/oh-my-pi",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@aws-sdk/credential-provider-node": "^3.972.39",
|
|
47
47
|
"@bufbuild/protobuf": "^2.12.0",
|
|
48
48
|
"@google/genai": "^1.52.0",
|
|
49
|
-
"@oh-my-pi/pi-natives": "14.9.
|
|
50
|
-
"@oh-my-pi/pi-utils": "14.9.
|
|
49
|
+
"@oh-my-pi/pi-natives": "14.9.3",
|
|
50
|
+
"@oh-my-pi/pi-utils": "14.9.3",
|
|
51
51
|
"@sinclair/typebox": "^0.34.49",
|
|
52
52
|
"@smithy/node-http-handler": "^4.6.1",
|
|
53
53
|
"ajv": "^8.20.0",
|
|
@@ -48,7 +48,12 @@ import { getStreamFirstEventTimeoutMs, getStreamIdleTimeoutMs, iterateWithIdleTi
|
|
|
48
48
|
import { parseJsonWithRepair, parseStreamingJson } from "../utils/json-parse";
|
|
49
49
|
import { parseGitHubCopilotApiKey } from "../utils/oauth/github-copilot";
|
|
50
50
|
import { notifyProviderResponse } from "../utils/provider-response";
|
|
51
|
-
import {
|
|
51
|
+
import {
|
|
52
|
+
extractHttpStatusFromError,
|
|
53
|
+
isCopilotRetryableError,
|
|
54
|
+
isRetryableError,
|
|
55
|
+
isUnexpectedSocketCloseMessage,
|
|
56
|
+
} from "../utils/retry";
|
|
52
57
|
import { COMBINATOR_KEYS, NO_STRICT } from "../utils/schema";
|
|
53
58
|
import { notifyRawSseEvent, wrapFetchForSseDebug } from "../utils/sse-debug";
|
|
54
59
|
import {
|
|
@@ -841,14 +846,17 @@ export function isProviderRetryableError(error: unknown, provider?: string): boo
|
|
|
841
846
|
if (!(error instanceof Error)) return false;
|
|
842
847
|
if (provider === "github-copilot" && isCopilotRetryableError(error)) return true;
|
|
843
848
|
const msg = error.message.toLowerCase();
|
|
844
|
-
|
|
849
|
+
if (
|
|
845
850
|
isUnexpectedSocketCloseMessage(msg) ||
|
|
846
851
|
/rate.?limit|too many requests|overloaded|service.?unavailable|internal_error|stream error.*received from peer|1302|timed?\s*out while waiting for the first event|timeout waiting for first/i.test(
|
|
847
852
|
msg,
|
|
848
853
|
) ||
|
|
849
854
|
isTransientStreamParseError(error) ||
|
|
850
855
|
isProviderRetryableStreamEnvelopeError(error)
|
|
851
|
-
)
|
|
856
|
+
) {
|
|
857
|
+
return true;
|
|
858
|
+
}
|
|
859
|
+
return isRetryableError(error);
|
|
852
860
|
}
|
|
853
861
|
|
|
854
862
|
function createEmptyUsage(premiumRequests?: number): Usage {
|