From 7d23bc8366157cd86a150830d05e81dbd73abab9 Mon Sep 17 00:00:00 2001 From: cryppadotta <34892728+cryppadotta@users.noreply.github.com> Date: Thu, 19 Nov 2026 15:30:21 +0000 Subject: [PATCH] chore(tool-gateway): remove code comments from invalid-params fallback Co-Authored-By: Claude Opus 5.5 --- server/src/__tests__/tool-gateway-service.test.ts | 2 -- server/src/services/tool-gateway.ts | 3 --- 2 files changed, 5 deletions(-) diff --git a/server/src/__tests__/tool-gateway-service.test.ts b/server/src/__tests__/tool-gateway-service.test.ts index 68fa3168ca1..1c5dc1b349a 100644 --- a/server/src/__tests__/tool-gateway-service.test.ts +++ b/server/src/__tests__/tool-gateway-service.test.ts @@ -3109,8 +3109,6 @@ describeEmbeddedPostgres("tool gateway service", () => { const { company, agent, run } = await createRunFixture(db); const { connection } = await createRemoteMcpToolFixture(db, company.id); await db.insert(toolPolicies).values(readPolicyRow(company, "Allow read tools")); - // A provider that removed a tool answers -32602 with advice the screening - // model can classify as instructions, so the provider text is withheld. const actual = injectionPreventionModule.promptInjectionPreventionService; const screening = vi.spyOn(injectionPreventionModule, "promptInjectionPreventionService") .mockImplementation((...args) => ({ ...actual(...args), classify: async () => ({ diff --git a/server/src/services/tool-gateway.ts b/server/src/services/tool-gateway.ts index 600891fa85a..c6f71404db9 100644 --- a/server/src/services/tool-gateway.ts +++ b/server/src/services/tool-gateway.ts @@ -8723,9 +8723,6 @@ export function createToolGatewayService( // deadline; it must not turn a received protocol error into a timeout. clearTimeout(timer); const errorRecord = asRecord(payloadRecord.error); - // -32602 also answers a call to a tool the server has since removed, - // so a stale catalog entry fails on every call. The provider's own text - // can be withheld by screening: say what the agent can check or report. const fallback = errorRecord?.code === -32602 ? "The app rejected the arguments for this tool. Check them against the tool's input schema. If they match, the app may have removed or changed this tool: ask a person who manages this connection to refresh its catalog" : "Remote MCP server returned an error";