@botbotgo/agent-harness 0.0.322 → 0.0.323
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/resource/backend/workspace-scoped-backend.js +3 -0
- package/dist/resources/prompts/runtime/internal-runtime-spill-path.md +1 -0
- package/dist/resources/tools/_runtime_tool_helpers.mjs +3 -0
- package/dist/runtime/adapter/tool/builtin-middleware-tools.js +3 -0
- package/dist/runtime/parsing/output-recovery.d.ts +2 -1
- package/dist/runtime/parsing/output-recovery.js +9 -2
- package/dist/runtime/prompts/runtime-prompts.d.ts +1 -0
- package/dist/runtime/prompts/runtime-prompts.js +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.322";
|
package/dist/package-version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export const AGENT_HARNESS_VERSION = "0.0.322";
|
|
@@ -34,6 +34,9 @@ export function normalizeWorkspaceScopedPath(rootDir, inputPath) {
|
|
|
34
34
|
if (typeof inputPath !== "string" || inputPath.length === 0 || !path.isAbsolute(inputPath)) {
|
|
35
35
|
return inputPath;
|
|
36
36
|
}
|
|
37
|
+
if (inputPath.startsWith("/large_tool_results/")) {
|
|
38
|
+
throw new Error(`Path '${inputPath}' is an internal runtime spill path, not a workspace file. Do not read internal runtime spill files such as '/large_tool_results/...'. Use the preview already in context, rerun the producing tool with narrower output, or write the needed data to a workspace-relative file instead.`);
|
|
39
|
+
}
|
|
37
40
|
if (inputPath === "/") {
|
|
38
41
|
return ".";
|
|
39
42
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The previous tool call tried to read an internal runtime spill path such as '/large_tool_results/...'. Do not read internal runtime spill files. Use the preview already present in the conversation, rerun the producing tool with narrower output if needed, or write the needed data to a workspace-relative file and read that file instead.
|
|
@@ -78,6 +78,9 @@ export function normalizeWorkspacePath(context, inputPath, fallback = ".") {
|
|
|
78
78
|
if (!workspaceRoot || !path.isAbsolute(rawPath)) {
|
|
79
79
|
return rawPath;
|
|
80
80
|
}
|
|
81
|
+
if (rawPath.startsWith("/large_tool_results/")) {
|
|
82
|
+
throw new Error(`Path '${rawPath}' is an internal runtime spill path, not a workspace file. Do not read internal runtime spill files such as '/large_tool_results/...'. Use the preview already in context, rerun the producing tool with narrower output, or write the needed data to a workspace-relative file instead.`);
|
|
83
|
+
}
|
|
81
84
|
const resolvedWorkspaceRoot = path.resolve(workspaceRoot);
|
|
82
85
|
const resolvedInputPath = path.resolve(rawPath);
|
|
83
86
|
if (resolvedInputPath === resolvedWorkspaceRoot || resolvedInputPath.startsWith(`${resolvedWorkspaceRoot}${path.sep}`)) {
|
|
@@ -97,6 +97,9 @@ function normalizeWorkspacePathOrThrow(backend, inputPath) {
|
|
|
97
97
|
if (!workspaceRoot || !path.isAbsolute(inputPath)) {
|
|
98
98
|
return inputPath;
|
|
99
99
|
}
|
|
100
|
+
if (inputPath.startsWith("/large_tool_results/")) {
|
|
101
|
+
throw new Error(`Path '${inputPath}' is an internal runtime spill path, not a workspace file. Do not read internal runtime spill files such as '/large_tool_results/...'. Use the preview already in context, rerun the producing tool with narrower output, or write the needed data to a workspace-relative file instead.`);
|
|
102
|
+
}
|
|
100
103
|
const normalizedWorkspaceRoot = path.resolve(workspaceRoot);
|
|
101
104
|
const normalizedInputPath = path.resolve(inputPath);
|
|
102
105
|
if (normalizedInputPath === normalizedWorkspaceRoot || normalizedInputPath.startsWith(`${normalizedWorkspaceRoot}${path.sep}`)) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare function isToolCallValidationFailure(error: unknown): boolean;
|
|
2
2
|
export declare function isWorkspacePathScopeFailure(error: unknown): boolean;
|
|
3
|
+
export declare function isInternalRuntimeSpillPathFailure(error: unknown): boolean;
|
|
3
4
|
export declare function isRepairableWriteTodosPlaceholderFailure(error: unknown): boolean;
|
|
4
5
|
export declare function isRepairableWriteTodosContentFailure(error: unknown): boolean;
|
|
5
6
|
export declare function isRepairableWriteTodosEmptyFailure(error: unknown): boolean;
|
|
@@ -11,4 +12,4 @@ export declare function resolveExecutionWithoutToolEvidenceTextInstruction(reque
|
|
|
11
12
|
export declare function resolveToolCallRecoveryInstruction(error: unknown): string | null;
|
|
12
13
|
export declare function appendToolRecoveryInstruction(input: unknown, instruction: string): unknown;
|
|
13
14
|
export declare function wrapResolvedModel<T>(value: T): T;
|
|
14
|
-
export { AUTONOMOUS_INVESTIGATION_RECOVERY_INSTRUCTION, BROWSER_CAPABILITY_DISCLAIMER_RECOVERY_INSTRUCTION, EXECUTION_WITH_TOOL_EVIDENCE_INSTRUCTION, EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION, INVALID_TOOL_SELECTION_RECOVERY_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 } from "../prompts/runtime-prompts.js";
|
|
15
|
+
export { AUTONOMOUS_INVESTIGATION_RECOVERY_INSTRUCTION, BROWSER_CAPABILITY_DISCLAIMER_RECOVERY_INSTRUCTION, EXECUTION_WITH_TOOL_EVIDENCE_INSTRUCTION, EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION, INTERNAL_RUNTIME_SPILL_PATH_INSTRUCTION, INVALID_TOOL_SELECTION_RECOVERY_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 } from "../prompts/runtime-prompts.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AUTONOMOUS_INVESTIGATION_RECOVERY_INSTRUCTION, BROWSER_CAPABILITY_DISCLAIMER_RECOVERY_INSTRUCTION, EXECUTION_WITH_TOOL_EVIDENCE_INSTRUCTION, EXECUTION_WITH_TOOL_EVIDENCE_RETRY_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, } from "../prompts/runtime-prompts.js";
|
|
1
|
+
import { AUTONOMOUS_INVESTIGATION_RECOVERY_INSTRUCTION, BROWSER_CAPABILITY_DISCLAIMER_RECOVERY_INSTRUCTION, EXECUTION_WITH_TOOL_EVIDENCE_INSTRUCTION, EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION, INTERNAL_RUNTIME_SPILL_PATH_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, } from "../prompts/runtime-prompts.js";
|
|
2
2
|
import { hasToolCalls, readTextContent, wrapNormalizedMessage } from "./output-content.js";
|
|
3
3
|
function isToolCallParseFailure(error) {
|
|
4
4
|
if (!(error instanceof Error))
|
|
@@ -52,6 +52,9 @@ function collectErrorMessages(error) {
|
|
|
52
52
|
export function isWorkspacePathScopeFailure(error) {
|
|
53
53
|
return collectErrorMessages(error).some((message) => /outside the workspace root|workspace-relative path/i.test(message));
|
|
54
54
|
}
|
|
55
|
+
export function isInternalRuntimeSpillPathFailure(error) {
|
|
56
|
+
return collectErrorMessages(error).some((message) => /\/large_tool_results\/|internal runtime spill path/i.test(message));
|
|
57
|
+
}
|
|
55
58
|
export function isRepairableWriteTodosPlaceholderFailure(error) {
|
|
56
59
|
if (!(error instanceof Error))
|
|
57
60
|
return false;
|
|
@@ -81,6 +84,7 @@ export function isToolCallRecoveryFailure(error) {
|
|
|
81
84
|
isToolCallValidationFailure(error) ||
|
|
82
85
|
isRepairableWriteTodosEmptyFailure(error) ||
|
|
83
86
|
isRepairableWriteTodosPlaceholderFailure(error) ||
|
|
87
|
+
isInternalRuntimeSpillPathFailure(error) ||
|
|
84
88
|
isWorkspacePathScopeFailure(error));
|
|
85
89
|
}
|
|
86
90
|
function extractMessageContent(message) {
|
|
@@ -305,6 +309,9 @@ export function resolveToolCallRecoveryInstruction(error) {
|
|
|
305
309
|
if (isRepairableWriteTodosPlaceholderFailure(error)) {
|
|
306
310
|
return WRITE_TODOS_DESCRIPTIVE_CONTENT_INSTRUCTION;
|
|
307
311
|
}
|
|
312
|
+
if (isInternalRuntimeSpillPathFailure(error)) {
|
|
313
|
+
return INTERNAL_RUNTIME_SPILL_PATH_INSTRUCTION;
|
|
314
|
+
}
|
|
308
315
|
if (isWorkspacePathScopeFailure(error)) {
|
|
309
316
|
return WORKSPACE_RELATIVE_PATH_INSTRUCTION;
|
|
310
317
|
}
|
|
@@ -375,4 +382,4 @@ export function wrapResolvedModel(value) {
|
|
|
375
382
|
},
|
|
376
383
|
});
|
|
377
384
|
}
|
|
378
|
-
export { AUTONOMOUS_INVESTIGATION_RECOVERY_INSTRUCTION, BROWSER_CAPABILITY_DISCLAIMER_RECOVERY_INSTRUCTION, EXECUTION_WITH_TOOL_EVIDENCE_INSTRUCTION, EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION, INVALID_TOOL_SELECTION_RECOVERY_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 } from "../prompts/runtime-prompts.js";
|
|
385
|
+
export { AUTONOMOUS_INVESTIGATION_RECOVERY_INSTRUCTION, BROWSER_CAPABILITY_DISCLAIMER_RECOVERY_INSTRUCTION, EXECUTION_WITH_TOOL_EVIDENCE_INSTRUCTION, EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION, INTERNAL_RUNTIME_SPILL_PATH_INSTRUCTION, INVALID_TOOL_SELECTION_RECOVERY_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 } from "../prompts/runtime-prompts.js";
|
|
@@ -10,6 +10,7 @@ export declare const WRITE_TODOS_DESCRIPTIVE_CONTENT_INSTRUCTION: string;
|
|
|
10
10
|
export declare const EXECUTION_WITH_TOOL_EVIDENCE_INSTRUCTION: string;
|
|
11
11
|
export declare const EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION: string;
|
|
12
12
|
export declare const AUTONOMOUS_INVESTIGATION_RECOVERY_INSTRUCTION: string;
|
|
13
|
+
export declare const INTERNAL_RUNTIME_SPILL_PATH_INSTRUCTION: string;
|
|
13
14
|
export declare const WORKSPACE_RELATIVE_PATH_INSTRUCTION: string;
|
|
14
15
|
export declare function renderDurableMemoryContextPrompt(memoryContext: string): string;
|
|
15
16
|
export declare function renderSlashCommandSkillInstruction(input: {
|
|
@@ -13,6 +13,7 @@ export const WRITE_TODOS_DESCRIPTIVE_CONTENT_INSTRUCTION = readRuntimePrompt("wr
|
|
|
13
13
|
export const EXECUTION_WITH_TOOL_EVIDENCE_INSTRUCTION = readRuntimePrompt("execution-with-tool-evidence");
|
|
14
14
|
export const EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION = readRuntimePrompt("execution-with-tool-evidence-retry");
|
|
15
15
|
export const AUTONOMOUS_INVESTIGATION_RECOVERY_INSTRUCTION = readRuntimePrompt("autonomous-investigation-recovery");
|
|
16
|
+
export const INTERNAL_RUNTIME_SPILL_PATH_INSTRUCTION = readRuntimePrompt("internal-runtime-spill-path");
|
|
16
17
|
export const WORKSPACE_RELATIVE_PATH_INSTRUCTION = readRuntimePrompt("workspace-relative-path");
|
|
17
18
|
export function renderDurableMemoryContextPrompt(memoryContext) {
|
|
18
19
|
return renderBundledTemplate("prompts/runtime/durable-memory-context.md", {
|