@opencode/ai 0.0.0-dev-19553 → 0.0.0-dev-19557

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.
@@ -595,7 +595,7 @@ export const fromRequest = Effect.fn("OpenAIChat.fromRequest")(function* (reques
595
595
  ? []
596
596
  : undefined
597
597
  : flattened.tools.map((tool) => lowerTool(tool, ToolSchemaProjection.modelCompatibility(tool.inputSchema, toolSchemaCompatibility), options, supportsStrictMode)),
598
- tool_choice: request.toolChoice ? yield* lowerToolChoice(request.toolChoice) : undefined,
598
+ tool_choice: hasActiveTools && request.toolChoice ? yield* lowerToolChoice(request.toolChoice) : undefined,
599
599
  stream: true,
600
600
  ...(supportsUsageInStreaming ? { stream_options: { include_usage: true } } : {}),
601
601
  ...(zaiToolStream && hasActiveTools ? { tool_stream: true } : {}),
@@ -152,8 +152,10 @@ const fromRequest = Effect.fn("OpenAIResponses.fromRequest")(function* (request)
152
152
  tools: request.tools.length === 0
153
153
  ? undefined
154
154
  : yield* Effect.forEach(request.tools, (tool) => lowerToolEntry(tool, toolSchemaCompatibility)),
155
- tool_choice: OpenResponses.allowedToolChoice(request) ??
156
- (request.toolChoice ? yield* lowerToolChoice(request.toolChoice, request.tools) : undefined),
155
+ tool_choice: request.tools.length === 0
156
+ ? undefined
157
+ : (OpenResponses.allowedToolChoice(request) ??
158
+ (request.toolChoice ? yield* lowerToolChoice(request.toolChoice, request.tools) : undefined)),
157
159
  });
158
160
  });
159
161
  const checkpointBody = {
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-19553",
3
+ "version": "0.0.0-dev-19557",
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-dev-19553",
33
+ "@opencode/http-recorder": "0.0.0-dev-19557",
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-dev-19553",
43
+ "@opencode/schema": "0.0.0-dev-19557",
44
44
  "aws4fetch": "1.0.20",
45
45
  "effect": "4.0.0-rc.112",
46
46
  "google-auth-library": "10.5.0"