Skip to content

Commit c001750

Browse files
fix(agents): suppress expired approval followup warnings
1 parent 254e28d commit c001750

1 file changed

Lines changed: 20 additions & 2 deletions

File tree

src/agents/bash-tools.exec-host-shared.test.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,26 @@ describe("sendExecApprovalFollowupResult", () => {
167167
);
168168
});
169169

170-
it("suppresses approval-not-found followup dispatch failures", async () => {
171-
sendExecApprovalFollowup.mockRejectedValue(new Error("unknown or expired approval id"));
170+
it.each([
171+
{
172+
name: "direct gateway code",
173+
error: Object.assign(new Error("approval not found"), {
174+
gatewayCode: "APPROVAL_NOT_FOUND",
175+
}),
176+
},
177+
{
178+
name: "structured invalid-request details",
179+
error: Object.assign(new Error("approval not found"), {
180+
gatewayCode: "INVALID_REQUEST",
181+
details: { reason: "APPROVAL_NOT_FOUND" },
182+
}),
183+
},
184+
{
185+
name: "legacy message-only error",
186+
error: new Error("unknown or expired approval id"),
187+
},
188+
])("suppresses approval-not-found followup dispatch failures ($name)", async ({ error }) => {
189+
sendExecApprovalFollowup.mockRejectedValue(error);
172190

173191
await sendExecApprovalFollowupResult(
174192
{

0 commit comments

Comments
 (0)