@botbotgo/agent-harness 0.0.456 → 0.0.457
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.457";
|
|
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.457";
|
|
2
2
|
export const AGENT_HARNESS_RELEASE_DATE = "2026-05-04";
|
|
@@ -8,7 +8,7 @@ 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 { 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
14
|
"Do not broaden the task, restart planning, or ask the user what to do next.",
|
|
@@ -102,17 +102,6 @@ function hasNativeTaskDelegationIntent(value) {
|
|
|
102
102
|
}
|
|
103
103
|
return hasNativeTaskDelegationIntent(typed.tool_calls) || hasNativeTaskDelegationIntent(typed.messages);
|
|
104
104
|
}
|
|
105
|
-
function looksLikeCapabilityRefusalWithoutEvidence(value) {
|
|
106
|
-
const text = extractVisibleOutput(value).trim();
|
|
107
|
-
if (!text) {
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
const refusalSignal = /(?:cannot|can't|unable to|do not have|don't have|not support|does not support|missing capabilities|tool limitation|skill limitation|capability limitation|out of scope|无法|不能|不支持|缺少能力|能力不足|超出范围)/iu.test(text);
|
|
111
|
-
if (!refusalSignal) {
|
|
112
|
-
return false;
|
|
113
|
-
}
|
|
114
|
-
return /(?:tool|tools|skill|skills|capabilit|scope|工具|技能|能力|范围)/iu.test(text);
|
|
115
|
-
}
|
|
116
105
|
function readStructuredToolCall(value) {
|
|
117
106
|
const salvaged = salvageJsonToolCalls(value)[0];
|
|
118
107
|
if (salvaged) {
|
|
@@ -386,20 +375,6 @@ export async function executeRequestInvocation(options) {
|
|
|
386
375
|
result = recoveredInvocation.result;
|
|
387
376
|
executedToolResults.splice(0, executedToolResults.length, ...recoveredInvocation.executedToolResults);
|
|
388
377
|
}
|
|
389
|
-
if (options.resumePayload === undefined
|
|
390
|
-
&& primaryTools.length > 0
|
|
391
|
-
&& executedToolResults.length === 0
|
|
392
|
-
&& looksLikeCapabilityRefusalWithoutEvidence(result)) {
|
|
393
|
-
const messages = Array.isArray(result.messages)
|
|
394
|
-
? result.messages
|
|
395
|
-
: undefined;
|
|
396
|
-
const recoveryBase = messages ? { messages } : request;
|
|
397
|
-
const recoveredRequest = appendToolRecoveryInstruction(recoveryBase, EXECUTION_WITH_TOOL_EVIDENCE_RETRY_INSTRUCTION);
|
|
398
|
-
const recoveredInvocation = await invokeOnce(recoveredRequest);
|
|
399
|
-
localOrUpstreamInvocation = recoveredInvocation;
|
|
400
|
-
result = recoveredInvocation.result;
|
|
401
|
-
executedToolResults.splice(0, executedToolResults.length, ...recoveredInvocation.executedToolResults);
|
|
402
|
-
}
|
|
403
378
|
try {
|
|
404
379
|
return finalizeRequestResult({
|
|
405
380
|
bindingAgentId: options.binding.agent.id,
|