@opencode/ai 0.0.0-beta-19381 → 0.0.0-beta-19398

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.
@@ -128,6 +128,13 @@ export const driver = (input) => {
128
128
  return rejected(observation, "retry-full");
129
129
  if (rejection === "websocket_connection_limit_reached")
130
130
  return rejected(observation, "rotate-and-retry-full");
131
+ // Only the continuation distinguishes an incremental send from a full one, so an unclassified
132
+ // invalid request there is retried full; Codex reports a stale previous_response_id that way, with
133
+ // no code. Classified failures such as context overflow keep their runner-owned recovery.
134
+ if (create.mode === "incremental" &&
135
+ observation.error.reason._tag === "InvalidRequest" &&
136
+ observation.error.reason.classification === undefined)
137
+ return rejected(observation, "retry-full");
131
138
  }
132
139
  if (observation.type !== "completed")
133
140
  return observation;
@@ -63,8 +63,12 @@ const waitOpen = (ws, input) => {
63
63
  };
64
64
  const onAbort = () => {
65
65
  cleanup();
66
- if (ws.readyState !== globalThis.WebSocket.CLOSED && ws.readyState !== globalThis.WebSocket.CLOSING)
67
- ws.close(1000);
66
+ if (ws.readyState === globalThis.WebSocket.CLOSED || ws.readyState === globalThis.WebSocket.CLOSING)
67
+ return;
68
+ // Node's ws reports an aborted handshake as an error event on the next tick; with no listener left
69
+ // after cleanup, EventEmitter would throw it as an uncaught exception.
70
+ ws.addEventListener("error", () => { }, { once: true });
71
+ ws.close(1000);
68
72
  };
69
73
  const onOpen = () => {
70
74
  cleanup();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "0.0.0-beta-19381",
3
+ "version": "0.0.0-beta-19398",
4
4
  "name": "@opencode/ai",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  "devDependencies": {
31
31
  "@clack/prompts": "1.0.0-alpha.1",
32
32
  "@effect/platform-node": "4.0.0-rc.112",
33
- "@opencode/http-recorder": "0.0.0-beta-19381",
33
+ "@opencode/http-recorder": "0.0.0-beta-19398",
34
34
  "@tsconfig/bun": "1.0.9",
35
35
  "@types/bun": "1.4.0",
36
36
  "@typescript/native-preview": "7.0.0-dev.20251207.1",
@@ -40,7 +40,7 @@
40
40
  "@aws-sdk/credential-providers": "3.1057.0",
41
41
  "@smithy/eventstream-codec": "4.2.14",
42
42
  "@smithy/util-utf8": "4.2.2",
43
- "@opencode/schema": "0.0.0-beta-19381",
43
+ "@opencode/schema": "0.0.0-beta-19398",
44
44
  "aws4fetch": "1.0.20",
45
45
  "effect": "4.0.0-rc.112",
46
46
  "google-auth-library": "10.5.0"