@ai-sdk/openai 4.0.0-beta.2 → 4.0.0-beta.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 4.0.0-beta.4
4
+
5
+ ### Patch Changes
6
+
7
+ - a71d345: fix(provider/openai): drop reasoning parts without encrypted content when store: false
8
+
9
+ ## 4.0.0-beta.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 45b3d76: fix(security): prevent streaming tool calls from finalizing on parsable partial JSON
14
+
15
+ Streaming tool call arguments were finalized using `isParsableJson()` as a heuristic for completion. If partial accumulated JSON happened to be valid JSON before all chunks arrived, the tool call would be executed with incomplete arguments. Tool call finalization now only occurs in `flush()` after the stream is fully consumed.
16
+
17
+ - f7295cb: revert incorrect fix https://github.com/vercel/ai/pull/13172
18
+
3
19
  ## 4.0.0-beta.2
4
20
 
5
21
  ### Patch Changes
package/dist/index.js CHANGED
@@ -2615,7 +2615,7 @@ async function convertToOpenAIResponsesInput({
2615
2615
  customProviderToolNames
2616
2616
  }) {
2617
2617
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
2618
- const input = [];
2618
+ let input = [];
2619
2619
  const warnings = [];
2620
2620
  const processedApprovalIds = /* @__PURE__ */ new Set();
2621
2621
  for (const { role, content } of prompt) {
@@ -3116,6 +3116,17 @@ async function convertToOpenAIResponsesInput({
3116
3116
  }
3117
3117
  }
3118
3118
  }
3119
+ if (!store && input.some(
3120
+ (item) => "type" in item && item.type === "reasoning" && item.encrypted_content == null
3121
+ )) {
3122
+ warnings.push({
3123
+ type: "other",
3124
+ message: "Reasoning parts without encrypted content are not supported when store is false. Skipping reasoning parts."
3125
+ });
3126
+ input = input.filter(
3127
+ (item) => !("type" in item) || item.type !== "reasoning" || item.encrypted_content != null
3128
+ );
3129
+ }
3119
3130
  return { input, warnings };
3120
3131
  }
3121
3132
  var openaiResponsesReasoningProviderOptionsSchema = import_v419.z.object({
@@ -6303,7 +6314,7 @@ var OpenAITranscriptionModel = class {
6303
6314
  };
6304
6315
 
6305
6316
  // src/version.ts
6306
- var VERSION = true ? "4.0.0-beta.2" : "0.0.0-test";
6317
+ var VERSION = true ? "4.0.0-beta.4" : "0.0.0-test";
6307
6318
 
6308
6319
  // src/openai-provider.ts
6309
6320
  function createOpenAI(options = {}) {