@livx.cc/agentx 0.99.68 → 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/cli.js CHANGED
@@ -4876,6 +4876,11 @@ var Agent = class _Agent {
4876
4876
  return { text: "", steps, finishReason: "error", messages: this.transcript, usage, usageEstimated, error: err2 };
4877
4877
  }
4878
4878
  if (o.signal?.aborted) return kill("aborted");
4879
+ if (res.finishReason === "error" && !res.toolCalls?.length) {
4880
+ const err2 = new Error(contentText(res.content ?? "").trim() || "provider error");
4881
+ log7.error(`chat() failed: ${err2.message}`);
4882
+ return { text: "", steps, finishReason: "error", messages: this.transcript, usage, usageEstimated, error: err2 };
4883
+ }
4879
4884
  if (!res.usage) {
4880
4885
  const promptTokens = estimateTokens(sent);
4881
4886
  const completionTokens = Math.ceil((contentText(res.content).length + (res.toolCalls ? JSON.stringify(res.toolCalls).length : 0)) / 4);