@ai-sdk/harness 1.0.84 → 1.0.86
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 +16 -0
- package/dist/agent/index.js +5 -2
- package/dist/agent/index.js.map +1 -1
- package/package.json +4 -4
- package/src/agent/internal/run-prompt.ts +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @ai-sdk/harness
|
|
2
2
|
|
|
3
|
+
## 1.0.86
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [96970bb]
|
|
8
|
+
- ai@7.0.78
|
|
9
|
+
|
|
10
|
+
## 1.0.85
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- fa6af57: fix(harness): emit builtin tool results after approval continuations
|
|
15
|
+
- Updated dependencies [b74971f]
|
|
16
|
+
- @ai-sdk/provider-utils@5.0.29
|
|
17
|
+
- ai@7.0.77
|
|
18
|
+
|
|
3
19
|
## 1.0.84
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/agent/index.js
CHANGED
|
@@ -1584,6 +1584,7 @@ function runPrompt(input) {
|
|
|
1584
1584
|
])
|
|
1585
1585
|
);
|
|
1586
1586
|
const settledHostToolCallIds = /* @__PURE__ */ new Set();
|
|
1587
|
+
const settledBuiltinApprovalToolCallIds = /* @__PURE__ */ new Set();
|
|
1587
1588
|
let closingResumedStep = false;
|
|
1588
1589
|
let pendingStopBoundary;
|
|
1589
1590
|
let finalFinish;
|
|
@@ -1757,8 +1758,8 @@ function runPrompt(input) {
|
|
|
1757
1758
|
onToolApprovalSettled(approval.approvalId);
|
|
1758
1759
|
pendingApprovalsByApprovalId.delete(approval.approvalId);
|
|
1759
1760
|
pendingApprovalsByToolCallId.delete(approval.toolCallId);
|
|
1760
|
-
settledHostToolCallIds.add(approval.toolCallId);
|
|
1761
1761
|
if (approval.kind === "builtin") {
|
|
1762
|
+
settledBuiltinApprovalToolCallIds.add(approval.toolCallId);
|
|
1762
1763
|
if (control.submitToolApproval == null) {
|
|
1763
1764
|
throw new Error(
|
|
1764
1765
|
`Harness '${input.harness.harnessId}' emitted a built-in tool approval request but does not support approval responses.`
|
|
@@ -1771,6 +1772,7 @@ function runPrompt(input) {
|
|
|
1771
1772
|
});
|
|
1772
1773
|
return "continued";
|
|
1773
1774
|
}
|
|
1775
|
+
settledHostToolCallIds.add(approval.toolCallId);
|
|
1774
1776
|
if (!continuation.approvalResponse.approved) {
|
|
1775
1777
|
await control.submitToolResult({
|
|
1776
1778
|
toolCallId: approval.toolCallId,
|
|
@@ -1889,7 +1891,8 @@ function runPrompt(input) {
|
|
|
1889
1891
|
}
|
|
1890
1892
|
const displayValue = stripWorkDir(value, input.sessionWorkDir);
|
|
1891
1893
|
const settledHostInputReplay = (displayValue.type === "tool-call" || displayValue.type === "tool-result" || displayValue.type === "tool-approval-request") && settledHostToolCallIds.has(displayValue.toolCallId);
|
|
1892
|
-
|
|
1894
|
+
const settledBuiltinApprovalReplay = (displayValue.type === "tool-call" || displayValue.type === "tool-approval-request") && settledBuiltinApprovalToolCallIds.has(displayValue.toolCallId);
|
|
1895
|
+
if (settledHostInputReplay || settledBuiltinApprovalReplay) {
|
|
1893
1896
|
continue;
|
|
1894
1897
|
}
|
|
1895
1898
|
if (displayValue.type === "finish-step" && closingResumedStep) {
|