@botbotgo/agent-harness 0.0.461 → 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)
|
|
@@ -1832,18 +1803,15 @@ export class AgentRuntimeAdapter {
|
|
|
1832
1803
|
originalRequest: requestText,
|
|
1833
1804
|
});
|
|
1834
1805
|
let delegatedResult = yield* runDelegatedStreamAttempt(delegatedText);
|
|
1835
|
-
const targetRequiresExecutionToolEvidence = getBindingPrimaryTools(selectedBinding).length > 0;
|
|
1836
1806
|
if (selectedBinding.harnessRuntime.executionContract?.requiresPlan === true
|
|
1837
1807
|
&& !hasDelegatedPlanEvidence(delegatedResult)) {
|
|
1838
1808
|
const previousDelegatedResult = delegatedResult;
|
|
1839
1809
|
delegatedResult = mergeDelegatedResultToolEvidence(yield* runDelegatedStreamAttempt([delegatedText, DELEGATED_PLAN_EVIDENCE_RETRY_INSTRUCTION].filter(Boolean).join("\n\n"), ":plan-evidence-retry"), previousDelegatedResult);
|
|
1840
1810
|
}
|
|
1841
|
-
if (
|
|
1811
|
+
if (selectedBinding.harnessRuntime.executionContract?.requiresPlan === true
|
|
1812
|
+
&& !hasDelegatedPlanEvidence(delegatedResult)) {
|
|
1842
1813
|
const previousDelegatedResult = delegatedResult;
|
|
1843
|
-
delegatedResult = mergeDelegatedResultToolEvidence(yield* runDelegatedStreamAttempt([
|
|
1844
|
-
delegatedText,
|
|
1845
|
-
EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION,
|
|
1846
|
-
].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);
|
|
1847
1815
|
}
|
|
1848
1816
|
if (selectedBinding.harnessRuntime.executionContract?.requiresPlan === true
|
|
1849
1817
|
&& !hasDelegatedPlanEvidence(delegatedResult)) {
|
|
@@ -1855,15 +1823,6 @@ export class AgentRuntimeAdapter {
|
|
|
1855
1823
|
finalMessageText: output,
|
|
1856
1824
|
};
|
|
1857
1825
|
}
|
|
1858
|
-
if (targetRequiresExecutionToolEvidence && !hasRequiredDelegatedExecutionToolEvidence(delegatedResult)) {
|
|
1859
|
-
const output = buildDelegatedExecutionEvidenceBlocker(selectedBinding.agent.id, getBindingPrimaryTools(selectedBinding).map((tool) => tool.name));
|
|
1860
|
-
delegatedResult = {
|
|
1861
|
-
...delegatedResult,
|
|
1862
|
-
state: "failed",
|
|
1863
|
-
output,
|
|
1864
|
-
finalMessageText: output,
|
|
1865
|
-
};
|
|
1866
|
-
}
|
|
1867
1826
|
const delegatedToolResults = Array.isArray(delegatedResult.metadata?.executedToolResults)
|
|
1868
1827
|
? delegatedResult.metadata.executedToolResults
|
|
1869
1828
|
: [];
|