@vincemakes/kiso-provider-openai 0.40.5 → 0.40.7

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -535,6 +535,17 @@ function toOpenAIError(err, model) {
535
535
  return connectionFailure(err, label + err.message);
536
536
  }
537
537
  if (err instanceof OpenAI.APIError) {
538
+ // 0.40.7 (finding-stream-error-frame-2026-09-17): an `{"error": …}`
539
+ // frame INSIDE a 200 stream reaches here with NO status — a gateway
540
+ // that lost its upstream mid-answer ("Upstream stream ended before
541
+ // terminal chunk"). It used to fall to `unknown`, non-retryable, and
542
+ // the run ended where the mid-stream retry belongs. What the frame's
543
+ // WORDS identify (a context overflow) keeps its own verdict; the rest
544
+ // is the transport failing after the headers, as COMPAT-F2 below.
545
+ if (err.status === undefined) {
546
+ const mapped = mapApiError(undefined, label + err.message);
547
+ return mapped.code === "unknown" ? streamFailure(label + err.message) : mapped;
548
+ }
538
549
  // CX-1 F8: the kernel owns retries — Retry-After travels with the error
539
550
  return mapApiError(err.status, label + err.message, retryAfterOf(err.headers));
540
551
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vincemakes/kiso-provider-openai",
3
- "version": "0.40.5",
3
+ "version": "0.40.7",
4
4
  "description": "kiso OpenAI-compatible adapter \u2014 OpenAI + the compat family (GLM, Kimi, DeepSeek, OpenRouter) via base_url swap, reasoning dialects digested.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -21,7 +21,7 @@
21
21
  "test": "vitest run"
22
22
  },
23
23
  "dependencies": {
24
- "@vincemakes/kiso-core": "0.40.5",
24
+ "@vincemakes/kiso-core": "0.40.7",
25
25
  "openai": "^7.3.0"
26
26
  },
27
27
  "devDependencies": {