@livx.cc/agentx 0.99.67 → 0.99.69

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/dist/index.js CHANGED
@@ -4867,6 +4867,11 @@ var Agent = class _Agent {
4867
4867
  return { text: "", steps, finishReason: "error", messages: this.transcript, usage, usageEstimated, error: err };
4868
4868
  }
4869
4869
  if (o.signal?.aborted) return kill("aborted");
4870
+ if (res.finishReason === "error" && !res.toolCalls?.length) {
4871
+ const err = new Error(contentText(res.content ?? "").trim() || "provider error");
4872
+ log7.error(`chat() failed: ${err.message}`);
4873
+ return { text: "", steps, finishReason: "error", messages: this.transcript, usage, usageEstimated, error: err };
4874
+ }
4870
4875
  if (!res.usage) {
4871
4876
  const promptTokens = estimateTokens(sent);
4872
4877
  const completionTokens = Math.ceil((contentText(res.content).length + (res.toolCalls ? JSON.stringify(res.toolCalls).length : 0)) / 4);