open-agents-ai 0.187.273 → 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.
- package/dist/index.js +29 -29
- 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
|
-
|
|
269817
|
-
//
|
|
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.
|
|
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
|
-
|
|
271600
|
-
if (!matchTc)
|
|
271601
|
-
|
|
271602
|
-
|
|
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})
|
|
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
|
|
271746
|
-
this._loopBlockedTools = void 0;
|
|
271734
|
+
} else if (currentRepScore <= 0.2) {
|
|
271747
271735
|
}
|
|
271748
271736
|
} else {
|
|
271749
271737
|
const content = msg.content || "";
|
|
@@ -329288,6 +329276,7 @@ function startTask(task, config, repoRoot, voice, stream, taskStores, bruteForce
|
|
|
329288
329276
|
const modelTier = getModelTier(config.model);
|
|
329289
329277
|
const projectCtx = buildProjectContext(repoRoot, taskStores?.contextStores);
|
|
329290
329278
|
let dynamicContext = formatContextForPrompt(projectCtx, modelTier);
|
|
329279
|
+
let _autoJumpedThisStream = false;
|
|
329291
329280
|
const environmentProvider = () => {
|
|
329292
329281
|
try {
|
|
329293
329282
|
let env2 = formatSnapshotForContext(collectSnapshot(repoRoot));
|
|
@@ -330085,6 +330074,7 @@ ${entry.fullContent}`
|
|
|
330085
330074
|
case "stream_start":
|
|
330086
330075
|
streamStartMs = Date.now();
|
|
330087
330076
|
streamTextBuffer = "";
|
|
330077
|
+
_autoJumpedThisStream = false;
|
|
330088
330078
|
if (!isNeovimActive()) {
|
|
330089
330079
|
if (stream?.enabled) {
|
|
330090
330080
|
if (statusBar?.isActive) statusBar.beginContentWrite();
|
|
@@ -330103,6 +330093,15 @@ ${entry.fullContent}`
|
|
|
330103
330093
|
writeToNeovimOutput(event.content);
|
|
330104
330094
|
}
|
|
330105
330095
|
} else if (stream?.enabled) {
|
|
330096
|
+
if (statusBar?.isActive && statusBar.isScrolledBack && !_autoJumpedThisStream) {
|
|
330097
|
+
if ((event.streamKind ?? "content") === "thinking") {
|
|
330098
|
+
try {
|
|
330099
|
+
statusBar.jumpToLive();
|
|
330100
|
+
} catch {
|
|
330101
|
+
}
|
|
330102
|
+
_autoJumpedThisStream = true;
|
|
330103
|
+
}
|
|
330104
|
+
}
|
|
330106
330105
|
stream.renderer.write(
|
|
330107
330106
|
event.content ?? "",
|
|
330108
330107
|
event.streamKind ?? "content"
|
|
@@ -331191,6 +331190,7 @@ ${opts.systemPromptAddition}` : `Working directory: ${repoRoot}`;
|
|
|
331191
331190
|
let adminSessionKey = null;
|
|
331192
331191
|
const callSubAgents = /* @__PURE__ */ new Map();
|
|
331193
331192
|
const streamRenderer = new StreamRenderer();
|
|
331193
|
+
let _autoJumpedThisStream = false;
|
|
331194
331194
|
if (savedSettings.voice) {
|
|
331195
331195
|
if (savedSettings.voiceModel) {
|
|
331196
331196
|
voiceEngine.modelId = savedSettings.voiceModel;
|
package/package.json
CHANGED