@opencode/ai 0.0.0-dev-99 → 0.0.0-dev-106
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/dist/provider-error.js +5 -2
- package/package.json +3 -23
package/dist/provider-error.js
CHANGED
|
@@ -154,7 +154,8 @@ const AUTH_TEXT = /incorrect api key provided/i;
|
|
|
154
154
|
const RATE_LIMIT_TEXT = /rate increased too quickly|rate[-_\s]?limit|too[_\s]?many[_\s]?requests/i;
|
|
155
155
|
// Only consulted on 429, where throttles and account caps share a status.
|
|
156
156
|
// Z.ai reports balance, plan expiry, plan limits, and plan model access on 429.
|
|
157
|
-
|
|
157
|
+
// Cerebras reports its per-minute token throttle as `token_quota_exceeded`; that is a rate limit.
|
|
158
|
+
const QUOTA_TEXT = /insufficient[-_\s]?(?:quota|balance)|(?<!token_)quota[-_\s]?exceeded|budget exceeded|usage limit|limit exhausted|package has expired|plan does not yet include/i;
|
|
158
159
|
// Policy rejections without a dedicated code, matched against the provider's own
|
|
159
160
|
// explanation only. OpenAI reuses `invalid_prompt` for usage-policy rejections while
|
|
160
161
|
// Bedrock Mantle reuses it for schema validation; Anthropic reports blocked output
|
|
@@ -203,7 +204,9 @@ export function classifyProviderFailure(input) {
|
|
|
203
204
|
(codes.includes("context_length_exceeded") ||
|
|
204
205
|
codes.includes("model_context_window_exceeded") ||
|
|
205
206
|
codes.includes("request_too_large") ||
|
|
206
|
-
|
|
207
|
+
// 429 bodies are throttles even when their wording matches an overflow phrase, e.g. Cerebras's
|
|
208
|
+
// "too many tokens processed". Text matching stays on for 4xx and mid-stream errors without a status.
|
|
209
|
+
(input.status !== 429 && !codes.includes("throttlingexception") && isContextOverflow(text))))
|
|
207
210
|
return new InvalidRequestError({ ...details, classification: "context-overflow" });
|
|
208
211
|
if (input.status === 413 || isPayloadTooLarge(text))
|
|
209
212
|
return new InvalidRequestError({ ...details, classification: "payload-too-large" });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-106",
|
|
4
4
|
"name": "@opencode/ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -64,10 +64,6 @@
|
|
|
64
64
|
"import": "./dist/providers/amazon-bedrock.js",
|
|
65
65
|
"types": "./dist/providers/amazon-bedrock.d.ts"
|
|
66
66
|
},
|
|
67
|
-
"./providers/amazon-bedrock-mantle": {
|
|
68
|
-
"import": "./dist/providers/amazon-bedrock-mantle.js",
|
|
69
|
-
"types": "./dist/providers/amazon-bedrock-mantle.d.ts"
|
|
70
|
-
},
|
|
71
67
|
"./providers/amazon-bedrock/mantle": {
|
|
72
68
|
"import": "./dist/providers/amazon-bedrock/mantle.js",
|
|
73
69
|
"types": "./dist/providers/amazon-bedrock/mantle.d.ts"
|
|
@@ -204,26 +200,10 @@
|
|
|
204
200
|
"import": "./dist/providers/google-vertex.js",
|
|
205
201
|
"types": "./dist/providers/google-vertex.d.ts"
|
|
206
202
|
},
|
|
207
|
-
"./providers/google-vertex-chat": {
|
|
208
|
-
"import": "./dist/providers/google-vertex-chat.js",
|
|
209
|
-
"types": "./dist/providers/google-vertex-chat.d.ts"
|
|
210
|
-
},
|
|
211
|
-
"./providers/google-vertex-interactions": {
|
|
212
|
-
"import": "./dist/providers/google-vertex-interactions.js",
|
|
213
|
-
"types": "./dist/providers/google-vertex-interactions.d.ts"
|
|
214
|
-
},
|
|
215
203
|
"./providers/google-vertex-messages": {
|
|
216
204
|
"import": "./dist/providers/google-vertex-messages.js",
|
|
217
205
|
"types": "./dist/providers/google-vertex-messages.d.ts"
|
|
218
206
|
},
|
|
219
|
-
"./providers/google-vertex-mistral": {
|
|
220
|
-
"import": "./dist/providers/google-vertex-mistral.js",
|
|
221
|
-
"types": "./dist/providers/google-vertex-mistral.d.ts"
|
|
222
|
-
},
|
|
223
|
-
"./providers/google-vertex-responses": {
|
|
224
|
-
"import": "./dist/providers/google-vertex-responses.js",
|
|
225
|
-
"types": "./dist/providers/google-vertex-responses.d.ts"
|
|
226
|
-
},
|
|
227
207
|
"./providers/google-vertex/chat": {
|
|
228
208
|
"import": "./dist/providers/google-vertex/chat.js",
|
|
229
209
|
"types": "./dist/providers/google-vertex/chat.d.ts"
|
|
@@ -532,7 +512,7 @@
|
|
|
532
512
|
"devDependencies": {
|
|
533
513
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
534
514
|
"@effect/platform-node": "4.0.1",
|
|
535
|
-
"@opencode/http-recorder": "0.0.0-dev-
|
|
515
|
+
"@opencode/http-recorder": "0.0.0-dev-106",
|
|
536
516
|
"@tsconfig/bun": "1.0.9",
|
|
537
517
|
"@types/bun": "1.4.3",
|
|
538
518
|
"@typescript/native": "npm:typescript@7.1.0-beta",
|
|
@@ -542,7 +522,7 @@
|
|
|
542
522
|
"@aws-sdk/credential-providers": "3.1057.0",
|
|
543
523
|
"@smithy/eventstream-codec": "4.2.14",
|
|
544
524
|
"@smithy/util-utf8": "4.2.2",
|
|
545
|
-
"@opencode/schema": "0.0.0-dev-
|
|
525
|
+
"@opencode/schema": "0.0.0-dev-106",
|
|
546
526
|
"aws4fetch": "1.0.20",
|
|
547
527
|
"effect": "4.0.1",
|
|
548
528
|
"google-auth-library": "10.5.0"
|