open-agents-ai 0.187.234 → 0.187.235

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 +43 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -270510,8 +270510,10 @@ TASK: ${task}` : task;
270510
270510
  this._lastTodoReminderTurn = -1;
270511
270511
  let pendingConstraintWarnings = [];
270512
270512
  let consecutiveTextOnly = 0;
270513
+ let consecutiveThinkOnly = 0;
270513
270514
  let loopInterventionCount = 0;
270514
270515
  const MAX_CONSECUTIVE_TEXT_ONLY = 3;
270516
+ const MAX_CONSECUTIVE_THINK_ONLY = 6;
270515
270517
  let narratedToolCallCount = 0;
270516
270518
  let consecutiveEmptyResponses = 0;
270517
270519
  let sameToolFailStreak = 0;
@@ -271006,6 +271008,7 @@ ${memoryLines.join("\n")}`
271006
271008
  consecutiveEmptyResponses = 0;
271007
271009
  if (msg.toolCalls && msg.toolCalls.length > 0) {
271008
271010
  consecutiveTextOnly = 0;
271011
+ consecutiveThinkOnly = 0;
271009
271012
  messages2.push({
271010
271013
  role: "assistant",
271011
271014
  content: msg.content || null,
@@ -271639,7 +271642,13 @@ Call task_complete(summary="...") NOW with whatever you have.`
271639
271642
  } else {
271640
271643
  const content = msg.content || "";
271641
271644
  messages2.push({ role: "assistant", content });
271642
- consecutiveTextOnly++;
271645
+ if (isThinkOnly) {
271646
+ consecutiveThinkOnly++;
271647
+ consecutiveTextOnly = 0;
271648
+ } else {
271649
+ consecutiveTextOnly++;
271650
+ consecutiveThinkOnly = 0;
271651
+ }
271643
271652
  this.emit({
271644
271653
  type: "model_response",
271645
271654
  content: content.slice(0, 200),
@@ -271655,6 +271664,20 @@ Call task_complete(summary="...") NOW with whatever you have.`
271655
271664
  summary = content;
271656
271665
  break;
271657
271666
  }
271667
+ if (isThinkOnly) {
271668
+ if (consecutiveThinkOnly >= MAX_CONSECUTIVE_THINK_ONLY) {
271669
+ this.emit({
271670
+ type: "status",
271671
+ content: `Model produced ${consecutiveThinkOnly} consecutive think-only responses — nudging toward visible output`,
271672
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
271673
+ });
271674
+ messages2.push({
271675
+ role: "user",
271676
+ content: "You have been reasoning internally for several turns without producing visible output or tool calls. Please take action now — call a tool or produce a visible response."
271677
+ });
271678
+ }
271679
+ continue;
271680
+ }
271658
271681
  if (consecutiveTextOnly >= MAX_CONSECUTIVE_TEXT_ONLY) {
271659
271682
  this.emit({
271660
271683
  type: "status",
@@ -271739,6 +271762,7 @@ Call task_complete(summary="...") NOW with whatever you have.`
271739
271762
  }
271740
271763
  prevCycleToolCalls = toolCallCount;
271741
271764
  consecutiveTextOnly = 0;
271765
+ consecutiveThinkOnly = 0;
271742
271766
  this.emit({
271743
271767
  type: "status",
271744
271768
  content: `Re-engaging — cycle ${bruteForceCycle} (${totalTurns} turns, ${toolCallCount} tool calls so far)`,
@@ -271883,8 +271907,10 @@ Integrate this guidance into your current approach. Continue working on the task
271883
271907
  if (!choice)
271884
271908
  break;
271885
271909
  const msg = choice.message;
271910
+ const isThinkOnlyBF = response._thinkOnly === true;
271886
271911
  if (msg.toolCalls && msg.toolCalls.length > 0) {
271887
271912
  consecutiveTextOnly = 0;
271913
+ consecutiveThinkOnly = 0;
271888
271914
  messages2.push({ role: "assistant", content: msg.content || null, tool_calls: msg.toolCalls.map((tc) => ({ id: tc.id, type: "function", function: { name: tc.name, arguments: JSON.stringify(tc.arguments) } })) });
271889
271915
  for (const tc of msg.toolCalls) {
271890
271916
  if (this.aborted)
@@ -271970,7 +271996,13 @@ Full content available via: repl_exec(code="data = retrieve('${handleId}')") or
271970
271996
  } else {
271971
271997
  const content = msg.content || "";
271972
271998
  messages2.push({ role: "assistant", content });
271973
- consecutiveTextOnly++;
271999
+ if (isThinkOnlyBF) {
272000
+ consecutiveThinkOnly++;
272001
+ consecutiveTextOnly = 0;
272002
+ } else {
272003
+ consecutiveTextOnly++;
272004
+ consecutiveThinkOnly = 0;
272005
+ }
271974
272006
  this.emit({ type: "model_response", content: content.slice(0, 200), turn, timestamp: (/* @__PURE__ */ new Date()).toISOString() });
271975
272007
  if (/task.?complete|all tests pass/i.test(content)) {
271976
272008
  completed = true;
@@ -271988,6 +272020,15 @@ Full content available via: repl_exec(code="data = retrieve('${handleId}')") or
271988
272020
  break;
271989
272021
  }
271990
272022
  }
272023
+ if (isThinkOnlyBF) {
272024
+ if (consecutiveThinkOnly >= MAX_CONSECUTIVE_THINK_ONLY) {
272025
+ messages2.push({
272026
+ role: "user",
272027
+ content: "You have been reasoning internally for several turns without producing visible output or tool calls. Please take action now — call a tool or produce a visible response."
272028
+ });
272029
+ }
272030
+ continue;
272031
+ }
271991
272032
  if (consecutiveTextOnly >= MAX_CONSECUTIVE_TEXT_ONLY) {
271992
272033
  this.emit({
271993
272034
  type: "status",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.234",
3
+ "version": "0.187.235",
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",