@magpie-community/opencode-zen-free-auth 0.1.12 → 0.1.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magpie-community/opencode-zen-free-auth",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "OpenCode Zen free models through the public credential, with native streaming protocols",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",
package/tool-response.mjs CHANGED
@@ -345,6 +345,14 @@ function chatBuffer(checkName) {
345
345
  const index = position(fragment.index);
346
346
  const previous = state.calls.get(index) ?? { index, function: {} };
347
347
  const value = { ...previous, ...fragment, index, function: previous.function };
348
+ // 空 ID 片段不应抹掉已缓存的有效 ID,同时允许首次 ID 后续到达。
349
+ if (
350
+ typeof previous.id === "string" &&
351
+ previous.id.length > 0 &&
352
+ (fragment.id == null || fragment.id === "")
353
+ ) {
354
+ value.id = previous.id;
355
+ }
348
356
  if (fragment.function != null) appendFunction(value.function, fragment.function);
349
357
  state.calls.set(index, value);
350
358
  }