@opencode-ai/ai 0.0.0-dev-17782 → 0.0.0-dev-17789

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.
@@ -290,7 +290,13 @@ const lowerMessages = Effect.fn("Gemini.lowerMessages")(function* (request) {
290
290
  },
291
291
  });
292
292
  }
293
- contents.push({ role: "user", parts });
293
+ // Gemini requires every response to a parallel call batch in one user turn,
294
+ // so consecutive tool results join the open function-response turn.
295
+ const previous = contents.at(-1);
296
+ if (previous?.role === "user" && previous.parts.some((item) => "functionResponse" in item))
297
+ contents[contents.length - 1] = { role: "user", parts: [...previous.parts, ...parts] };
298
+ else
299
+ contents.push({ role: "user", parts });
294
300
  }
295
301
  return contents;
296
302
  });
@@ -52,6 +52,7 @@ const INVALID_REQUEST_CODES = new Set(["invalid_prompt", "invalid_request_error"
52
52
  const RATE_LIMIT_TEXT = /rate increased too quickly|rate[-_\s]?limit|too[_\s]?many[_\s]?requests/i;
53
53
  const QUOTA_TEXT = /insufficient[-_\s]?quota|quota[-_\s]?exceeded/i;
54
54
  const CONTENT_POLICY_TEXT = /content[-_\s]?policy|content_filter|safety/i;
55
+ const NETWORK_ERROR_TEXT = /network[-_\s]error/i;
55
56
  // Keep HTTP failures and provider-reported stream failures on one typed path so
56
57
  // session retry policy never needs provider-specific string matching.
57
58
  export function classifyProviderFailure(input) {
@@ -93,6 +94,8 @@ export function classifyProviderFailure(input) {
93
94
  retryAfterMs: input.retryAfterMs,
94
95
  rateLimit: input.rateLimit,
95
96
  });
97
+ if (NETWORK_ERROR_TEXT.test(text))
98
+ return new ProviderInternalReason({ ...common, status: input.status });
96
99
  if (codes.some((code) => SERVER_CODES.has(code) || code.includes("exhausted") || code.includes("unavailable")))
97
100
  return new ProviderInternalReason({
98
101
  ...common,
@@ -7,6 +7,7 @@ import { Protocol } from "../route/protocol.js";
7
7
  import { ProviderID } from "../schema/index.js";
8
8
  import { GoogleVertexShared } from "./google-vertex-shared.js";
9
9
  const VERSION = "vertex-2023-10-16";
10
+ const HEADER_VERSION = "2023-06-01";
10
11
  export const id = ProviderID.make("google-vertex");
11
12
  const route = Route.make({
12
13
  id: "google-vertex-messages",
@@ -29,6 +30,7 @@ const route = Route.make({
29
30
  endpoint: Endpoint.path(({ request }) => `/${request.model.id}:streamRawPredict`),
30
31
  auth: Auth.none,
31
32
  framing: AnthropicMessages.framing,
33
+ headers: () => ({ "anthropic-version": HEADER_VERSION }),
32
34
  });
33
35
  export const routes = [route];
34
36
  const configuredRoute = (input) => {
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-17782",
3
+ "version": "0.0.0-dev-17789",
4
4
  "name": "@opencode-ai/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.110",
33
- "@opencode-ai/http-recorder": "0.0.0-dev-17782",
33
+ "@opencode-ai/http-recorder": "0.0.0-dev-17789",
34
34
  "@tsconfig/bun": "1.0.9",
35
35
  "@types/bun": "1.3.13",
36
36
  "@typescript/native-preview": "7.0.0-dev.20251207.1",
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@smithy/eventstream-codec": "4.2.14",
41
41
  "@smithy/util-utf8": "4.2.2",
42
- "@opencode-ai/schema": "0.0.0-dev-17782",
42
+ "@opencode-ai/schema": "0.0.0-dev-17789",
43
43
  "aws4fetch": "1.0.20",
44
44
  "effect": "4.0.0-rc.110",
45
45
  "google-auth-library": "10.5.0"