@ai-sdk/harness 1.0.150 → 1.0.151
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/CHANGELOG.md +9 -0
- package/dist/agent/index.d.ts +6 -5
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +172 -44
- package/dist/agent/index.js.map +1 -1
- package/dist/bridge/index.d.ts +18 -1
- package/dist/bridge/index.d.ts.map +1 -1
- package/dist/bridge/index.js +51 -1
- package/dist/bridge/index.js.map +1 -1
- package/dist/index.d.ts +3 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/index.d.ts +24 -3
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +164 -4
- package/dist/utils/index.js.map +1 -1
- package/package.json +3 -3
- package/src/agent/harness-agent-tool-approval-continuation.ts +7 -1
- package/src/agent/internal/harness-stream-text-result.ts +24 -1
- package/src/agent/internal/run-prompt.ts +148 -54
- package/src/bridge/index.ts +4 -0
- package/src/utils/convert-harness-tool-model-output.ts +66 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/normalize-harness-tool-model-output.ts +66 -0
- package/src/v1/harness-v1-prompt-control.ts +3 -0
- package/src/v1/harness-v1-stream-part.ts +10 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @ai-sdk/harness
|
|
2
2
|
|
|
3
|
+
## 1.0.151
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6c65131: feat(harness): consistently support parallel and sequential tool approvals
|
|
8
|
+
- 1bebfcf: feat(harness): add support for tools with `toModelOutput()` transformation
|
|
9
|
+
- Updated dependencies [9523eb0]
|
|
10
|
+
- ai@7.0.140
|
|
11
|
+
|
|
3
12
|
## 1.0.150
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -341,6 +341,9 @@ type HarnessV1PromptControl = {
|
|
|
341
341
|
/**
|
|
342
342
|
* Provide a result for a `tool-call` the adapter emitted. The adapter
|
|
343
343
|
* forwards the result to the underlying runtime so the model can continue.
|
|
344
|
+
* `output` is the raw execution result for consumer-facing events. When
|
|
345
|
+
* `toolResult` is present, its output is the model-facing representation
|
|
346
|
+
* and takes precedence when constructing the runtime's tool response.
|
|
344
347
|
*/
|
|
345
348
|
submitToolResult(input: {
|
|
346
349
|
toolCallId: string;
|
|
@@ -662,11 +665,6 @@ type HarnessV1StreamPart = {
|
|
|
662
665
|
type: 'tool-input-end';
|
|
663
666
|
}> | (LanguageModelV4ToolCall & {
|
|
664
667
|
nativeName?: string;
|
|
665
|
-
/**
|
|
666
|
-
* Total tool calls in the current model step, when known before tool
|
|
667
|
-
* execution begins. Populate this on every tool call in the step.
|
|
668
|
-
*/
|
|
669
|
-
stepToolCallCount?: number;
|
|
670
668
|
}) | LanguageModelV4ToolApprovalRequest | LanguageModelV4ToolResult | {
|
|
671
669
|
type: 'finish-step';
|
|
672
670
|
finishReason: LanguageModelV4FinishReason;
|
|
@@ -2014,6 +2012,9 @@ export declare function createHarnessSandboxTemplate(options: {
|
|
|
2014
2012
|
* locally to find the original tool call before it can resume the paused turn.
|
|
2015
2013
|
* Responses that already have a tool result are ignored, because those
|
|
2016
2014
|
* approvals were already consumed by a prior continuation.
|
|
2015
|
+
* An `execution-denied` result is synthesized by `convertToModelMessages`
|
|
2016
|
+
* for a newly denied approval; it does not mean the harness has received
|
|
2017
|
+
* the decision, so that approval response must still continue the turn.
|
|
2017
2018
|
*/
|
|
2018
2019
|
export declare function collectHarnessAgentToolApprovalContinuations(input: {
|
|
2019
2020
|
messages: readonly ModelMessage[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["SandboxSession","SandboxSession","SandboxSession","SandboxSession","Output","Output","Output","SandboxSession","Output","SandboxSession","SandboxSession","symbol","symbol"],"sources":["../../src/v1/harness-v1-bootstrap.ts","../../src/v1/harness-v1-network-sandbox-session.ts","../../src/v1/harness-v1-diagnostic.ts","../../src/v1/harness-v1-observability.ts","../../src/v1/harness-v1-permission-mode.ts","../../src/v1/harness-v1-prompt.ts","../../src/v1/harness-v1-prompt-control.ts","../../src/v1/harness-v1-response-format.ts","../../src/v1/harness-v1-skill.ts","../../src/v1/harness-v1-tool-spec.ts","../../src/v1/harness-v1-lifecycle-state.ts","../../src/v1/harness-v1-call-warning.ts","../../src/v1/harness-v1-metadata.ts","../../src/v1/harness-v1-stream-part.ts","../../src/v1/harness-v1-message.ts","../../src/v1/harness-v1-tool-filtering.ts","../../src/v1/harness-v1-session.ts","../../src/v1/harness-v1.ts","../../src/v1/harness-v1-builtin-tool.ts","../../src/v1/harness-v1-sandbox-provider.ts","../../src/v1/harness-v1-sandbox-template.ts","../../src/agent/observability/types.ts","../../src/agent/harness-agent-types.ts","../../src/agent/harness-agent-tool-types.ts","../../src/agent/harness-agent-settings.ts","../../src/agent/internal/turn-telemetry.ts","../../src/agent/harness-agent-session.ts","../../src/agent/harness-agent.ts","../../src/agent/create-harness-sandbox-template.ts","../../src/agent/harness-agent-tool-approval-continuation.ts","../../src/agent/harness-agent-tool-result-continuation.ts","../../src/agent/prepare-harness-sandbox-template.ts","../../src/agent/prepare-sandbox-for-harness.ts","../../src/errors/harness-error.ts","../../src/errors/harness-capability-unsupported-error.ts","../../src/errors/harness-sandbox-authentication-error.ts","../../src/agent/get-harness-error-message.ts","../../src/agent/observability/file-reporter.ts","../../src/agent/observability/trace-tree-reporter.ts"],"mappings":";;;;;;;;;;;;UAMiB;WACN;WACA;;;;;;;UAQM;WACN;;;;;;;;UASM;;;;;WAKN;;;;;;;;WASA;;WAGA,OAAO,cAAc;;WAGrB,UAAU,cAAc;;;;;;;;KCvCvB;WACD;WACA,UAAU,SAAS;;;;;;;;;;;;;UAqCb,uCAAuCA;;;;;WAK7C;;;;;;;;;;WAWA;;WAGA,OAAO;;;;;WAMP,kBA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AC3D,mBAAmB;aACR;;;;;;wBCdG,2CAA2C;EACzD,mBAAmB;aACR;;;KCOR,2BAA2B,KAAK;;;;;;;;;;;;;;;wBAgBf,8BAA8B;WACzC,SAAS;WACT,iBAAiB;WACjB,gBAAgB;WAChB,cAAc;IACrB;;qBAuDS,uBAAc;;;;KCxEf;WACD;WACA,kBAAkB;WAClB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;wBAwBR,yBAAyB;WACpC,SAASC;WACT,WAAW,cAAc;WACzB,gBAAgB;WAChB,cAAc;IACrB,QAAQ;;;cC9CNC;;;;;;qBAOO,qBAAqB;oBACdA;EAEN,cAAE,SAAS;IAAW;IAAiB;;SAI5C,WAAW,iBAAiB,SAAS;;;;cCbxCC;;;;;;;;;;qBAWO,0CAA0C;oBACnCA;WAET;EAEG,cACV,SACA,WACA;IAEA;IACA;IACA;;SAOK,WACL,iBACC,SAAS;;;;cChCR;;;;;;;qBAQO,0CAA0C;oBACnC;WAET;EAEG,cACV,SACA,mBACA;IAEA;IACA;IACA;;SAOK,WACL,iBACC,SAAS;;;;;;;;;;wBCtBE,uBAAuB;;;;;;;;;;;;;;UCGtB;;EAEf;;;;;;EAMA;;EAEA;;KAKU,eAAe,YAAY;wBAQvB,mBAAmB,SAAS,sBAAsB;;;;;;;;;;UC7BjD;;EAEf,SAAS;;wBAUK,wBACd,UAAS,2BACR"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["SandboxSession","SandboxSession","SandboxSession","SandboxSession","Output","Output","Output","SandboxSession","Output","SandboxSession","SandboxSession","symbol","symbol"],"sources":["../../src/v1/harness-v1-bootstrap.ts","../../src/v1/harness-v1-network-sandbox-session.ts","../../src/v1/harness-v1-diagnostic.ts","../../src/v1/harness-v1-observability.ts","../../src/v1/harness-v1-permission-mode.ts","../../src/v1/harness-v1-prompt.ts","../../src/v1/harness-v1-prompt-control.ts","../../src/v1/harness-v1-response-format.ts","../../src/v1/harness-v1-skill.ts","../../src/v1/harness-v1-tool-spec.ts","../../src/v1/harness-v1-lifecycle-state.ts","../../src/v1/harness-v1-call-warning.ts","../../src/v1/harness-v1-metadata.ts","../../src/v1/harness-v1-stream-part.ts","../../src/v1/harness-v1-message.ts","../../src/v1/harness-v1-tool-filtering.ts","../../src/v1/harness-v1-session.ts","../../src/v1/harness-v1.ts","../../src/v1/harness-v1-builtin-tool.ts","../../src/v1/harness-v1-sandbox-provider.ts","../../src/v1/harness-v1-sandbox-template.ts","../../src/agent/observability/types.ts","../../src/agent/harness-agent-types.ts","../../src/agent/harness-agent-tool-types.ts","../../src/agent/harness-agent-settings.ts","../../src/agent/internal/turn-telemetry.ts","../../src/agent/harness-agent-session.ts","../../src/agent/harness-agent.ts","../../src/agent/create-harness-sandbox-template.ts","../../src/agent/harness-agent-tool-approval-continuation.ts","../../src/agent/harness-agent-tool-result-continuation.ts","../../src/agent/prepare-harness-sandbox-template.ts","../../src/agent/prepare-sandbox-for-harness.ts","../../src/errors/harness-error.ts","../../src/errors/harness-capability-unsupported-error.ts","../../src/errors/harness-sandbox-authentication-error.ts","../../src/agent/get-harness-error-message.ts","../../src/agent/observability/file-reporter.ts","../../src/agent/observability/trace-tree-reporter.ts"],"mappings":";;;;;;;;;;;;UAMiB;WACN;WACA;;;;;;;UAQM;WACN;;;;;;;;UASM;;;;;WAKN;;;;;;;;WASA;;WAGA,OAAO,cAAc;;WAGrB,UAAU,cAAc;;;;;;;;KCvCvB;WACD;WACA,UAAU,SAAS;;;;;;;;;;;;;UAqCb,uCAAuCA;;;;;WAK7C;;;;;;;;;;WAWA;;WAGA,OAAO;;;;;WAMP,kBAAkB;IACzB;IACA;QACI,YAAY;;;;;;WAOT,aAAa;IACpB;IACA;QACI;;WAGG,YAAY;;;;;;;;WASZ,eAAe;;;;;;;WAQf,oBACP,QAAQ,2BACL;;;;;;;;;;WAWI,6BACP,iBAAiB,cAAc,oCAC5B;;;;;;;WAQI,6BACP,iBAAiB,cAAc,oCAC5B;;;;;;WAOI,YACP,OAAO,uBACP;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;;;;;;;;;;;wBAwBR,yBAAyB;WACpC,SAASC;WACT,WAAW,cAAc;WACzB,gBAAgB;WAChB,cAAc;IACrB,QAAQ;;;cC9CNC;;;;;;qBAOO,qBAAqB;oBACdA;EAEN,cAAE,SAAS;IAAW;IAAiB;;SAI5C,WAAW,iBAAiB,SAAS;;;;cCbxCC;;;;;;;;;;qBAWO,0CAA0C;oBACnCA;WAET;EAEG,cACV,SACA,WACA;IAEA;IACA;IACA;;SAOK,WACL,iBACC,SAAS;;;;cChCR;;;;;;;qBAQO,0CAA0C;oBACnC;WAET;EAEG,cACV,SACA,mBACA;IAEA;IACA;IACA;;SAOK,WACL,iBACC,SAAS;;;;;;;;;;wBCtBE,uBAAuB;;;;;;;;;;;;;;UCGtB;;EAEf;;;;;;EAMA;;EAEA;;KAKU,eAAe,YAAY;wBAQvB,mBAAmB,SAAS,sBAAsB;;;;;;;;;;UC7BjD;;EAEf,SAAS;;wBAUK,wBACd,UAAS,2BACR"}
|
package/dist/agent/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AISDKError, getErrorMessage } from "@ai-sdk/provider";
|
|
2
|
-
import { DelayedPromise, asArray, asSchema, executeTool, generateId, isExecutableTool, normalizeHeaders, safeParseJSON, safeValidateTypes, validateTypes } from "@ai-sdk/provider-utils";
|
|
2
|
+
import { DelayedPromise, asArray, asSchema, convertInlineFileDataToUint8Array, convertUint8ArrayToBase64, detectMediaType, executeTool, generateId, getTopLevelMediaType, isExecutableTool, isFullMediaType, normalizeHeaders, safeParseJSON, safeValidateTypes, validateTypes } from "@ai-sdk/provider-utils";
|
|
3
3
|
import path, { posix } from "node:path";
|
|
4
|
-
import { DefaultStepResult, addLanguageModelUsage, asLanguageModelUsage, createAsyncIterableStream, createNullLanguageModelUsage, createRestrictedTelemetryDispatcher, mergeCallbacks, parseToolCall, toResponseMessages, validateToolContext } from "ai/internal";
|
|
4
|
+
import { DefaultStepResult, addLanguageModelUsage, asLanguageModelUsage, createAsyncIterableStream, createNullLanguageModelUsage, createRestrictedTelemetryDispatcher, createToolModelOutput, mergeCallbacks, parseToolCall, toResponseMessages, validateToolContext } from "ai/internal";
|
|
5
5
|
import { NoSuchToolError, createUIMessageStreamResponse, toUIMessageStream } from "ai";
|
|
6
6
|
import { appendFileSync, mkdirSync } from "node:fs";
|
|
7
7
|
//#region src/errors/harness-error.ts
|
|
@@ -226,6 +226,9 @@ async function toHarnessStream(options) {
|
|
|
226
226
|
* and throw a clear error.
|
|
227
227
|
*/
|
|
228
228
|
var HarnessStreamTextResult = class {
|
|
229
|
+
setToolModelOutput(input) {
|
|
230
|
+
this.toolModelOutputs.set(input.toolCallId, input.output);
|
|
231
|
+
}
|
|
229
232
|
constructor(options) {
|
|
230
233
|
this._content = new DelayedPromise();
|
|
231
234
|
this._text = new DelayedPromise();
|
|
@@ -256,6 +259,7 @@ var HarnessStreamTextResult = class {
|
|
|
256
259
|
this.currentStepWarnings = [];
|
|
257
260
|
this.stepNumber = 0;
|
|
258
261
|
this.stepStarted = false;
|
|
262
|
+
this.toolModelOutputs = /* @__PURE__ */ new Map();
|
|
259
263
|
this.accumulatedUsage = createNullLanguageModelUsage();
|
|
260
264
|
this.finalProviderMetadata = void 0;
|
|
261
265
|
this.finalFinishReason = "other";
|
|
@@ -451,10 +455,19 @@ var HarnessStreamTextResult = class {
|
|
|
451
455
|
this._request.resolve(finalStep.request);
|
|
452
456
|
this._response.resolve(finalStep.response);
|
|
453
457
|
this._providerMetadata.resolve(this.finalProviderMetadata);
|
|
458
|
+
const responseTools = {};
|
|
459
|
+
for (const [name, tool] of Object.entries(this.tools)) responseTools[name] = {
|
|
460
|
+
...tool,
|
|
461
|
+
toModelOutput: (options) => this.toolModelOutputs.get(options.toolCallId) ?? createToolModelOutput({
|
|
462
|
+
...options,
|
|
463
|
+
tool,
|
|
464
|
+
errorMode: "none"
|
|
465
|
+
})
|
|
466
|
+
};
|
|
454
467
|
const responseMessages = [];
|
|
455
468
|
for (const step of this.stepsBuffer) responseMessages.push(...await toResponseMessages({
|
|
456
469
|
content: step.content,
|
|
457
|
-
tools:
|
|
470
|
+
tools: responseTools
|
|
458
471
|
}));
|
|
459
472
|
this._responseMessages.resolve(responseMessages);
|
|
460
473
|
this.fullStreamController.enqueue({
|
|
@@ -1500,6 +1513,46 @@ function pinSandboxChannelEventCheckpoint(event) {
|
|
|
1500
1513
|
return event[sandboxChannelEventCheckpointSymbol]?.pin();
|
|
1501
1514
|
}
|
|
1502
1515
|
//#endregion
|
|
1516
|
+
//#region src/utils/normalize-harness-tool-model-output.ts
|
|
1517
|
+
function normalizeHarnessToolModelOutput({ output }) {
|
|
1518
|
+
try {
|
|
1519
|
+
return output.type !== "content" ? output : {
|
|
1520
|
+
...output,
|
|
1521
|
+
value: output.value.map((part) => {
|
|
1522
|
+
if (part.type === "text") return part;
|
|
1523
|
+
const file = part.type === "image-data" || part.type === "file-data" ? {
|
|
1524
|
+
...part,
|
|
1525
|
+
type: "file",
|
|
1526
|
+
data: {
|
|
1527
|
+
type: "data",
|
|
1528
|
+
data: part.data
|
|
1529
|
+
}
|
|
1530
|
+
} : part;
|
|
1531
|
+
if (file.type !== "file" || file.data.type !== "data" || getTopLevelMediaType(file.mediaType) !== "image") throw new Error(`Unsupported content '${part.type}'${file.type === "file" ? ` (${file.mediaType}, ${file.data.type})` : ""}.`);
|
|
1532
|
+
const data = typeof file.data.data === "string" ? file.data.data : convertUint8ArrayToBase64(convertInlineFileDataToUint8Array(file.data));
|
|
1533
|
+
const mediaType = isFullMediaType(file.mediaType) ? file.mediaType : detectMediaType({
|
|
1534
|
+
data,
|
|
1535
|
+
topLevelType: "image"
|
|
1536
|
+
});
|
|
1537
|
+
if (mediaType == null) throw new Error("Cannot detect the inline image media type.");
|
|
1538
|
+
return {
|
|
1539
|
+
...file,
|
|
1540
|
+
mediaType,
|
|
1541
|
+
data: {
|
|
1542
|
+
type: "data",
|
|
1543
|
+
data
|
|
1544
|
+
}
|
|
1545
|
+
};
|
|
1546
|
+
})
|
|
1547
|
+
};
|
|
1548
|
+
} catch (cause) {
|
|
1549
|
+
throw new HarnessCapabilityUnsupportedError({
|
|
1550
|
+
message: `Harnesses support only text and inline images in tool model output. ${cause instanceof Error ? cause.message : String(cause)}`,
|
|
1551
|
+
cause
|
|
1552
|
+
});
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
//#endregion
|
|
1503
1556
|
//#region src/agent/internal/run-prompt.ts
|
|
1504
1557
|
const invalidToolInputMessage = "Tool input validation failed.";
|
|
1505
1558
|
function unwrapToolResultOutput(toolResult) {
|
|
@@ -1687,9 +1740,10 @@ function runPrompt(input) {
|
|
|
1687
1740
|
toolExecutions.clear();
|
|
1688
1741
|
bufferedToolOutcomes = [];
|
|
1689
1742
|
};
|
|
1690
|
-
let
|
|
1691
|
-
let
|
|
1692
|
-
let
|
|
1743
|
+
let hostInputPauseRequested = false;
|
|
1744
|
+
let deferredPauseFinishStep;
|
|
1745
|
+
let ignoredFinishStep;
|
|
1746
|
+
const hostToolCallIdsAwaitingEcho = /* @__PURE__ */ new Set();
|
|
1693
1747
|
const buildModelCallContent = () => {
|
|
1694
1748
|
const parts = [];
|
|
1695
1749
|
if (stepText) parts.push({
|
|
@@ -1713,9 +1767,7 @@ function runPrompt(input) {
|
|
|
1713
1767
|
stepApprovalRequests = [];
|
|
1714
1768
|
bufferedToolOutcomes = [];
|
|
1715
1769
|
toolExecutions.clear();
|
|
1716
|
-
|
|
1717
|
-
observedStepToolCallCount = 0;
|
|
1718
|
-
pauseAfterStepToolCalls = false;
|
|
1770
|
+
ignoredFinishStep = void 0;
|
|
1719
1771
|
};
|
|
1720
1772
|
const zeroUsage = {
|
|
1721
1773
|
inputTokens: {
|
|
@@ -1752,20 +1804,25 @@ function runPrompt(input) {
|
|
|
1752
1804
|
resetStepContent();
|
|
1753
1805
|
return step;
|
|
1754
1806
|
};
|
|
1755
|
-
const finishForHostInputPause = async (
|
|
1807
|
+
const finishForHostInputPause = async () => {
|
|
1756
1808
|
await waitForOutstandingHostToolExecutions();
|
|
1757
|
-
|
|
1758
|
-
finishReason: toolCallsFinishReason,
|
|
1759
|
-
usage: zeroUsage,
|
|
1760
|
-
providerMetadata: void 0
|
|
1761
|
-
});
|
|
1762
|
-
else await publishToolExecutions();
|
|
1809
|
+
await publishToolExecutions();
|
|
1763
1810
|
await lifecycle.end({
|
|
1764
1811
|
steps: completedSteps,
|
|
1765
1812
|
usage: asLanguageModelUsage(zeroUsage)
|
|
1766
1813
|
});
|
|
1767
1814
|
await result.finish();
|
|
1768
1815
|
};
|
|
1816
|
+
const pauseForHostInput = async (finishStep) => {
|
|
1817
|
+
await waitForOutstandingHostToolExecutions();
|
|
1818
|
+
closingResumedStep = false;
|
|
1819
|
+
await completeStep({
|
|
1820
|
+
finishReason: toolCallsFinishReason,
|
|
1821
|
+
usage: finishStep?.usage ?? zeroUsage,
|
|
1822
|
+
providerMetadata: finishStep?.harnessMetadata
|
|
1823
|
+
});
|
|
1824
|
+
await finishForHostInputPause();
|
|
1825
|
+
};
|
|
1769
1826
|
const enqueueApprovalRequest = (approval) => {
|
|
1770
1827
|
const part = {
|
|
1771
1828
|
type: "tool-approval-request",
|
|
@@ -1833,7 +1890,33 @@ function runPrompt(input) {
|
|
|
1833
1890
|
});
|
|
1834
1891
|
};
|
|
1835
1892
|
const submitToolResult = async (submission) => {
|
|
1836
|
-
if (
|
|
1893
|
+
if (submission.toolResult != null) {
|
|
1894
|
+
let output;
|
|
1895
|
+
try {
|
|
1896
|
+
output = normalizeHarnessToolModelOutput({ output: submission.toolResult.output });
|
|
1897
|
+
} catch (error) {
|
|
1898
|
+
if (!continuationsByToolCallId.has(submission.toolCallId) || !HarnessCapabilityUnsupportedError.isInstance(error)) throw error;
|
|
1899
|
+
output = {
|
|
1900
|
+
type: "text",
|
|
1901
|
+
value: JSON.stringify(submission.output) ?? "null"
|
|
1902
|
+
};
|
|
1903
|
+
}
|
|
1904
|
+
submission = {
|
|
1905
|
+
...submission,
|
|
1906
|
+
toolResult: {
|
|
1907
|
+
...submission.toolResult,
|
|
1908
|
+
output
|
|
1909
|
+
}
|
|
1910
|
+
};
|
|
1911
|
+
result.setToolModelOutput({
|
|
1912
|
+
toolCallId: submission.toolCallId,
|
|
1913
|
+
output
|
|
1914
|
+
});
|
|
1915
|
+
}
|
|
1916
|
+
if (!input.isTurnSuspending?.()) {
|
|
1917
|
+
if (!settledHostToolCallIds.has(submission.toolCallId)) hostToolCallIdsAwaitingEcho.add(submission.toolCallId);
|
|
1918
|
+
return control.submitToolResult(submission);
|
|
1919
|
+
}
|
|
1837
1920
|
const toolCall = rawToolCallsByToolCallId.get(submission.toolCallId) ?? pendingResultsByToolCallId.get(submission.toolCallId) ?? pendingToolApprovals.find((approval) => approval.toolCallId === submission.toolCallId);
|
|
1838
1921
|
if (toolCall == null) throw new Error(`Unknown suspended tool call '${submission.toolCallId}'.`);
|
|
1839
1922
|
const { toolCallId, ...completedResult } = submission;
|
|
@@ -1980,7 +2063,7 @@ function runPrompt(input) {
|
|
|
1980
2063
|
});
|
|
1981
2064
|
if (!execution.executed) {
|
|
1982
2065
|
recordPendingToolResult({ toolCall: rawToolCall });
|
|
1983
|
-
await finishForHostInputPause(
|
|
2066
|
+
await finishForHostInputPause();
|
|
1984
2067
|
return "awaiting-tool-result";
|
|
1985
2068
|
}
|
|
1986
2069
|
const toolExecution = toolExecutions.get(rawToolCall.toolCallId);
|
|
@@ -2012,8 +2095,8 @@ function runPrompt(input) {
|
|
|
2012
2095
|
}
|
|
2013
2096
|
}
|
|
2014
2097
|
while (true) {
|
|
2015
|
-
if (
|
|
2016
|
-
await
|
|
2098
|
+
if (deferredPauseFinishStep != null && hostToolCallIdsAwaitingEcho.size === 0) {
|
|
2099
|
+
await pauseForHostInput(deferredPauseFinishStep);
|
|
2017
2100
|
return;
|
|
2018
2101
|
}
|
|
2019
2102
|
const { value, done } = await reader.read();
|
|
@@ -2026,6 +2109,7 @@ function runPrompt(input) {
|
|
|
2026
2109
|
result.enqueueRaw(value.rawValue);
|
|
2027
2110
|
continue;
|
|
2028
2111
|
}
|
|
2112
|
+
if (value.type === "tool-result") hostToolCallIdsAwaitingEcho.delete(value.toolCallId);
|
|
2029
2113
|
if (pendingStopBoundary != null) {
|
|
2030
2114
|
if (value.type === "finish") releasePendingStopBoundary();
|
|
2031
2115
|
else if ((await Promise.all(input.stopConditions.map((condition) => condition({ steps: completedSteps })))).some(Boolean)) {
|
|
@@ -2055,6 +2139,43 @@ function runPrompt(input) {
|
|
|
2055
2139
|
const settledHostInputReplay = (displayValue.type === "tool-call" || displayValue.type === "tool-result" || displayValue.type === "tool-approval-request") && settledHostToolCallIds.has(displayValue.toolCallId);
|
|
2056
2140
|
const settledBuiltinApprovalReplay = (displayValue.type === "tool-call" || displayValue.type === "tool-approval-request") && settledBuiltinApprovalToolCallIds.has(displayValue.toolCallId);
|
|
2057
2141
|
if (settledHostInputReplay || settledBuiltinApprovalReplay) continue;
|
|
2142
|
+
if (value.type === "finish-step") {
|
|
2143
|
+
if (hostInputPauseRequested) {
|
|
2144
|
+
await waitForOutstandingHostToolExecutions();
|
|
2145
|
+
if (hostToolCallIdsAwaitingEcho.size === 0) {
|
|
2146
|
+
await pauseForHostInput(value);
|
|
2147
|
+
return;
|
|
2148
|
+
}
|
|
2149
|
+
deferredPauseFinishStep = value;
|
|
2150
|
+
continue;
|
|
2151
|
+
}
|
|
2152
|
+
if (hostToolCallIdsAwaitingEcho.size > 0) {
|
|
2153
|
+
ignoredFinishStep = value;
|
|
2154
|
+
continue;
|
|
2155
|
+
}
|
|
2156
|
+
ignoredFinishStep = void 0;
|
|
2157
|
+
}
|
|
2158
|
+
if (value.type === "finish") {
|
|
2159
|
+
if (hostInputPauseRequested) {
|
|
2160
|
+
await pauseForHostInput(deferredPauseFinishStep);
|
|
2161
|
+
return;
|
|
2162
|
+
}
|
|
2163
|
+
if (ignoredFinishStep != null) {
|
|
2164
|
+
const finishStep = ignoredFinishStep;
|
|
2165
|
+
ignoredFinishStep = void 0;
|
|
2166
|
+
await waitForOutstandingHostToolExecutions();
|
|
2167
|
+
if (closingResumedStep) {
|
|
2168
|
+
closingResumedStep = false;
|
|
2169
|
+
await publishToolExecutions();
|
|
2170
|
+
resetStepContent();
|
|
2171
|
+
result.discardCurrentStepContent();
|
|
2172
|
+
} else await completeStep({
|
|
2173
|
+
finishReason: finishStep.finishReason,
|
|
2174
|
+
usage: finishStep.usage,
|
|
2175
|
+
providerMetadata: finishStep.harnessMetadata
|
|
2176
|
+
});
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2058
2179
|
if (displayValue.type === "finish-step" && closingResumedStep) {
|
|
2059
2180
|
closingResumedStep = false;
|
|
2060
2181
|
await publishToolExecutions();
|
|
@@ -2071,6 +2192,7 @@ function runPrompt(input) {
|
|
|
2071
2192
|
toolFiltering: input.builtinToolFiltering
|
|
2072
2193
|
})) {
|
|
2073
2194
|
if (control.submitToolApproval == null) throw new Error(`Harness '${input.harness.harnessId}' emitted a built-in tool approval request but does not support approval responses.`);
|
|
2195
|
+
hostToolCallIdsAwaitingEcho.add(displayValue.toolCallId);
|
|
2074
2196
|
await control.submitToolApproval({
|
|
2075
2197
|
approvalId: displayValue.approvalId,
|
|
2076
2198
|
approved: false,
|
|
@@ -2128,8 +2250,6 @@ function runPrompt(input) {
|
|
|
2128
2250
|
if (value.type === "text-delta") stepText += value.delta;
|
|
2129
2251
|
else if (value.type === "reasoning-delta") stepReasoning += value.delta;
|
|
2130
2252
|
if (value.type === "tool-call") {
|
|
2131
|
-
observedStepToolCallCount += 1;
|
|
2132
|
-
expectedStepToolCallCount ??= value.stepToolCallCount;
|
|
2133
2253
|
const toolCall = toolCallsByToolCallId.get(value.toolCallId);
|
|
2134
2254
|
if (toolCall != null) {
|
|
2135
2255
|
stepToolCalls.push(toolCall);
|
|
@@ -2180,8 +2300,8 @@ function runPrompt(input) {
|
|
|
2180
2300
|
approvalId: pendingApproval.approvalId,
|
|
2181
2301
|
toolCall
|
|
2182
2302
|
});
|
|
2183
|
-
|
|
2184
|
-
|
|
2303
|
+
hostInputPauseRequested = true;
|
|
2304
|
+
continue;
|
|
2185
2305
|
}
|
|
2186
2306
|
if (value.type === "finish-step") {
|
|
2187
2307
|
await waitForOutstandingHostToolExecutions();
|
|
@@ -2232,12 +2352,8 @@ function runPrompt(input) {
|
|
|
2232
2352
|
}
|
|
2233
2353
|
if (isClientExecutedBuiltin) {
|
|
2234
2354
|
recordPendingToolResult({ toolCall });
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
continue;
|
|
2238
|
-
}
|
|
2239
|
-
await finishForHostInputPause({ completeCurrentStep: true });
|
|
2240
|
-
return;
|
|
2355
|
+
hostInputPauseRequested = true;
|
|
2356
|
+
continue;
|
|
2241
2357
|
}
|
|
2242
2358
|
if (validatedHostToolCall == null) throw new Error(`Harness '${input.harness.harnessId}' could not validate host tool '${toolCall.toolName}'.`);
|
|
2243
2359
|
if (validatedHostToolCall.invalid) {
|
|
@@ -2325,22 +2441,15 @@ function runPrompt(input) {
|
|
|
2325
2441
|
approvalId: pendingApproval.approvalId,
|
|
2326
2442
|
toolCall: pendingParsedToolCall
|
|
2327
2443
|
});
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
continue;
|
|
2331
|
-
}
|
|
2332
|
-
await finishForHostInputPause({ completeCurrentStep: true });
|
|
2333
|
-
return;
|
|
2444
|
+
hostInputPauseRequested = true;
|
|
2445
|
+
continue;
|
|
2334
2446
|
}
|
|
2335
2447
|
if (!isExecutableTool(activeTools[toolCall.toolName])) {
|
|
2336
2448
|
recordPendingToolResult({ toolCall });
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
continue;
|
|
2340
|
-
}
|
|
2341
|
-
await finishForHostInputPause({ completeCurrentStep: true });
|
|
2342
|
-
return;
|
|
2449
|
+
hostInputPauseRequested = true;
|
|
2450
|
+
continue;
|
|
2343
2451
|
}
|
|
2452
|
+
hostToolCallIdsAwaitingEcho.add(toolCall.toolCallId);
|
|
2344
2453
|
startHostToolExecution((async () => {
|
|
2345
2454
|
const toolExecution = toolExecutions.get(toolCall.toolCallId);
|
|
2346
2455
|
if (toolExecution == null) throw new Error(`Harness '${input.harness.harnessId}' could not track host tool '${toolCall.toolName}'.`);
|
|
@@ -2383,6 +2492,10 @@ function runPrompt(input) {
|
|
|
2383
2492
|
})());
|
|
2384
2493
|
}
|
|
2385
2494
|
}
|
|
2495
|
+
if (hostInputPauseRequested && input.isTurnSuspending?.() !== true) {
|
|
2496
|
+
await pauseForHostInput(deferredPauseFinishStep);
|
|
2497
|
+
return;
|
|
2498
|
+
}
|
|
2386
2499
|
await waitForOutstandingHostToolExecutions();
|
|
2387
2500
|
if (input.isTurnSuspending?.() === true) {
|
|
2388
2501
|
await publishToolExecutions();
|
|
@@ -2507,7 +2620,19 @@ async function maybeExecuteHostTool(input) {
|
|
|
2507
2620
|
});
|
|
2508
2621
|
await input.submitToolResult({
|
|
2509
2622
|
toolCallId: input.event.toolCallId,
|
|
2510
|
-
output
|
|
2623
|
+
output,
|
|
2624
|
+
...tool.toModelOutput == null ? {} : { toolResult: {
|
|
2625
|
+
type: "tool-result",
|
|
2626
|
+
toolCallId: input.event.toolCallId,
|
|
2627
|
+
toolName: input.event.toolName,
|
|
2628
|
+
output: await createToolModelOutput({
|
|
2629
|
+
toolCallId: input.event.toolCallId,
|
|
2630
|
+
input: input.parsedToolCall.input,
|
|
2631
|
+
output,
|
|
2632
|
+
tool,
|
|
2633
|
+
errorMode: "none"
|
|
2634
|
+
})
|
|
2635
|
+
} }
|
|
2511
2636
|
});
|
|
2512
2637
|
return {
|
|
2513
2638
|
executed: true,
|
|
@@ -3099,6 +3224,9 @@ var HarnessAgentSession = class {
|
|
|
3099
3224
|
* locally to find the original tool call before it can resume the paused turn.
|
|
3100
3225
|
* Responses that already have a tool result are ignored, because those
|
|
3101
3226
|
* approvals were already consumed by a prior continuation.
|
|
3227
|
+
* An `execution-denied` result is synthesized by `convertToModelMessages`
|
|
3228
|
+
* for a newly denied approval; it does not mean the harness has received
|
|
3229
|
+
* the decision, so that approval response must still continue the turn.
|
|
3102
3230
|
*/
|
|
3103
3231
|
function collectHarnessAgentToolApprovalContinuations(input) {
|
|
3104
3232
|
const lastMessage = input.messages.at(-1);
|
|
@@ -3111,7 +3239,7 @@ function collectHarnessAgentToolApprovalContinuations(input) {
|
|
|
3111
3239
|
else if (part.type === "tool-approval-request") approvalRequestsByApprovalId.set(part.approvalId, part);
|
|
3112
3240
|
}
|
|
3113
3241
|
const toolResultIds = /* @__PURE__ */ new Set();
|
|
3114
|
-
for (const part of lastMessage.content) if (part.type === "tool-result") toolResultIds.add(part.toolCallId);
|
|
3242
|
+
for (const part of lastMessage.content) if (part.type === "tool-result" && part.output.type !== "execution-denied") toolResultIds.add(part.toolCallId);
|
|
3115
3243
|
const continuations = [];
|
|
3116
3244
|
for (const part of lastMessage.content) {
|
|
3117
3245
|
if (part.type !== "tool-approval-response") continue;
|