@botbotgo/agent-harness 0.0.460 → 0.0.462
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.462";
|
|
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.462";
|
|
2
2
|
export const AGENT_HARNESS_RELEASE_DATE = "2026-05-04";
|
|
@@ -7,7 +7,6 @@ import { salvageJsonToolCalls } from "./parsing/output-tool-args.js";
|
|
|
7
7
|
import { extractMessageText } from "../utils/message-content.js";
|
|
8
8
|
import { AGENT_INTERRUPT_SENTINEL_PREFIX, buildDeepAgentCreateParams, buildDeepAgentSystemPromptWithCapabilityCatalog, buildLangChainCreateParams, DEFAULT_DEEPAGENT_RECURSION_LIMIT, materializeModelExposedBuiltinMiddlewareTools, resolveLangChainInvocationConfig, resolveRunnableCheckpointer, resolveRunnableInterruptOn, shouldAttachDeepAgentBackend, shouldAttachDeepAgentCheckpointer, shouldAttachDeepAgentStore, } from "./agent-runtime-assembly.js";
|
|
9
9
|
import { resolveDeepAgentSkillSourcePaths, resolveDeepAgentSkillSourceRootPaths, } from "./adapter/compat/deepagent-compat.js";
|
|
10
|
-
import { EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION } from "./prompts/runtime-prompts.js";
|
|
11
10
|
import { buildToolNameMapping, } from "./adapter/tool/tool-name-mapping.js";
|
|
12
11
|
import { executeRequestInvocation } from "./adapter/flow/invocation-flow.js";
|
|
13
12
|
import { streamRuntimeExecution } from "./adapter/flow/stream-runtime.js";
|
|
@@ -25,16 +24,6 @@ export { buildAuthOmittingFetch, normalizeOpenAICompatibleInit } from "./adapter
|
|
|
25
24
|
export { buildToolNameMapping, createModelFacingToolNameCandidates, createModelFacingToolNameLookupCandidates, resolveModelFacingToolName, sanitizeToolNameForModel, } from "./adapter/tool/tool-name-mapping.js";
|
|
26
25
|
export { computeRemainingTimeoutMs, isRetryableProviderError, resolveBindingTimeout, resolveProviderRetryPolicy, resolveStreamIdleTimeout, resolveTimeoutMs, } from "./adapter/resilience.js";
|
|
27
26
|
import { getBindingAdapterKind, getBindingBuiltinToolsConfig, getBindingDeepAgentSubagents, getBindingExecutionParams, getBindingExecutionKind, getBindingFilesystemConfig, getBindingMemorySources, getBindingPrimaryModel, getBindingSkills, getBindingSubagents, getBindingToolCount, getBindingPrimaryTools, getBindingSystemPrompt, isDeepAgentBinding, isLangChainBinding, } from "./support/compiled-binding.js";
|
|
28
|
-
function hasDelegatedExecutionToolEvidence(result) {
|
|
29
|
-
const executedToolResults = Array.isArray(result.metadata?.executedToolResults)
|
|
30
|
-
? result.metadata.executedToolResults
|
|
31
|
-
: [];
|
|
32
|
-
return executedToolResults.some((toolResult) => (toolResult.isError !== true
|
|
33
|
-
&& !isPlanToolName(toolResult.toolName)));
|
|
34
|
-
}
|
|
35
|
-
function hasRequiredDelegatedExecutionToolEvidence(result) {
|
|
36
|
-
return hasDelegatedExecutionToolEvidence(result);
|
|
37
|
-
}
|
|
38
27
|
function buildDelegatedPlanEvidenceBlocker(agentId) {
|
|
39
28
|
return JSON.stringify({
|
|
40
29
|
status: "blocked",
|
|
@@ -50,30 +39,6 @@ function buildDelegatedPlanEvidenceBlocker(agentId) {
|
|
|
50
39
|
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}.`,
|
|
51
40
|
});
|
|
52
41
|
}
|
|
53
|
-
function buildDelegatedExecutionEvidenceBlocker(agentId, expectedToolNames = []) {
|
|
54
|
-
const expectedTools = expectedToolNames.length > 0 ? expectedToolNames.join(", ") : "configured non-planning tools";
|
|
55
|
-
return JSON.stringify({
|
|
56
|
-
status: "blocked",
|
|
57
|
-
routing: [`delegated agent ${agentId}`],
|
|
58
|
-
plan: ["delegate to specialist", "require non-planning tool evidence", "return blocker when evidence is absent"],
|
|
59
|
-
execution: [
|
|
60
|
-
`task delegated to ${agentId}`,
|
|
61
|
-
`expected evidence tools: ${expectedTools}`,
|
|
62
|
-
`delegated agent ${agentId} did not return any non-planning tool evidence after retry`,
|
|
63
|
-
],
|
|
64
|
-
todoTrace: [`${agentId}: TODO evidence observed; delegated planning board did not produce completed non-planning evidence.`],
|
|
65
|
-
stepResults: ["delegated execution evidence was not observed"],
|
|
66
|
-
summary: [`Delegated agent ${agentId} did not return any non-planning tool evidence after retry.`],
|
|
67
|
-
findings: [
|
|
68
|
-
`Expected evidence tools from configuration: ${expectedTools}.`,
|
|
69
|
-
"The TODO board alone is not execution evidence.",
|
|
70
|
-
"The framework cannot mark the delegated task complete without a non-planning tool result or an explicit blocker from that tool path.",
|
|
71
|
-
],
|
|
72
|
-
blockers: ["missing delegated non-planning tool evidence"],
|
|
73
|
-
nextActions: ["Retry the request or inspect the delegated agent's model/tool-call behavior."],
|
|
74
|
-
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}.`,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
42
|
function normalizePlanToolName(toolName) {
|
|
78
43
|
return typeof toolName === "string" ? toolName.trim().toLowerCase().replace(/[\s-]+/gu, "_") : "";
|
|
79
44
|
}
|
|
@@ -342,6 +307,12 @@ const DELEGATED_PLAN_EVIDENCE_RETRY_INSTRUCTION = [
|
|
|
342
307
|
"Before any other tool call or final answer, call write_todos with concrete task steps and statuses.",
|
|
343
308
|
"Then continue the task to completion, update TODO statuses after evidence steps, and close every TODO as completed or failed before the final answer.",
|
|
344
309
|
].join("\n");
|
|
310
|
+
const DELEGATED_PLAN_EVIDENCE_FINAL_RETRY_INSTRUCTION = [
|
|
311
|
+
"The delegated task still has no visible TODO planning evidence.",
|
|
312
|
+
"Use the actual write_todos tool interface now. Do not print JSON, markdown, or a tool-call transcript as text.",
|
|
313
|
+
"The next runtime event must be the write_todos tool call result, not an assistant message describing the call.",
|
|
314
|
+
"After write_todos succeeds, continue the delegated task and close every TODO as completed or failed.",
|
|
315
|
+
].join("\n");
|
|
345
316
|
function looksLikeRawCommandTranscript(value) {
|
|
346
317
|
const normalized = value.trim();
|
|
347
318
|
return /^(?:stdout|stderr)\s*:/iu.test(normalized)
|
|
@@ -1639,14 +1610,6 @@ export class AgentRuntimeAdapter {
|
|
|
1639
1610
|
const previousDelegatedResult = delegatedResult;
|
|
1640
1611
|
delegatedResult = mergeDelegatedResultToolEvidence(yield* runPlannedDelegation(planned.subagentType, [delegatedText, DELEGATED_PLAN_EVIDENCE_RETRY_INSTRUCTION].filter(Boolean).join("\n\n"), ":plan-evidence-retry"), previousDelegatedResult);
|
|
1641
1612
|
}
|
|
1642
|
-
const targetRequiresExecutionToolEvidence = selectedBinding ? getBindingPrimaryTools(selectedBinding).length > 0 : false;
|
|
1643
|
-
if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(delegatedResult)) {
|
|
1644
|
-
const previousDelegatedResult = delegatedResult;
|
|
1645
|
-
delegatedResult = mergeDelegatedResultToolEvidence(yield* runPlannedDelegation(planned.subagentType, [
|
|
1646
|
-
delegatedText,
|
|
1647
|
-
EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION,
|
|
1648
|
-
].filter(Boolean).join("\n\n"), ":tool-evidence-retry"), previousDelegatedResult);
|
|
1649
|
-
}
|
|
1650
1613
|
if (selectedBinding?.harnessRuntime.executionContract?.requiresPlan === true && !hasDelegatedPlanEvidence(delegatedResult)) {
|
|
1651
1614
|
const output = buildDelegatedPlanEvidenceBlocker(selectedBinding.agent.id);
|
|
1652
1615
|
delegatedResult = {
|
|
@@ -1656,15 +1619,6 @@ export class AgentRuntimeAdapter {
|
|
|
1656
1619
|
finalMessageText: output,
|
|
1657
1620
|
};
|
|
1658
1621
|
}
|
|
1659
|
-
if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(delegatedResult)) {
|
|
1660
|
-
const output = buildDelegatedExecutionEvidenceBlocker(selectedBinding.agent.id, getBindingPrimaryTools(selectedBinding).map((tool) => tool.name));
|
|
1661
|
-
delegatedResult = {
|
|
1662
|
-
...delegatedResult,
|
|
1663
|
-
state: "failed",
|
|
1664
|
-
output,
|
|
1665
|
-
finalMessageText: output,
|
|
1666
|
-
};
|
|
1667
|
-
}
|
|
1668
1622
|
const delegatedToolResults = Array.isArray(delegatedResult.metadata?.executedToolResults)
|
|
1669
1623
|
? delegatedResult.metadata.executedToolResults
|
|
1670
1624
|
: [];
|
|
@@ -1849,18 +1803,15 @@ export class AgentRuntimeAdapter {
|
|
|
1849
1803
|
originalRequest: requestText,
|
|
1850
1804
|
});
|
|
1851
1805
|
let delegatedResult = yield* runDelegatedStreamAttempt(delegatedText);
|
|
1852
|
-
const targetRequiresExecutionToolEvidence = getBindingPrimaryTools(selectedBinding).length > 0;
|
|
1853
1806
|
if (selectedBinding.harnessRuntime.executionContract?.requiresPlan === true
|
|
1854
1807
|
&& !hasDelegatedPlanEvidence(delegatedResult)) {
|
|
1855
1808
|
const previousDelegatedResult = delegatedResult;
|
|
1856
1809
|
delegatedResult = mergeDelegatedResultToolEvidence(yield* runDelegatedStreamAttempt([delegatedText, DELEGATED_PLAN_EVIDENCE_RETRY_INSTRUCTION].filter(Boolean).join("\n\n"), ":plan-evidence-retry"), previousDelegatedResult);
|
|
1857
1810
|
}
|
|
1858
|
-
if (
|
|
1811
|
+
if (selectedBinding.harnessRuntime.executionContract?.requiresPlan === true
|
|
1812
|
+
&& !hasDelegatedPlanEvidence(delegatedResult)) {
|
|
1859
1813
|
const previousDelegatedResult = delegatedResult;
|
|
1860
|
-
delegatedResult = mergeDelegatedResultToolEvidence(yield* runDelegatedStreamAttempt([
|
|
1861
|
-
delegatedText,
|
|
1862
|
-
EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION,
|
|
1863
|
-
].filter(Boolean).join("\n\n"), ":tool-evidence-retry"), previousDelegatedResult);
|
|
1814
|
+
delegatedResult = mergeDelegatedResultToolEvidence(yield* runDelegatedStreamAttempt([delegatedText, DELEGATED_PLAN_EVIDENCE_FINAL_RETRY_INSTRUCTION].filter(Boolean).join("\n\n"), ":plan-evidence-final-retry"), previousDelegatedResult);
|
|
1864
1815
|
}
|
|
1865
1816
|
if (selectedBinding.harnessRuntime.executionContract?.requiresPlan === true
|
|
1866
1817
|
&& !hasDelegatedPlanEvidence(delegatedResult)) {
|
|
@@ -1872,15 +1823,6 @@ export class AgentRuntimeAdapter {
|
|
|
1872
1823
|
finalMessageText: output,
|
|
1873
1824
|
};
|
|
1874
1825
|
}
|
|
1875
|
-
if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(delegatedResult)) {
|
|
1876
|
-
const output = buildDelegatedExecutionEvidenceBlocker(selectedBinding.agent.id, getBindingPrimaryTools(selectedBinding).map((tool) => tool.name));
|
|
1877
|
-
delegatedResult = {
|
|
1878
|
-
...delegatedResult,
|
|
1879
|
-
state: "failed",
|
|
1880
|
-
output,
|
|
1881
|
-
finalMessageText: output,
|
|
1882
|
-
};
|
|
1883
|
-
}
|
|
1884
1826
|
const delegatedToolResults = Array.isArray(delegatedResult.metadata?.executedToolResults)
|
|
1885
1827
|
? delegatedResult.metadata.executedToolResults
|
|
1886
1828
|
: [];
|