open-agents-ai 0.187.130 → 0.187.132

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.
Files changed (2) hide show
  1. package/dist/index.js +48 -24
  2. 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
- if (content.length > 400 && content.length % 200 < fragment.length) {
264707
- const half = Math.floor(content.length / 2);
264708
- const firstHalf = content.slice(half - 150, half);
264709
- const secondHalf = content.slice(-150);
264710
- if (firstHalf.length >= 100 && firstHalf === secondHalf) {
264711
- this.emit({
264712
- type: "status",
264713
- content: "Aborting generation \u2014 intra-response repetition detected (model stuck in text loop)",
264714
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
264715
- });
264716
- break;
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,19 @@ 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;
280507
+ /** Temporarily suppress content-line buffering AND bg injection.
280508
+ * Used by overlay-leave callbacks to write UI chrome (banner, header)
280509
+ * through the bufferedWrite layer without polluting _contentLines or
280510
+ * injecting CONTENT_BG into non-content output. */
280511
+ _suspendContentLayer = false;
280512
+ suspendContentLayer() {
280513
+ this._suspendContentLayer = true;
280514
+ }
280515
+ resumeContentLayer() {
280516
+ this._suspendContentLayer = false;
280517
+ }
280501
280518
  /** Write directly to the terminal, bypassing content bg/scrollback monkey-patch.
280502
280519
  * ALL footer/input/braille rendering MUST use this, never process.stdout.write.
280503
280520
  * Respects overlay isolation — when tuiSelect/dropPanel is on alt screen,
@@ -280533,14 +280550,19 @@ var init_status_bar = __esm({
280533
280550
  const origBound = this._trueStdoutWrite;
280534
280551
  const self2 = this;
280535
280552
  const bufferedWrite = function(chunk, ...args) {
280553
+ if (self2._suspendContentLayer) {
280554
+ return origBound.call(process.stdout, chunk, ...args);
280555
+ }
280536
280556
  let text;
280537
280557
  if (typeof chunk === "string") text = chunk;
280538
280558
  else if (Buffer.isBuffer(chunk)) text = chunk.toString();
280539
280559
  else text = String(chunk);
280540
280560
  const lines = text.split("\n");
280541
- for (const line of lines) {
280542
- const visible = line.replace(/\x1B\[[0-9;]*[A-Za-z]/g, "");
280543
- if (visible.trim().length > 0) self2.bufferContentLine(line);
280561
+ if (self2._bufferContent && !isOverlayActive()) {
280562
+ for (const line of lines) {
280563
+ const visible = line.replace(/\x1B\[[0-9;]*[A-Za-z]/g, "");
280564
+ if (visible.trim().length > 0) self2.bufferContentLine(line);
280565
+ }
280544
280566
  }
280545
280567
  if (typeof chunk === "string") {
280546
280568
  chunk = chunk.replace(/\x1B\[0m/g, `\x1B[0m${CONTENT_BG_SEQ}`).replace(/\n/g, `\x1B[K
@@ -280553,14 +280575,13 @@ ${CONTENT_BG_SEQ}`);
280553
280575
  process.stdout.write = bufferedWrite;
280554
280576
  }
280555
280577
  this.termWrite("\x1B[?2026h");
280556
- process.stdout.write(
280557
- `\x1B[?25l` + // hide cursor
280558
- CONTENT_BG_SEQ + // set content area bg (#111)
280559
- `\x1B[${this.scrollRegionTop};${scrollEnd}r\x1B[${scrollEnd};1H`
280560
- );
280578
+ this._trueStdoutWrite.call(process.stdout, `\x1B[?25l${CONTENT_BG_SEQ}`);
280579
+ this._trueStdoutWrite.call(process.stdout, `\x1B[${this.scrollRegionTop};${scrollEnd}r`);
280580
+ this._trueStdoutWrite.call(process.stdout, `\x1B[${scrollEnd};1H`);
280561
280581
  this.renderFooterAndPositionInput();
280562
- process.stdout.write(`\x1B[${scrollEnd};1H`);
280582
+ this._trueStdoutWrite.call(process.stdout, `\x1B[${scrollEnd};1H`);
280563
280583
  this.termWrite("\x1B[?2026l");
280584
+ this._bufferContent = true;
280564
280585
  }
280565
280586
  /**
280566
280587
  * Call AFTER writing content to the scrollable area.
@@ -280573,6 +280594,7 @@ ${CONTENT_BG_SEQ}`);
280573
280594
  if (!this.active) return;
280574
280595
  this.writeDepth = Math.max(0, this.writeDepth - 1);
280575
280596
  if (this.writeDepth === 0) {
280597
+ this._bufferContent = false;
280576
280598
  if (this._origWrite) {
280577
280599
  try {
280578
280600
  delete process.stdout.write.__oa_oaWriteLayer;
@@ -309927,7 +309949,9 @@ ${opts.systemPromptAddition}` : `Working directory: ${repoRoot}`;
309927
309949
  });
309928
309950
  const { onOverlayLeave: onOverlayLeave2 } = await Promise.resolve().then(() => (init_overlay_lock(), overlay_lock_exports));
309929
309951
  onOverlayLeave2(() => {
309952
+ statusBar.suspendContentLayer();
309930
309953
  banner.renderCurrentFrame();
309954
+ statusBar.resumeContentLayer();
309931
309955
  statusBar.disableMouseTracking();
309932
309956
  statusBar.enableMouseTracking();
309933
309957
  if (statusBar.isActive) {
@@ -309955,9 +309979,9 @@ ${opts.systemPromptAddition}` : `Working directory: ${repoRoot}`;
309955
309979
  setContentWriteHook({
309956
309980
  begin: () => statusBar.beginContentWrite(),
309957
309981
  end: () => statusBar.endContentWrite(),
309958
- // When neovim is active, redirect all render output to the Agent Output
309959
- // pane instead of writing to stdout (which would push the PTY upward).
309960
- redirect: () => isNeovimActive() ? writeToNeovimOutput : null
309982
+ // During overlays, send render output to the alternate screen via overlayWrite;
309983
+ // in neovim mode, route to the Agent Output pane. Otherwise, null (normal).
309984
+ redirect: () => isOverlayActive() ? overlayWrite : isNeovimActive() ? writeToNeovimOutput : null
309961
309985
  });
309962
309986
  }
309963
309987
  setContentWriteHook({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.130",
3
+ "version": "0.187.132",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",