open-agents-ai 0.187.248 → 0.187.249
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 +26 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -326982,6 +326982,20 @@ function adaptTool6(tool) {
|
|
|
326982
326982
|
}
|
|
326983
326983
|
};
|
|
326984
326984
|
}
|
|
326985
|
+
function scanForSessionSignals(toolOutput) {
|
|
326986
|
+
if (/SESSION_ACTIVE\s*=\s*true/i.test(toolOutput)) {
|
|
326987
|
+
_interactiveSessionActive = true;
|
|
326988
|
+
_interactiveSessionReason = "An interactive session is active (SESSION_ACTIVE=true detected in tool output).";
|
|
326989
|
+
}
|
|
326990
|
+
if (/SESSION_ACTIVE\s*=\s*false/i.test(toolOutput) || /\"event\"\s*:\s*\"(?:call_ended|session_ended|disconnected|closed|terminated)\"/i.test(toolOutput)) {
|
|
326991
|
+
_interactiveSessionActive = false;
|
|
326992
|
+
_interactiveSessionReason = "";
|
|
326993
|
+
}
|
|
326994
|
+
}
|
|
326995
|
+
function resetSessionLock() {
|
|
326996
|
+
_interactiveSessionActive = false;
|
|
326997
|
+
_interactiveSessionReason = "";
|
|
326998
|
+
}
|
|
326985
326999
|
function createTaskCompleteTool(modelTier) {
|
|
326986
327000
|
const summaryDesc = modelTier === "small" || modelTier === "medium" ? "Your complete response to the user. For questions/chat: put your FULL answer here (this is what the user will see). For coding tasks: brief summary of what was accomplished." : "Brief summary of what was accomplished";
|
|
326987
327001
|
return {
|
|
@@ -326995,6 +327009,13 @@ function createTaskCompleteTool(modelTier) {
|
|
|
326995
327009
|
required: ["summary"]
|
|
326996
327010
|
},
|
|
326997
327011
|
async execute(args) {
|
|
327012
|
+
if (_interactiveSessionActive) {
|
|
327013
|
+
return {
|
|
327014
|
+
success: false,
|
|
327015
|
+
output: "",
|
|
327016
|
+
error: `task_complete BLOCKED — interactive session still active. ${_interactiveSessionReason} You MUST continue the interaction loop until the session ends. Do NOT call task_complete until you receive a termination signal (e.g. "ended", "disconnected", "closed", SESSION_ACTIVE=false). Resume the loop NOW.`
|
|
327017
|
+
};
|
|
327018
|
+
}
|
|
326998
327019
|
try {
|
|
326999
327020
|
const sessionId = getTodoSessionId();
|
|
327000
327021
|
const todos = readTodos(sessionId);
|
|
@@ -328415,6 +328436,7 @@ ${entry.fullContent}`
|
|
|
328415
328436
|
}
|
|
328416
328437
|
break;
|
|
328417
328438
|
case "tool_result": {
|
|
328439
|
+
if (event.content) scanForSessionSignals(String(event.content));
|
|
328418
328440
|
if (_apiCallbacks?.onToolResult) {
|
|
328419
328441
|
_apiCallbacks.onToolResult(
|
|
328420
328442
|
event.toolName ?? "unknown",
|
|
@@ -328669,6 +328691,7 @@ When done, either call task_complete with your answer, or use FINAL_VAR(variable
|
|
|
328669
328691
|
));
|
|
328670
328692
|
}
|
|
328671
328693
|
}
|
|
328694
|
+
resetSessionLock();
|
|
328672
328695
|
const promise = runner.run(effectiveTask, systemContext).then((result) => {
|
|
328673
328696
|
const tokens = { total: result.totalTokens, estimated: result.estimatedTokens };
|
|
328674
328697
|
contentWrite(() => {
|
|
@@ -332807,7 +332830,7 @@ Rules:
|
|
|
332807
332830
|
process.exit(1);
|
|
332808
332831
|
}
|
|
332809
332832
|
}
|
|
332810
|
-
var taskManager, _apiCallbacks, _shellToolRef, _replToolRef, _fullSubAgentToolRef, _agentToolRef, _sendMessageToolRef, _agentLifecycleMgr, _activeRunnerRef, _wireSubAgentCallbacks, _wireAgentToolCallbacks, _wireSubAgentToolCallbacks, _autoUpdatedThisSession, _mcpManager, _pluginManager, _mcpTools, SELF_IMPROVE_INTERVAL, _tasksSinceImprove;
|
|
332833
|
+
var _interactiveSessionActive, _interactiveSessionReason, taskManager, _apiCallbacks, _shellToolRef, _replToolRef, _fullSubAgentToolRef, _agentToolRef, _sendMessageToolRef, _agentLifecycleMgr, _activeRunnerRef, _wireSubAgentCallbacks, _wireAgentToolCallbacks, _wireSubAgentToolCallbacks, _autoUpdatedThisSession, _mcpManager, _pluginManager, _mcpTools, SELF_IMPROVE_INTERVAL, _tasksSinceImprove;
|
|
332811
332834
|
var init_interactive = __esm({
|
|
332812
332835
|
"packages/cli/src/tui/interactive.ts"() {
|
|
332813
332836
|
"use strict";
|
|
@@ -332853,6 +332876,8 @@ var init_interactive = __esm({
|
|
|
332853
332876
|
init_neovim_mode();
|
|
332854
332877
|
init_task_manager_singleton();
|
|
332855
332878
|
init_tui_tasks_renderer();
|
|
332879
|
+
_interactiveSessionActive = false;
|
|
332880
|
+
_interactiveSessionReason = "";
|
|
332856
332881
|
taskManager = new BackgroundTaskManager();
|
|
332857
332882
|
_apiCallbacks = null;
|
|
332858
332883
|
_shellToolRef = null;
|
package/package.json
CHANGED