@botbotgo/agent-harness 0.0.442 → 0.0.444
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.444";
|
|
2
2
|
export declare const AGENT_HARNESS_RELEASE_DATE = "2026-05-04";
|
package/dist/package-version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export const AGENT_HARNESS_VERSION = "0.0.444";
|
|
2
2
|
export const AGENT_HARNESS_RELEASE_DATE = "2026-05-04";
|
|
@@ -45,13 +45,13 @@ function buildDelegatedPlanEvidenceBlocker(agentId) {
|
|
|
45
45
|
routing: [`delegated agent ${agentId}`],
|
|
46
46
|
plan: ["delegate to specialist", "require visible TODO planning evidence", "return blocker when planning evidence is absent"],
|
|
47
47
|
execution: [`task delegated to ${agentId}`, `delegated agent ${agentId} ended before producing required TODO plan evidence`],
|
|
48
|
-
todoTrace: [
|
|
48
|
+
todoTrace: [`${agentId}: TODO evidence missing; delegated agent ended before producing required planning evidence.`],
|
|
49
49
|
stepResults: ["delegated planning evidence was not observed"],
|
|
50
50
|
summary: [`Delegated agent ${agentId} ended before producing the required TODO plan evidence.`],
|
|
51
51
|
findings: ["The delegated run did not expose a valid planning trace, so the framework cannot treat the task as complete."],
|
|
52
52
|
blockers: ["missing delegated TODO planning evidence"],
|
|
53
53
|
nextActions: ["Retry with the same request or inspect the delegated agent configuration and model/tool-call behavior."],
|
|
54
|
-
report: `routing delegated to ${agentId}; todoTrace missing; stepResults blocked; summary missing planning evidence; findings require retry; blockers missing TODO planning evidence; nextActions inspect delegated model/tool behavior; report task delegated to ${agentId}.`,
|
|
54
|
+
report: `routing delegated to ${agentId}; todoTrace ${agentId}: TODO evidence missing; stepResults blocked; summary missing planning evidence; findings require retry; blockers missing TODO planning evidence; nextActions inspect delegated model/tool behavior; report task delegated to ${agentId}.`,
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
function buildDelegatedExecutionEvidenceBlocker(agentId, expectedToolNames = []) {
|
|
@@ -65,7 +65,7 @@ function buildDelegatedExecutionEvidenceBlocker(agentId, expectedToolNames = [])
|
|
|
65
65
|
`expected evidence tools: ${expectedTools}`,
|
|
66
66
|
`delegated agent ${agentId} did not return any non-planning tool evidence after retry`,
|
|
67
67
|
],
|
|
68
|
-
todoTrace: [
|
|
68
|
+
todoTrace: [`${agentId}: TODO evidence observed; delegated planning board did not produce completed non-planning evidence.`],
|
|
69
69
|
stepResults: ["delegated execution evidence was not observed"],
|
|
70
70
|
summary: [`Delegated agent ${agentId} did not return any non-planning tool evidence after retry.`],
|
|
71
71
|
findings: [
|
|
@@ -75,7 +75,7 @@ function buildDelegatedExecutionEvidenceBlocker(agentId, expectedToolNames = [])
|
|
|
75
75
|
],
|
|
76
76
|
blockers: ["missing delegated non-planning tool evidence"],
|
|
77
77
|
nextActions: ["Retry the request or inspect the delegated agent's model/tool-call behavior."],
|
|
78
|
-
report: `routing delegated to ${agentId}; todoTrace observed planning
|
|
78
|
+
report: `routing delegated to ${agentId}; todoTrace ${agentId}: TODO evidence observed but non-planning evidence missing; stepResults blocked; summary missing non-planning tool evidence; findings expected evidence tools ${expectedTools}; blockers missing execution evidence; nextActions inspect delegated model/tool behavior; report task delegated to ${agentId}.`,
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
function normalizePlanToolName(toolName) {
|
|
@@ -1562,8 +1562,8 @@ export class AgentRuntimeAdapter {
|
|
|
1562
1562
|
const fallbackTodoTrace = [
|
|
1563
1563
|
`1) TODO observed: delegated to ${delegatedSubagentType}.`,
|
|
1564
1564
|
uniqueToolNames.some((toolName) => isPlanToolName(toolName))
|
|
1565
|
-
?
|
|
1566
|
-
:
|
|
1565
|
+
? `2) ${delegatedSubagentType}: TODO evidence observed; delegated specialist invoked write_todos.`
|
|
1566
|
+
: `2) ${delegatedSubagentType}: TODO evidence missing; delegated specialist did not expose write_todos in returned metadata.`,
|
|
1567
1567
|
state === "failed"
|
|
1568
1568
|
? "3) TODO closed: delegated execution failed; blocker reported."
|
|
1569
1569
|
: "3) TODO closed: delegated execution completed; synthesis returned.",
|
|
@@ -35,17 +35,23 @@ function planStateHasUnfinishedItems(planState) {
|
|
|
35
35
|
function planStateHasActiveItems(planState) {
|
|
36
36
|
return planStateHasUnfinishedItems(planState);
|
|
37
37
|
}
|
|
38
|
+
function isPlanToolName(toolName) {
|
|
39
|
+
const normalized = typeof toolName === "string" ? toolName.trim().toLowerCase().replace(/[\s-]+/gu, "_") : "";
|
|
40
|
+
return normalized === "write_todos"
|
|
41
|
+
|| normalized === "read_todos"
|
|
42
|
+
|| normalized === "tool_call_write_todos"
|
|
43
|
+
|| normalized === "tool_call_read_todos"
|
|
44
|
+
|| normalized === "call_write_todos"
|
|
45
|
+
|| normalized === "call_read_todos";
|
|
46
|
+
}
|
|
38
47
|
function isSubstantiveTerminalAssistantOutput(value) {
|
|
39
48
|
const normalized = sanitizeVisibleText(value).trim();
|
|
40
49
|
if (normalized.length < 80) {
|
|
41
50
|
return false;
|
|
42
51
|
}
|
|
43
|
-
if (/\b(?:delegated|waiting|wait for|initiated)\b/i.test(normalized) && !/\b(?:finding|summary|root cause|evidence|completed|result|issue)\b/i.test(normalized)) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
52
|
return true;
|
|
47
53
|
}
|
|
48
|
-
function inferPlanItemStatusFromTerminalAssistantOutput(value) {
|
|
54
|
+
function inferPlanItemStatusFromTerminalAssistantOutput(value, options = {}) {
|
|
49
55
|
const terminalStatus = readTerminalExecutionStatus(value);
|
|
50
56
|
if (terminalStatus) {
|
|
51
57
|
return mapTerminalStatusToPlanItemStatus(terminalStatus);
|
|
@@ -54,12 +60,12 @@ function inferPlanItemStatusFromTerminalAssistantOutput(value) {
|
|
|
54
60
|
if (!normalized) {
|
|
55
61
|
return null;
|
|
56
62
|
}
|
|
57
|
-
if (normalized.startsWith("runtime_error=")
|
|
58
|
-
|| /\bterminated\b/i.test(normalized)
|
|
59
|
-
|| /\b(?:blocked|blocker|failed|failure|refused|unable to complete|could not complete)\b/i.test(normalized)
|
|
60
|
-
|| /(?:执行失败|未能完成|无法完成|阻塞|失败)/u.test(normalized)) {
|
|
63
|
+
if (normalized.startsWith("runtime_error=")) {
|
|
61
64
|
return "failed";
|
|
62
65
|
}
|
|
66
|
+
if (options.hasSuccessfulExecutionEvidence !== true) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
63
69
|
return isSubstantiveTerminalAssistantOutput(value) ? "completed" : null;
|
|
64
70
|
}
|
|
65
71
|
function mapTerminalStatusToObservedPlanItemStatus(status, sawSuccessfulToolResult) {
|
|
@@ -678,6 +684,7 @@ export async function* streamHarnessRun(options) {
|
|
|
678
684
|
let syntheticFallback;
|
|
679
685
|
const toolErrors = [];
|
|
680
686
|
let sawSuccessfulToolResult = false;
|
|
687
|
+
let sawSuccessfulExecutionToolResult = false;
|
|
681
688
|
let lastToolResultKey = null;
|
|
682
689
|
const executedToolResults = [];
|
|
683
690
|
const emittedCommentary = new Set();
|
|
@@ -876,6 +883,9 @@ export async function* streamHarnessRun(options) {
|
|
|
876
883
|
}
|
|
877
884
|
else {
|
|
878
885
|
sawSuccessfulToolResult = true;
|
|
886
|
+
if (!isPlanToolName(normalizedChunk.toolName) && normalizedChunk.toolName !== "task") {
|
|
887
|
+
sawSuccessfulExecutionToolResult = true;
|
|
888
|
+
}
|
|
879
889
|
}
|
|
880
890
|
yield {
|
|
881
891
|
type: "tool-result",
|
|
@@ -1058,14 +1068,16 @@ export async function* streamHarnessRun(options) {
|
|
|
1058
1068
|
}
|
|
1059
1069
|
currentPlanState = await refreshPlanStateFromPersistence(options, currentPlanState);
|
|
1060
1070
|
const explicitTerminalAssistantStatus = readTerminalExecutionStatus(assistantOutput);
|
|
1061
|
-
let terminalAssistantPlanItemStatus = inferPlanItemStatusFromTerminalAssistantOutput(assistantOutput
|
|
1062
|
-
|
|
1071
|
+
let terminalAssistantPlanItemStatus = inferPlanItemStatusFromTerminalAssistantOutput(assistantOutput, {
|
|
1072
|
+
hasSuccessfulExecutionEvidence: sawSuccessfulExecutionToolResult,
|
|
1073
|
+
});
|
|
1074
|
+
if (explicitTerminalAssistantStatus === "blocked" && sawSuccessfulExecutionToolResult) {
|
|
1063
1075
|
terminalAssistantPlanItemStatus = "completed";
|
|
1064
1076
|
}
|
|
1065
1077
|
if (terminalAssistantPlanItemStatus === "failed"
|
|
1066
|
-
&&
|
|
1078
|
+
&& sawSuccessfulExecutionToolResult
|
|
1067
1079
|
&& !explicitTerminalAssistantStatus
|
|
1068
|
-
&&
|
|
1080
|
+
&& !sanitizeVisibleText(assistantOutput).trim().toLowerCase().startsWith("runtime_error=")
|
|
1069
1081
|
&& assistantOutput.trim()) {
|
|
1070
1082
|
terminalAssistantPlanItemStatus = "completed";
|
|
1071
1083
|
}
|