open-agents-ai 0.187.274 → 0.187.276
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 +19 -30
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -263380,8 +263380,9 @@ function checkConstraints(toolName, args) {
|
|
|
263380
263380
|
if (!matchesFile)
|
|
263381
263381
|
continue;
|
|
263382
263382
|
}
|
|
263383
|
+
const coerced = c7.action === "block" ? { ...c7, action: "warn" } : c7;
|
|
263383
263384
|
violations.push({
|
|
263384
|
-
constraint:
|
|
263385
|
+
constraint: coerced,
|
|
263385
263386
|
matched: argsStr.slice(0, 200)
|
|
263386
263387
|
});
|
|
263387
263388
|
}
|
|
@@ -269813,8 +269814,8 @@ var init_agenticRunner = __esm({
|
|
|
269813
269814
|
this._embeddingTimer = null;
|
|
269814
269815
|
}
|
|
269815
269816
|
}
|
|
269816
|
-
|
|
269817
|
-
//
|
|
269817
|
+
// Never block tools: we rely on guidance and repetition handling rather than
|
|
269818
|
+
// modifying the available tool set.
|
|
269818
269819
|
// -- Session Checkpointing (Priority 5) --
|
|
269819
269820
|
_sessionId = `session-${Date.now()}`;
|
|
269820
269821
|
_workingDirectory = "";
|
|
@@ -270501,18 +270502,6 @@ TASK: ${task}` : task;
|
|
|
270501
270502
|
let toolDefs = await this.buildToolDefinitions();
|
|
270502
270503
|
const baseInstructions = getSystemPromptForTier(this.options.modelTier);
|
|
270503
270504
|
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
270505
|
let textToolModeActive = this.options.textToolMode ?? false;
|
|
270517
270506
|
if (textToolModeActive) {
|
|
270518
270507
|
const toolDescriptions = Array.from(this.tools.values()).map((t2) => `- ${t2.name}: ${t2.description}`).join("\n");
|
|
@@ -270551,7 +270540,6 @@ TASK: ${task}` : task;
|
|
|
270551
270540
|
this._hookDenyHintCount = 0;
|
|
270552
270541
|
this._selfConsistencyVotes = 0;
|
|
270553
270542
|
this._retrievalContextCache = null;
|
|
270554
|
-
this._loopBlockedTools = void 0;
|
|
270555
270543
|
this._lastTodoWriteTurn = -1;
|
|
270556
270544
|
this._lastTodoReminderTurn = -1;
|
|
270557
270545
|
let pendingConstraintWarnings = [];
|
|
@@ -271494,9 +271482,7 @@ ${memoryLines.join("\n")}`
|
|
|
271494
271482
|
}
|
|
271495
271483
|
const consecutiveSameTool = Math.max(sameToolFailStreak, this._taskState.failedApproaches.slice(-2).filter((f2) => f2.startsWith(`${tc.name}(`)).length);
|
|
271496
271484
|
if (sameToolFailStreak >= 5 && (this.options.modelTier === "small" || this.options.modelTier === "medium")) {
|
|
271497
|
-
this.
|
|
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.`);
|
|
271485
|
+
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
271486
|
sameToolFailStreak = 0;
|
|
271501
271487
|
sameToolFailName = null;
|
|
271502
271488
|
}
|
|
@@ -271596,10 +271582,18 @@ Then use file_read on individual FILES inside it.`);
|
|
|
271596
271582
|
const rawToolCalls = msg.toolCalls;
|
|
271597
271583
|
if (this.options.streamEnabled && this._streamingExecutor.hasTools) {
|
|
271598
271584
|
this._streamingExecutor.setExecutor(async (name10, args) => {
|
|
271599
|
-
|
|
271600
|
-
if (!matchTc)
|
|
271601
|
-
|
|
271602
|
-
|
|
271585
|
+
let matchTc = rawToolCalls.find((tc) => tc.name === name10 && JSON.stringify(tc.arguments) === JSON.stringify(args)) ?? rawToolCalls.find((tc) => tc.name === name10);
|
|
271586
|
+
if (!matchTc) {
|
|
271587
|
+
const synthId = globalThis.crypto?.randomUUID?.() || `call_${Date.now()}`;
|
|
271588
|
+
matchTc = { id: synthId, name: name10, arguments: args };
|
|
271589
|
+
messages2.push({
|
|
271590
|
+
role: "assistant",
|
|
271591
|
+
content: null,
|
|
271592
|
+
tool_calls: [{ id: synthId, type: "function", function: { name: name10, arguments: JSON.stringify(args) } }]
|
|
271593
|
+
});
|
|
271594
|
+
}
|
|
271595
|
+
const tcToRun = matchTc;
|
|
271596
|
+
const r2 = await executeSingle(tcToRun);
|
|
271603
271597
|
if (!r2)
|
|
271604
271598
|
return { success: false, output: "", error: "aborted" };
|
|
271605
271599
|
const isError2 = r2.output.startsWith("Error:");
|
|
@@ -271733,17 +271727,12 @@ MANDATORY: You MUST call task_complete on your next response. Do NOT call ${[...
|
|
|
271733
271727
|
|
|
271734
271728
|
Call task_complete(summary="...") NOW with whatever you have.`
|
|
271735
271729
|
});
|
|
271736
|
-
const loopingToolNames = new Set([...freqMap.keys()].map((k) => k.split("(")[0]).filter(Boolean));
|
|
271737
|
-
if (loopInterventionCount >= 2) {
|
|
271738
|
-
this._loopBlockedTools = loopingToolNames;
|
|
271739
|
-
}
|
|
271740
271730
|
this.emit({
|
|
271741
271731
|
type: "status",
|
|
271742
|
-
content: `Loop intervention ${loopInterventionCount}/${maxInterventions}: ${Math.round(currentRepScore * 100)}% repetitive (${topRepeated})
|
|
271732
|
+
content: `Loop intervention ${loopInterventionCount}/${maxInterventions}: ${Math.round(currentRepScore * 100)}% repetitive (${topRepeated})`,
|
|
271743
271733
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
271744
271734
|
});
|
|
271745
|
-
} else if (currentRepScore <= 0.2
|
|
271746
|
-
this._loopBlockedTools = void 0;
|
|
271735
|
+
} else if (currentRepScore <= 0.2) {
|
|
271747
271736
|
}
|
|
271748
271737
|
} else {
|
|
271749
271738
|
const content = msg.content || "";
|
package/package.json
CHANGED