titan-agent 5.4.1 → 5.4.2
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/agent/agent.js +1 -1
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/agentLoop.js +41 -11
- package/dist/agent/agentLoop.js.map +1 -1
- package/dist/agent/agentWakeup.js +8 -3
- package/dist/agent/agentWakeup.js.map +1 -1
- package/dist/agent/commandPost.js +6 -1
- package/dist/agent/commandPost.js.map +1 -1
- package/dist/agent/heartbeatScheduler.js +36 -4
- package/dist/agent/heartbeatScheduler.js.map +1 -1
- package/dist/agent/toolRunner.js +30 -0
- package/dist/agent/toolRunner.js.map +1 -1
- package/dist/config/schema.js +3 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/eval/record.js +1 -1
- package/dist/eval/record.js.map +1 -1
- package/dist/gateway/server.js +11 -0
- package/dist/gateway/server.js.map +1 -1
- package/dist/providers/router.js +17 -17
- package/dist/providers/router.js.map +1 -1
- package/dist/skills/registry.js +176 -163
- package/dist/skills/registry.js.map +1 -1
- package/dist/telemetry/activityLog.js +1 -1
- package/dist/telemetry/activityLog.js.map +1 -1
- package/docs/AGENT-HIERARCHY.md +154 -0
- package/docs/superpowers/plans/2026-04-29-titan-production-fix.md +241 -0
- package/package.json +2 -2
- package/scripts/start-workers.sh +39 -0
- package/scripts/task-feeder.ts +38 -0
package/dist/agent/agentLoop.js
CHANGED
|
@@ -947,7 +947,11 @@ Execute the next ACTION.` });
|
|
|
947
947
|
phase = "done";
|
|
948
948
|
break;
|
|
949
949
|
}
|
|
950
|
-
|
|
950
|
+
const isMultiStepPipeline = ctx.completionStrategy === "terminal-tool" || ctx.minRounds !== void 0;
|
|
951
|
+
const nudgeMinRounds = ctx.minRounds ?? (ctx.completionStrategy === "single-round" ? 1 : 2);
|
|
952
|
+
const nudgeMinRoundsMet = round >= nudgeMinRounds;
|
|
953
|
+
const nudgeEnabled = ctx.isAutonomous || isMultiStepPipeline && !nudgeMinRoundsMet;
|
|
954
|
+
if (nudgeEnabled && round < ctx.effectiveMaxRounds - 2) {
|
|
951
955
|
const futureIntentOpener = /^(let me\s+\w+|I['']?ll\s+(?:start|begin|check|look|read|run|edit|write|create|try|go|investigate|verify|test|install|build|fix|update|change|set)|I\s+(?:will|need to|should|can|am going to|plan to)\s+\w+|first,?\s+I|now\s+I|to\s+(?:fix|resolve|complete|edit|write|create|update|change|run))\b/i.test(response.content.trim());
|
|
952
956
|
const describesWork = /\b(?:I['']?ll|I (?:will|need to|should|plan to|am going to)|let me)\b[^.]{0,80}\b(?:fix|edit|change|update|create|write|modify|run|install|build|start|restart|read|open|debug|set up|check|look at|examine|investigate|verify|confirm|test)\b/i.test(response.content);
|
|
953
957
|
if (futureIntentOpener && describesWork && noToolsRetryCount < 3) {
|
|
@@ -1074,6 +1078,17 @@ ${gateText}` : gateText;
|
|
|
1074
1078
|
tr.diff
|
|
1075
1079
|
);
|
|
1076
1080
|
}
|
|
1081
|
+
const pendingApproval = toolResults.find((r) => r.approvalPending);
|
|
1082
|
+
if (pendingApproval) {
|
|
1083
|
+
logger.info(COMPONENT, `[ApprovalPause] Tool "${pendingApproval.name}" awaiting approval (req ${pendingApproval.approvalRequestId}) \u2014 exiting loop`);
|
|
1084
|
+
result.content = pendingApproval.content;
|
|
1085
|
+
ctx.messages.push({
|
|
1086
|
+
role: "assistant",
|
|
1087
|
+
content: `I need your approval before I can use ${pendingApproval.name}. ${pendingApproval.content}`
|
|
1088
|
+
});
|
|
1089
|
+
phase = "done";
|
|
1090
|
+
break;
|
|
1091
|
+
}
|
|
1077
1092
|
try {
|
|
1078
1093
|
const { getSubdirTracker } = await import("./subdirHints.js");
|
|
1079
1094
|
const tracker = getSubdirTracker(ctx.sessionId);
|
|
@@ -1360,17 +1375,32 @@ Examples: use read_file instead of cat/head/tail/grep, and edit_file instead of
|
|
|
1360
1375
|
}
|
|
1361
1376
|
}
|
|
1362
1377
|
} else {
|
|
1363
|
-
const
|
|
1364
|
-
const
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1378
|
+
const hasPipelineConfig = ctx.completionStrategy !== void 0 || ctx.minRounds !== void 0;
|
|
1379
|
+
const isMultiStep = hasPipelineConfig && (ctx.completionStrategy === "terminal-tool" || ctx.minRounds !== void 0);
|
|
1380
|
+
if (isMultiStep) {
|
|
1381
|
+
const defaultTerminals = ["write_file", "append_file", "fb_post", "fb_reply", "content_publish"];
|
|
1382
|
+
const terminalTools = new Set(ctx.pipelineTerminalTools || defaultTerminals);
|
|
1383
|
+
const terminalMissing = !toolResults.some((r) => terminalTools.has(r.name));
|
|
1384
|
+
if (terminalMissing && round < ctx.effectiveMaxRounds - 1) {
|
|
1385
|
+
logger.info(COMPONENT, `[NonAutonomous] Multi-step task needs terminal tool \u2014 staying in THINK`);
|
|
1386
|
+
ctx.messages.push({ role: "user", content: "Continue with the task. Call the required tool to finish." });
|
|
1387
|
+
phase = "think";
|
|
1388
|
+
} else {
|
|
1389
|
+
phase = "respond";
|
|
1390
|
+
}
|
|
1371
1391
|
} else {
|
|
1372
|
-
|
|
1373
|
-
|
|
1392
|
+
const discoveryTools = ["gallery_search", "tool_search"];
|
|
1393
|
+
const lastWasDiscovery = pendingToolCalls.length === 1 && discoveryTools.includes(pendingToolCalls[0].function.name);
|
|
1394
|
+
const resultHintsFollowUp = lastWasDiscovery && toolResults.some(
|
|
1395
|
+
(r) => /call gallery_get/i.test(r.content) || /hint:.*?(call|use|try|fetch|get|search)/i.test(r.content)
|
|
1396
|
+
);
|
|
1397
|
+
if (resultHintsFollowUp && round < ctx.effectiveMaxRounds - 1) {
|
|
1398
|
+
logger.info(COMPONENT, `[DiscoveryChain] ${pendingToolCalls[0].function.name} hinted follow-up \u2014 allowing another think round`);
|
|
1399
|
+
phase = "think";
|
|
1400
|
+
} else {
|
|
1401
|
+
phase = "respond";
|
|
1402
|
+
logger.info(COMPONENT, `[ThinkAct] Tools executed \u2014 entering respond phase (tools will be stripped)`);
|
|
1403
|
+
}
|
|
1374
1404
|
}
|
|
1375
1405
|
}
|
|
1376
1406
|
break;
|