@botbotgo/agent-harness 0.0.370 → 0.0.372
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.372";
|
|
2
2
|
export declare const AGENT_HARNESS_RELEASE_DATE = "2026-04-30";
|
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.372";
|
|
2
2
|
export const AGENT_HARNESS_RELEASE_DATE = "2026-04-30";
|
|
@@ -12,6 +12,13 @@ export class ExecutionReconciliationError extends Error {
|
|
|
12
12
|
this.name = "ExecutionReconciliationError";
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
+
const CLOSE_REQUIRED_PLAN_RECOVERY_INSTRUCTION = [
|
|
16
|
+
"The current required todo board still has unfinished work.",
|
|
17
|
+
"Do not broaden the investigation, restart planning, or ask the user what to do next.",
|
|
18
|
+
"Use the existing tool evidence already available in this run.",
|
|
19
|
+
"Your next action must be write_todos: update every remaining pending or in_progress item to completed if evidence was gathered, or failed if it cannot be completed with the available tools.",
|
|
20
|
+
"After that write_todos call, provide the final answer required by the agent response format.",
|
|
21
|
+
].join("\n");
|
|
15
22
|
function toVisibleContent(value) {
|
|
16
23
|
const extracted = extractVisibleOutput(value);
|
|
17
24
|
return extracted ? sanitizeVisibleText(extracted) : "";
|
|
@@ -528,10 +535,15 @@ export async function* streamRuntimeExecution(options) {
|
|
|
528
535
|
const streamedExecutionEvidence = buildExecutionRecoveryEvidence({ projectionState });
|
|
529
536
|
const streamedDelegatedRecoveryInstruction = resolveDelegatedExecutionRecoveryInstruction(streamedExecutionEvidence);
|
|
530
537
|
const streamedDelegationOnlyRecoveryInstruction = resolveDelegationOnlyRecoveryInstruction(options.binding, streamedExecutionEvidence);
|
|
538
|
+
const streamedIncompletePlanRecoveryInstruction = requiresPlanEvidence(options.binding) && streamedExecutionEvidence.hasIncompletePlanState
|
|
539
|
+
? CLOSE_REQUIRED_PLAN_RECOVERY_INSTRUCTION
|
|
540
|
+
: null;
|
|
531
541
|
const delegatedExecutionRecoveryInstruction = !emittedUnsafeStreamSideEffects || streamedDelegatedRecoveryInstruction
|
|
532
542
|
? streamedDelegatedRecoveryInstruction
|
|
533
543
|
: null;
|
|
534
|
-
if (hasUnresolvedExecution(streamedExecutionEvidence)
|
|
544
|
+
if (hasUnresolvedExecution(streamedExecutionEvidence)
|
|
545
|
+
&& !delegatedExecutionRecoveryInstruction
|
|
546
|
+
&& !streamedIncompletePlanRecoveryInstruction) {
|
|
535
547
|
throw createUnresolvedExecutionError(streamedExecutionEvidence);
|
|
536
548
|
}
|
|
537
549
|
const executionWithoutToolEvidenceInstruction = projectionState.emittedOutput
|
|
@@ -557,6 +569,7 @@ export async function* streamRuntimeExecution(options) {
|
|
|
557
569
|
const retryInstruction = !emittedUnsafeStreamSideEffects && sawRetrySafeInvalidToolSelectionError
|
|
558
570
|
? INVALID_TOOL_SELECTION_RECOVERY_INSTRUCTION
|
|
559
571
|
: delegatedExecutionRecoveryInstruction
|
|
572
|
+
?? streamedIncompletePlanRecoveryInstruction
|
|
560
573
|
?? streamedRuntimeFailureRecoveryInstruction
|
|
561
574
|
?? missingPlanRecoveryInstruction
|
|
562
575
|
?? streamedDelegationOnlyRecoveryInstruction
|
|
@@ -776,7 +789,11 @@ export async function* streamRuntimeExecution(options) {
|
|
|
776
789
|
})
|
|
777
790
|
: null;
|
|
778
791
|
const invokeFallbackDelegationOnlyRecoveryInstruction = resolveDelegationOnlyRecoveryInstruction(options.binding, invokeExecutionEvidence);
|
|
779
|
-
const
|
|
792
|
+
const invokeFallbackIncompletePlanRecoveryInstruction = requiresPlanEvidence(options.binding) && invokeExecutionEvidence.hasIncompletePlanState
|
|
793
|
+
? CLOSE_REQUIRED_PLAN_RECOVERY_INSTRUCTION
|
|
794
|
+
: null;
|
|
795
|
+
const effectiveInvokeFallbackRecoveryInstruction = invokeFallbackIncompletePlanRecoveryInstruction
|
|
796
|
+
?? invokeFallbackMissingPlanRecoveryInstruction
|
|
780
797
|
?? invokeFallbackDelegationOnlyRecoveryInstruction
|
|
781
798
|
?? invokeFallbackRecoveryInstruction;
|
|
782
799
|
if (effectiveInvokeFallbackRecoveryInstruction) {
|
|
@@ -1142,8 +1142,15 @@ export class AgentRuntimeAdapter {
|
|
|
1142
1142
|
formatCompactDelegationReportForDisplay(report) {
|
|
1143
1143
|
const readStringArray = (key) => {
|
|
1144
1144
|
const value = report[key];
|
|
1145
|
+
const reportText = typeof report.report === "string" ? report.report.trim() : "";
|
|
1145
1146
|
return Array.isArray(value)
|
|
1146
|
-
? value.filter((item) =>
|
|
1147
|
+
? value.filter((item) => {
|
|
1148
|
+
if (typeof item !== "string") {
|
|
1149
|
+
return false;
|
|
1150
|
+
}
|
|
1151
|
+
const trimmed = item.trim();
|
|
1152
|
+
return trimmed.length > 0 && trimmed !== reportText;
|
|
1153
|
+
})
|
|
1147
1154
|
: [];
|
|
1148
1155
|
};
|
|
1149
1156
|
const lines = [];
|
|
@@ -90,6 +90,7 @@ function stripVisibleFunctionLikeToolCallText(value) {
|
|
|
90
90
|
}
|
|
91
91
|
export function sanitizeVisibleText(value) {
|
|
92
92
|
return stripVisibleFunctionLikeToolCallText(value
|
|
93
|
+
.replace(/\u001B\[[0-?]*[ -/]*[@-~]/g, "")
|
|
93
94
|
.replace(/<agent_memory>[\s\S]*?<\/agent_memory>/giu, "")
|
|
94
95
|
.replace(/<agent_memory>[\s\S]*$/giu, "")
|
|
95
96
|
.replace(/[A-Za-z0-9_]*Middleware\.after_model/g, "")
|