From bc36ed8e1e37657318cd0eb964f0a691881a8528 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 17 Mar 2026 07:58:03 +0000 Subject: [PATCH] refactor(payload-tests): table-drive recoverable tool suppressions --- .../run/payloads.errors.test.ts | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/agents/pi-embedded-runner/run/payloads.errors.test.ts b/src/agents/pi-embedded-runner/run/payloads.errors.test.ts index df2757f04a9..5aa8dfe7fd6 100644 --- a/src/agents/pi-embedded-runner/run/payloads.errors.test.ts +++ b/src/agents/pi-embedded-runner/run/payloads.errors.test.ts @@ -260,23 +260,14 @@ describe("buildEmbeddedRunPayloads", () => { }); }); - it("suppresses recoverable tool errors containing 'required' for non-mutating tools", () => { - expectNoPayloads({ - lastToolError: { toolName: "browser", error: "url required" }, - }); - }); - - it("suppresses recoverable tool errors containing 'missing' for non-mutating tools", () => { - expectNoPayloads({ - lastToolError: { toolName: "browser", error: "url missing" }, - }); - }); - - it("suppresses recoverable tool errors containing 'invalid' for non-mutating tools", () => { - expectNoPayloads({ - lastToolError: { toolName: "browser", error: "invalid parameter: url" }, - }); - }); + it.each(["url required", "url missing", "invalid parameter: url"])( + "suppresses recoverable non-mutating tool error: %s", + (error) => { + expectNoPayloads({ + lastToolError: { toolName: "browser", error }, + }); + }, + ); it("suppresses non-mutating non-recoverable tool errors when messages.suppressToolErrors is enabled", () => { expectNoPayloads({