open-agents-ai 0.184.45 → 0.184.46
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 +17 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28266,6 +28266,19 @@ ${transcript}`
|
|
|
28266
28266
|
}
|
|
28267
28267
|
if (kind === "content") {
|
|
28268
28268
|
content += fragment;
|
|
28269
|
+
if (content.length > 400 && content.length % 200 < fragment.length) {
|
|
28270
|
+
const half = Math.floor(content.length / 2);
|
|
28271
|
+
const firstHalf = content.slice(half - 150, half);
|
|
28272
|
+
const secondHalf = content.slice(-150);
|
|
28273
|
+
if (firstHalf.length >= 100 && firstHalf === secondHalf) {
|
|
28274
|
+
this.emit({
|
|
28275
|
+
type: "status",
|
|
28276
|
+
content: "Aborting generation \u2014 intra-response repetition detected (model stuck in text loop)",
|
|
28277
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
28278
|
+
});
|
|
28279
|
+
break;
|
|
28280
|
+
}
|
|
28281
|
+
}
|
|
28269
28282
|
}
|
|
28270
28283
|
this.emit({
|
|
28271
28284
|
type: "stream_token",
|
|
@@ -28459,8 +28472,9 @@ ${transcript}`
|
|
|
28459
28472
|
continue;
|
|
28460
28473
|
const delta = choice.delta;
|
|
28461
28474
|
const finishReason = choice.finish_reason;
|
|
28462
|
-
|
|
28463
|
-
|
|
28475
|
+
const reasoningToken = delta?.reasoning ?? delta?.reasoning_content;
|
|
28476
|
+
if (reasoningToken) {
|
|
28477
|
+
yield { type: "content", content: reasoningToken, thinking: true };
|
|
28464
28478
|
}
|
|
28465
28479
|
if (delta?.content) {
|
|
28466
28480
|
yield { type: "content", content: delta.content };
|
|
@@ -53593,6 +53607,7 @@ var init_stream_renderer = __esm({
|
|
|
53593
53607
|
process.stdout.write(`\x1B[1A\x1B[2K${dimText(" \u23BF ")}${dimItalic(`thought for ${this.thinkingTokenCount} tokens`)}
|
|
53594
53608
|
`);
|
|
53595
53609
|
this.thinkingTokenCount = 0;
|
|
53610
|
+
this.lineStarted = false;
|
|
53596
53611
|
}
|
|
53597
53612
|
if (kind === "tool_args" && !this.inToolArgs) {
|
|
53598
53613
|
this.flushPartial(kind);
|
|
@@ -53645,8 +53660,6 @@ var init_stream_renderer = __esm({
|
|
|
53645
53660
|
if (this.lineStarted) {
|
|
53646
53661
|
process.stdout.write("\n");
|
|
53647
53662
|
this.lineStarted = false;
|
|
53648
|
-
} else {
|
|
53649
|
-
process.stdout.write("\n");
|
|
53650
53663
|
}
|
|
53651
53664
|
return;
|
|
53652
53665
|
}
|
package/package.json
CHANGED