@yourgpt/copilot-sdk 2.1.5-alpha.8 → 2.1.6

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.
@@ -2217,7 +2217,7 @@ ${this.dynamicContext}`.trim() : this.config.systemPrompt;
2217
2217
  this.handleError(error);
2218
2218
  return;
2219
2219
  }
2220
- if (chunk.type === "message:end" && this.streamState?.content) {
2220
+ if (chunk.type === "message:end" && this.streamState !== null && (this.streamState.content || (this.streamState.toolResults?.size ?? 0) > 0)) {
2221
2221
  this.debug("message:end mid-stream", {
2222
2222
  messageId: this.streamState.messageId,
2223
2223
  contentLength: this.streamState.content.length,
@@ -2292,6 +2292,8 @@ ${this.dynamicContext}`.trim() : this.config.systemPrompt;
2292
2292
  continue;
2293
2293
  }
2294
2294
  if (msg.role === "assistant" && !msg.tool_calls?.length) continue;
2295
+ if (msg.role === "assistant" && msg.tool_calls?.length && pendingIds.size === 0)
2296
+ continue;
2295
2297
  messagesToInsert.push({
2296
2298
  id: generateMessageId(),
2297
2299
  role: msg.role,
@@ -5969,5 +5971,5 @@ exports.useMessageHistoryContext = useMessageHistoryContext;
5969
5971
  exports.useSkillContext = useSkillContext;
5970
5972
  exports.useTool = useTool;
5971
5973
  exports.useTools = useTools;
5972
- //# sourceMappingURL=chunk-JV2L3WZS.cjs.map
5973
- //# sourceMappingURL=chunk-JV2L3WZS.cjs.map
5974
+ //# sourceMappingURL=chunk-6ZTITCKU.cjs.map
5975
+ //# sourceMappingURL=chunk-6ZTITCKU.cjs.map