{"record":{"id":"442aa8a3a855a3ef","repo":"paperclipai/paperclip","slug":"err-message","errorCode":null,"errorMessage":"err.message","messagePattern":"err\\.message","errorType":"http","errorClass":"ToolGatewayHttpError","httpStatus":null,"severity":"error","filePath":"server/src/services/tool-gateway.ts","lineNumber":6531,"sourceCode":"        );\n      if (!tool) {\n        throw new ToolGatewayHttpError(404, `Tool \"${input.toolName}\" not found`, \"tool_not_found\", {\n          connectionId: input.connectionId,\n          tool: input.toolName,\n        });\n      }\n\n      const requestedParameters = await governedToolArguments(session, tool, input.parameters ?? {});\n      const argumentValidation = validateToolContent({\n        value: requestedParameters,\n        direction: \"arguments\",\n        sensitiveMode: \"redact\",\n        promptInjectionMode: \"ignore\",\n      });\n      const decisionInput = policyInputForAgentTool({\n        companyId: input.companyId,\n        agentId: input.agentId,\n        actorType: \"user\",\n        actorId: input.userId,\n        tool,\n        parameters: requestedParameters,\n        idempotencyKey: `test-call:${randomUUID()}`,\n        consumeRateLimit: true,\n      });\n      const accessDecision = await policyService.decide(decisionInput);\n      const recorded = await policyService.recordInvocation(decisionInput, accessDecision);\n      await policyService.writeAudit(decisionInput, accessDecision);\n      const invocationId = recorded.invocation.id;\n\n      if (accessDecision.decision === \"require_approval\") {\n        if (!recorded.actionRequest) {\n          throw new ToolGatewayHttpError(500, \"Approval request was not created\", \"approval_request_missing\", {\n            invocationId,\n            tool: tool.name,\n          });\n        }","sourceCodeStart":6513,"sourceCodeEnd":6549,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/tool-gateway.ts#L6513-L6549","documentation":"Not a literal throw message: stopSlot catches a ToolRuntimeSupervisorError and re-surfaces it as a gateway HTTP error; the referenced field err.message is the supervisor error text (slot not found, wrong runtime kind, capacity, etc.) carried through so callers see the underlying runtime-slot failure reason.","triggerScenarios":"Thrown at server/src/services/tool-gateway.ts:6344 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The runtime supervisor rejected the operation with the wrapped message; follow that message (capacity, backoff, or unsupported runtime) and retry when conditions clear."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}