open-agents-ai 0.187.130 → 0.187.131
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 +32 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -264670,6 +264670,7 @@ ${description}`
|
|
|
264670
264670
|
async streamingRequest(request, turn) {
|
|
264671
264671
|
const backend = this.backend;
|
|
264672
264672
|
let content = "";
|
|
264673
|
+
let thinkingContent = "";
|
|
264673
264674
|
let inThinkTag = false;
|
|
264674
264675
|
const toolCallAccumulators = /* @__PURE__ */ new Map();
|
|
264675
264676
|
let streamUsage;
|
|
@@ -264703,18 +264704,21 @@ ${description}`
|
|
|
264703
264704
|
}
|
|
264704
264705
|
if (kind === "content") {
|
|
264705
264706
|
content += fragment;
|
|
264706
|
-
|
|
264707
|
-
|
|
264708
|
-
|
|
264709
|
-
|
|
264710
|
-
|
|
264711
|
-
|
|
264712
|
-
|
|
264713
|
-
|
|
264714
|
-
|
|
264715
|
-
|
|
264716
|
-
|
|
264717
|
-
|
|
264707
|
+
} else {
|
|
264708
|
+
thinkingContent += fragment;
|
|
264709
|
+
}
|
|
264710
|
+
const buf = kind === "content" ? content : thinkingContent;
|
|
264711
|
+
if (buf.length > 400 && buf.length % 200 < fragment.length) {
|
|
264712
|
+
const half = Math.floor(buf.length / 2);
|
|
264713
|
+
const firstHalf = buf.slice(half - 150, half);
|
|
264714
|
+
const secondHalf = buf.slice(-150);
|
|
264715
|
+
if (firstHalf.length >= 100 && firstHalf === secondHalf) {
|
|
264716
|
+
this.emit({
|
|
264717
|
+
type: "status",
|
|
264718
|
+
content: `Aborting generation \u2014 intra-response repetition detected in ${kind} (model stuck in loop)`,
|
|
264719
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
264720
|
+
});
|
|
264721
|
+
break;
|
|
264718
264722
|
}
|
|
264719
264723
|
}
|
|
264720
264724
|
this.emit({
|
|
@@ -280498,6 +280502,8 @@ var init_status_bar = __esm({
|
|
|
280498
280502
|
_origWrite = null;
|
|
280499
280503
|
/** True stdout.write captured at construction — immune to interceptor stacking */
|
|
280500
280504
|
_trueStdoutWrite = process.stdout.write.bind(process.stdout);
|
|
280505
|
+
/** Only buffer actual content lines (not footer/scroll-region maintenance) */
|
|
280506
|
+
_bufferContent = false;
|
|
280501
280507
|
/** Write directly to the terminal, bypassing content bg/scrollback monkey-patch.
|
|
280502
280508
|
* ALL footer/input/braille rendering MUST use this, never process.stdout.write.
|
|
280503
280509
|
* Respects overlay isolation — when tuiSelect/dropPanel is on alt screen,
|
|
@@ -280538,9 +280544,11 @@ var init_status_bar = __esm({
|
|
|
280538
280544
|
else if (Buffer.isBuffer(chunk)) text = chunk.toString();
|
|
280539
280545
|
else text = String(chunk);
|
|
280540
280546
|
const lines = text.split("\n");
|
|
280541
|
-
|
|
280542
|
-
const
|
|
280543
|
-
|
|
280547
|
+
if (self2._bufferContent && !isOverlayActive()) {
|
|
280548
|
+
for (const line of lines) {
|
|
280549
|
+
const visible = line.replace(/\x1B\[[0-9;]*[A-Za-z]/g, "");
|
|
280550
|
+
if (visible.trim().length > 0) self2.bufferContentLine(line);
|
|
280551
|
+
}
|
|
280544
280552
|
}
|
|
280545
280553
|
if (typeof chunk === "string") {
|
|
280546
280554
|
chunk = chunk.replace(/\x1B\[0m/g, `\x1B[0m${CONTENT_BG_SEQ}`).replace(/\n/g, `\x1B[K
|
|
@@ -280553,14 +280561,13 @@ ${CONTENT_BG_SEQ}`);
|
|
|
280553
280561
|
process.stdout.write = bufferedWrite;
|
|
280554
280562
|
}
|
|
280555
280563
|
this.termWrite("\x1B[?2026h");
|
|
280556
|
-
process.stdout
|
|
280557
|
-
|
|
280558
|
-
|
|
280559
|
-
`\x1B[${this.scrollRegionTop};${scrollEnd}r\x1B[${scrollEnd};1H`
|
|
280560
|
-
);
|
|
280564
|
+
this._trueStdoutWrite.call(process.stdout, `\x1B[?25l${CONTENT_BG_SEQ}`);
|
|
280565
|
+
this._trueStdoutWrite.call(process.stdout, `\x1B[${this.scrollRegionTop};${scrollEnd}r`);
|
|
280566
|
+
this._trueStdoutWrite.call(process.stdout, `\x1B[${scrollEnd};1H`);
|
|
280561
280567
|
this.renderFooterAndPositionInput();
|
|
280562
|
-
process.stdout
|
|
280568
|
+
this._trueStdoutWrite.call(process.stdout, `\x1B[${scrollEnd};1H`);
|
|
280563
280569
|
this.termWrite("\x1B[?2026l");
|
|
280570
|
+
this._bufferContent = true;
|
|
280564
280571
|
}
|
|
280565
280572
|
/**
|
|
280566
280573
|
* Call AFTER writing content to the scrollable area.
|
|
@@ -280573,6 +280580,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
280573
280580
|
if (!this.active) return;
|
|
280574
280581
|
this.writeDepth = Math.max(0, this.writeDepth - 1);
|
|
280575
280582
|
if (this.writeDepth === 0) {
|
|
280583
|
+
this._bufferContent = false;
|
|
280576
280584
|
if (this._origWrite) {
|
|
280577
280585
|
try {
|
|
280578
280586
|
delete process.stdout.write.__oa_oaWriteLayer;
|
|
@@ -309955,9 +309963,9 @@ ${opts.systemPromptAddition}` : `Working directory: ${repoRoot}`;
|
|
|
309955
309963
|
setContentWriteHook({
|
|
309956
309964
|
begin: () => statusBar.beginContentWrite(),
|
|
309957
309965
|
end: () => statusBar.endContentWrite(),
|
|
309958
|
-
//
|
|
309959
|
-
//
|
|
309960
|
-
redirect: () => isNeovimActive() ? writeToNeovimOutput : null
|
|
309966
|
+
// During overlays, send render output to the alternate screen via overlayWrite;
|
|
309967
|
+
// in neovim mode, route to the Agent Output pane. Otherwise, null (normal).
|
|
309968
|
+
redirect: () => isOverlayActive() ? overlayWrite : isNeovimActive() ? writeToNeovimOutput : null
|
|
309961
309969
|
});
|
|
309962
309970
|
}
|
|
309963
309971
|
setContentWriteHook({
|
package/package.json
CHANGED