@botbotgo/agent-harness 0.0.445 → 0.0.447
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/package-version.d.ts +1 -1
- package/dist/package-version.js +1 -1
- package/dist/resources/prompts/runtime/required-execution-continuation.md +8 -0
- package/dist/runtime/adapter/flow/invocation-flow.js +3 -3
- package/dist/runtime/adapter/flow/stream-runtime.js +1 -1
- package/dist/runtime/adapter/invocation-result.js +1 -1
- package/dist/runtime/adapter/local-tool-invocation.js +4 -4
- package/dist/runtime/parsing/output-recovery.js +2 -2
- package/dist/runtime/prompts/runtime-prompts.d.ts +1 -1
- package/dist/runtime/prompts/runtime-prompts.js +1 -1
- package/package.json +1 -1
- package/dist/resources/prompts/runtime/autonomous-investigation-recovery.md +0 -10
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.447";
|
|
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.447";
|
|
2
2
|
export const AGENT_HARNESS_RELEASE_DATE = "2026-05-04";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
The runtime has already observed planning state, tool state, or delegated execution state for this request. Continue from that state instead of restarting the task, broadening the scope, or asking the user to choose the next step.
|
|
2
|
+
|
|
3
|
+
Use the current todo board, prior tool results, and available configured tools to choose one terminally useful action:
|
|
4
|
+
- If a todo board is incomplete and existing evidence is enough, update the remaining todo items to completed, blocked, or failed as appropriate, then provide the final answer grounded in the observed evidence.
|
|
5
|
+
- If more evidence is required and an available non-planning tool can get it, call that concrete tool next. Do not call write_todos or read_todos again before the evidence tool returns.
|
|
6
|
+
- If no available tool can resolve the remaining work, update the todo board to blocked or failed and return a blocker report with the evidence already gathered.
|
|
7
|
+
|
|
8
|
+
Never print a tool-call JSON object, function call, or tool name as prose when you intend to use a tool. Actually call the tool. Ask a blocking clarification question only after the available runtime evidence and configured tools are genuinely insufficient to continue.
|
|
@@ -8,10 +8,10 @@ import { UPSTREAM_REQUEST_CONFIG_KEY, UPSTREAM_SESSION_CONFIG_KEY } from "../ups
|
|
|
8
8
|
import { appendToolRecoveryInstruction, extractVisibleOutput, tryParseJson } from "../../parsing/output-parsing.js";
|
|
9
9
|
import { salvageJsonToolCalls } from "../../parsing/output-tool-args.js";
|
|
10
10
|
import { isEmptyFinalAiMessageError } from "../resilience.js";
|
|
11
|
-
import {
|
|
11
|
+
import { EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION, REQUIRED_EXECUTION_CONTINUATION_INSTRUCTION, WRITE_TODOS_REQUIRED_PLAN_INSTRUCTION, } from "../../prompts/runtime-prompts.js";
|
|
12
12
|
const CLOSE_REQUIRED_PLAN_RECOVERY_INSTRUCTION = [
|
|
13
13
|
"The current required todo board still has unfinished work.",
|
|
14
|
-
"Do not broaden the
|
|
14
|
+
"Do not broaden the task, restart planning, or ask the user what to do next.",
|
|
15
15
|
"Use the existing tool evidence already available in this run.",
|
|
16
16
|
"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.",
|
|
17
17
|
"After that write_todos call, provide the final answer required by the agent response format.",
|
|
@@ -381,7 +381,7 @@ export async function executeRequestInvocation(options) {
|
|
|
381
381
|
? result.messages
|
|
382
382
|
: undefined;
|
|
383
383
|
const recoveryBase = messages ? { messages } : request;
|
|
384
|
-
const recoveredRequest = appendToolRecoveryInstruction(recoveryBase,
|
|
384
|
+
const recoveredRequest = appendToolRecoveryInstruction(recoveryBase, REQUIRED_EXECUTION_CONTINUATION_INSTRUCTION);
|
|
385
385
|
const recoveredInvocation = await invokeOnce(recoveredRequest);
|
|
386
386
|
result = recoveredInvocation.result;
|
|
387
387
|
executedToolResults.splice(0, executedToolResults.length, ...recoveredInvocation.executedToolResults);
|
|
@@ -16,7 +16,7 @@ export class ExecutionReconciliationError extends Error {
|
|
|
16
16
|
}
|
|
17
17
|
const CLOSE_REQUIRED_PLAN_RECOVERY_INSTRUCTION = [
|
|
18
18
|
"The current required todo board still has unfinished work.",
|
|
19
|
-
"Do not broaden the
|
|
19
|
+
"Do not broaden the task, restart planning, or ask the user what to do next.",
|
|
20
20
|
"Use the existing tool evidence already available in this run.",
|
|
21
21
|
"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.",
|
|
22
22
|
"After that write_todos call, provide the final answer required by the agent response format.",
|
|
@@ -284,7 +284,7 @@ function extractDeterministicToolFailureReport(executedToolResults) {
|
|
|
284
284
|
return [
|
|
285
285
|
"Status: failed",
|
|
286
286
|
"Summary:",
|
|
287
|
-
"- The
|
|
287
|
+
"- The request could not proceed because required tools failed before any concrete evidence was gathered.",
|
|
288
288
|
"Likely Causes:",
|
|
289
289
|
"- none",
|
|
290
290
|
"Blockers:",
|
|
@@ -8,7 +8,7 @@ import { toolRequiresRuntimeApproval } from "./tool/tool-hitl.js";
|
|
|
8
8
|
import { validateToolGatewayInput } from "../harness/tool-gateway/index.js";
|
|
9
9
|
import { appendToolRecoveryInstruction, extractVisibleOutput, resolveMissingPlanRecoveryInstruction, resolveExecutionWithoutToolEvidenceTextInstruction, resolveToolCallRecoveryInstruction, sanitizeVisibleText, STRICT_TOOL_JSON_INSTRUCTION, } from "../parsing/output-parsing.js";
|
|
10
10
|
import { salvageJsonToolCalls } from "../parsing/output-tool-args.js";
|
|
11
|
-
import {
|
|
11
|
+
import { REQUIRED_EXECUTION_CONTINUATION_INSTRUCTION } from "../prompts/runtime-prompts.js";
|
|
12
12
|
const TOOL_FOLLOW_UP_INSTRUCTION = "One or more tool results are already available in this conversation. Answer the user's current request directly from the existing context and tool results. Do not ask the user to repeat inputs that are already present above.";
|
|
13
13
|
const DEFAULT_MAX_TOOL_ITERATIONS = 10_000;
|
|
14
14
|
const MAX_REPEATED_RECOVERY_WITHOUT_PROGRESS = 2;
|
|
@@ -188,7 +188,7 @@ function latestToolErrorRecoveryInstruction(executedToolResults) {
|
|
|
188
188
|
return null;
|
|
189
189
|
}
|
|
190
190
|
const message = typeof latest.output === "string" ? latest.output : JSON.stringify(latest.output);
|
|
191
|
-
return resolveToolCallRecoveryInstruction(new Error(message)) ??
|
|
191
|
+
return resolveToolCallRecoveryInstruction(new Error(message)) ?? REQUIRED_EXECUTION_CONTINUATION_INSTRUCTION;
|
|
192
192
|
}
|
|
193
193
|
function terminalToolErrorRecoveryInstruction(terminalText) {
|
|
194
194
|
return resolveToolCallRecoveryInstruction(new Error(terminalText));
|
|
@@ -386,7 +386,7 @@ export async function runLocalToolInvocationLoop({ binding, request, primaryTool
|
|
|
386
386
|
requiresPlan: requiresPlanEvidence(binding),
|
|
387
387
|
})
|
|
388
388
|
: shouldEnforceIncompletePlan
|
|
389
|
-
?
|
|
389
|
+
? REQUIRED_EXECUTION_CONTINUATION_INSTRUCTION
|
|
390
390
|
: null);
|
|
391
391
|
if (requiresPlanEvidence(binding)
|
|
392
392
|
&& !hasPlanStateEvidence(executedToolResults, externalPlanEvidence)
|
|
@@ -477,7 +477,7 @@ export async function runLocalToolInvocationLoop({ binding, request, primaryTool
|
|
|
477
477
|
executedToolResults,
|
|
478
478
|
});
|
|
479
479
|
}
|
|
480
|
-
activeRequest = appendToolRecoveryInstruction(activeRequest,
|
|
480
|
+
activeRequest = appendToolRecoveryInstruction(activeRequest, REQUIRED_EXECUTION_CONTINUATION_INSTRUCTION);
|
|
481
481
|
pendingResult = undefined;
|
|
482
482
|
continue;
|
|
483
483
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION, INTERNAL_RUNTIME_SPILL_PATH_INSTRUCTION, REQUIRED_EXECUTION_CONTINUATION_INSTRUCTION, STRICT_TOOL_JSON_INSTRUCTION, WORKSPACE_RELATIVE_PATH_INSTRUCTION, WRITE_TODOS_DESCRIPTIVE_CONTENT_INSTRUCTION, WRITE_TODOS_FULL_ENTRY_INSTRUCTION, WRITE_TODOS_NON_EMPTY_INITIAL_LIST_INSTRUCTION, WRITE_TODOS_REQUIRED_PLAN_INSTRUCTION, } from "../prompts/runtime-prompts.js";
|
|
2
2
|
import { wrapNormalizedMessage, readTextContent } from "./output-content.js";
|
|
3
3
|
import { salvageJsonToolCalls } from "./output-tool-args.js";
|
|
4
4
|
function collectRequestMessages(request) {
|
|
@@ -153,7 +153,7 @@ export function resolveExecutionWithoutToolEvidenceTextInstruction(request, assi
|
|
|
153
153
|
return null;
|
|
154
154
|
}
|
|
155
155
|
return hasExecutionEvidence
|
|
156
|
-
?
|
|
156
|
+
? REQUIRED_EXECUTION_CONTINUATION_INSTRUCTION
|
|
157
157
|
: EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION;
|
|
158
158
|
}
|
|
159
159
|
export function resolveToolCallRecoveryInstruction(error) {
|
|
@@ -10,7 +10,7 @@ export declare const WRITE_TODOS_DESCRIPTIVE_CONTENT_INSTRUCTION: string;
|
|
|
10
10
|
export declare const WRITE_TODOS_REQUIRED_PLAN_INSTRUCTION: string;
|
|
11
11
|
export declare const EXECUTION_WITH_TOOL_EVIDENCE_INSTRUCTION: string;
|
|
12
12
|
export declare const EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION: string;
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const REQUIRED_EXECUTION_CONTINUATION_INSTRUCTION: string;
|
|
14
14
|
export declare const DELEGATED_TASK_FAILURE_RECOVERY_INSTRUCTION: string;
|
|
15
15
|
export declare const DELEGATION_ONLY_RECOVERY_INSTRUCTION: string;
|
|
16
16
|
export declare const INTERNAL_RUNTIME_SPILL_PATH_INSTRUCTION: string;
|
|
@@ -13,7 +13,7 @@ export const WRITE_TODOS_DESCRIPTIVE_CONTENT_INSTRUCTION = readRuntimePrompt("wr
|
|
|
13
13
|
export const WRITE_TODOS_REQUIRED_PLAN_INSTRUCTION = readRuntimePrompt("write-todos-required-plan");
|
|
14
14
|
export const EXECUTION_WITH_TOOL_EVIDENCE_INSTRUCTION = readRuntimePrompt("execution-with-tool-evidence");
|
|
15
15
|
export const EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION = readRuntimePrompt("execution-with-tool-evidence-retry");
|
|
16
|
-
export const
|
|
16
|
+
export const REQUIRED_EXECUTION_CONTINUATION_INSTRUCTION = readRuntimePrompt("required-execution-continuation");
|
|
17
17
|
export const DELEGATED_TASK_FAILURE_RECOVERY_INSTRUCTION = readRuntimePrompt("delegated-task-failure-recovery");
|
|
18
18
|
export const DELEGATION_ONLY_RECOVERY_INSTRUCTION = readRuntimePrompt("delegation-only-recovery");
|
|
19
19
|
export const INTERNAL_RUNTIME_SPILL_PATH_INSTRUCTION = readRuntimePrompt("internal-runtime-spill-path");
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
Do not stop at a plan or ask the user to choose the next obvious diagnostic step when the request is for deep investigation, root-cause analysis, or step-by-step execution. Do not ask for more background, scope, logs, or environment details until you have first exhausted the context and tools already available in this runtime.
|
|
2
|
-
|
|
3
|
-
If no concrete execution has happened yet, start from the current workspace, shell, and attached runtime/tool context by default, then continue the investigation yourself with the next concrete tool call. If the user explicitly asked for a plan, or if the task is clearly non-trivial and multi-step, call write_todos first with concrete investigation/execution steps before any other tool call or final answer.
|
|
4
|
-
|
|
5
|
-
If a todo board already exists, do not restart planning and do not repeat the same clarification request. Use the current todo board and prior tool results to choose one of these terminally useful actions:
|
|
6
|
-
- If more evidence is genuinely needed and an available tool can get it, make the next concrete tool call.
|
|
7
|
-
- If the existing evidence is enough to answer, update the todo board to completed or blocked as appropriate, then provide the final answer grounded in the tool results.
|
|
8
|
-
- If the available tools cannot resolve the remaining work, update the todo board to blocked or failed and provide a blocker report with the evidence.
|
|
9
|
-
|
|
10
|
-
Never print a tool-call JSON object, function call, or tool name as prose when you intend to use a tool. Actually call the tool. Ask a blocking clarification question only after the available evidence is genuinely insufficient to continue.
|