open-agents-ai 0.187.274 → 0.187.275

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 +17 -29
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -269813,8 +269813,8 @@ var init_agenticRunner = __esm({
269813
269813
  this._embeddingTimer = null;
269814
269814
  }
269815
269815
  }
269816
- _loopBlockedTools;
269817
- // Loop intervention: tools removed from schema
269816
+ // Never block tools: we rely on guidance and repetition handling rather than
269817
+ // modifying the available tool set.
269818
269818
  // -- Session Checkpointing (Priority 5) --
269819
269819
  _sessionId = `session-${Date.now()}`;
269820
269820
  _workingDirectory = "";
@@ -270501,18 +270501,6 @@ TASK: ${task}` : task;
270501
270501
  let toolDefs = await this.buildToolDefinitions();
270502
270502
  const baseInstructions = getSystemPromptForTier(this.options.modelTier);
270503
270503
  this.checkPromptToolParity(baseInstructions, toolDefs);
270504
- if (this._loopBlockedTools?.size) {
270505
- const blocked = this._loopBlockedTools;
270506
- const before = toolDefs.length;
270507
- toolDefs = toolDefs.filter((td) => !blocked.has(td.function.name));
270508
- if (toolDefs.length < before) {
270509
- this.emit({
270510
- type: "status",
270511
- content: `Loop: removed ${before - toolDefs.length} tool(s) from schema: ${[...blocked].join(", ")}`,
270512
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
270513
- });
270514
- }
270515
- }
270516
270504
  let textToolModeActive = this.options.textToolMode ?? false;
270517
270505
  if (textToolModeActive) {
270518
270506
  const toolDescriptions = Array.from(this.tools.values()).map((t2) => `- ${t2.name}: ${t2.description}`).join("\n");
@@ -270551,7 +270539,6 @@ TASK: ${task}` : task;
270551
270539
  this._hookDenyHintCount = 0;
270552
270540
  this._selfConsistencyVotes = 0;
270553
270541
  this._retrievalContextCache = null;
270554
- this._loopBlockedTools = void 0;
270555
270542
  this._lastTodoWriteTurn = -1;
270556
270543
  this._lastTodoReminderTurn = -1;
270557
270544
  let pendingConstraintWarnings = [];
@@ -271494,9 +271481,7 @@ ${memoryLines.join("\n")}`
271494
271481
  }
271495
271482
  const consecutiveSameTool = Math.max(sameToolFailStreak, this._taskState.failedApproaches.slice(-2).filter((f2) => f2.startsWith(`${tc.name}(`)).length);
271496
271483
  if (sameToolFailStreak >= 5 && (this.options.modelTier === "small" || this.options.modelTier === "medium")) {
271497
- this._loopBlockedTools = this._loopBlockedTools ?? /* @__PURE__ */ new Set();
271498
- this._loopBlockedTools.add(tc.name);
271499
- this.pendingUserMessages.push(`[HARD BLOCK] Tool "${tc.name}" has failed ${sameToolFailStreak} times in a row and is now BLOCKED for the rest of this run. You MUST use a completely different tool. Options: file_read (inspect state), list_directory (explore workspace), shell (if you weren't using shell), web_search (lookup docs). Stop trying ${tc.name}. Call a different tool NOW or call task_complete if the goal is unreachable.`);
271484
+ this.pendingUserMessages.push(`[PIVOT STRONGLY RECOMMENDED] Tool "${tc.name}" has failed ${sameToolFailStreak} times in a row. Try a different approach: file_read (inspect state), list_directory (explore workspace), shell (run a minimal reproducer), or web_search (lookup docs). Avoid repeating ${tc.name} with similar arguments.`);
271500
271485
  sameToolFailStreak = 0;
271501
271486
  sameToolFailName = null;
271502
271487
  }
@@ -271596,10 +271581,18 @@ Then use file_read on individual FILES inside it.`);
271596
271581
  const rawToolCalls = msg.toolCalls;
271597
271582
  if (this.options.streamEnabled && this._streamingExecutor.hasTools) {
271598
271583
  this._streamingExecutor.setExecutor(async (name10, args) => {
271599
- const matchTc = rawToolCalls.find((tc) => tc.name === name10 && JSON.stringify(tc.arguments) === JSON.stringify(args)) ?? rawToolCalls.find((tc) => tc.name === name10);
271600
- if (!matchTc)
271601
- return { success: false, output: "", error: `Tool ${name10} not found in response` };
271602
- const r2 = await executeSingle(matchTc);
271584
+ let matchTc = rawToolCalls.find((tc) => tc.name === name10 && JSON.stringify(tc.arguments) === JSON.stringify(args)) ?? rawToolCalls.find((tc) => tc.name === name10);
271585
+ if (!matchTc) {
271586
+ const synthId = globalThis.crypto?.randomUUID?.() || `call_${Date.now()}`;
271587
+ matchTc = { id: synthId, name: name10, arguments: args };
271588
+ messages2.push({
271589
+ role: "assistant",
271590
+ content: null,
271591
+ tool_calls: [{ id: synthId, type: "function", function: { name: name10, arguments: JSON.stringify(args) } }]
271592
+ });
271593
+ }
271594
+ const tcToRun = matchTc;
271595
+ const r2 = await executeSingle(tcToRun);
271603
271596
  if (!r2)
271604
271597
  return { success: false, output: "", error: "aborted" };
271605
271598
  const isError2 = r2.output.startsWith("Error:");
@@ -271733,17 +271726,12 @@ MANDATORY: You MUST call task_complete on your next response. Do NOT call ${[...
271733
271726
 
271734
271727
  Call task_complete(summary="...") NOW with whatever you have.`
271735
271728
  });
271736
- const loopingToolNames = new Set([...freqMap.keys()].map((k) => k.split("(")[0]).filter(Boolean));
271737
- if (loopInterventionCount >= 2) {
271738
- this._loopBlockedTools = loopingToolNames;
271739
- }
271740
271729
  this.emit({
271741
271730
  type: "status",
271742
- content: `Loop intervention ${loopInterventionCount}/${maxInterventions}: ${Math.round(currentRepScore * 100)}% repetitive (${topRepeated})` + (loopInterventionCount >= 2 ? ` — tools removed from schema: ${[...loopingToolNames].join(", ")}` : ""),
271731
+ content: `Loop intervention ${loopInterventionCount}/${maxInterventions}: ${Math.round(currentRepScore * 100)}% repetitive (${topRepeated})`,
271743
271732
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
271744
271733
  });
271745
- } else if (currentRepScore <= 0.2 && this._loopBlockedTools?.size) {
271746
- this._loopBlockedTools = void 0;
271734
+ } else if (currentRepScore <= 0.2) {
271747
271735
  }
271748
271736
  } else {
271749
271737
  const content = msg.content || "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.274",
3
+ "version": "0.187.275",
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",