{"record":{"id":"c6ffa3699ff7fe8e","repo":"paperclipai/paperclip","slug":"approved-execution-unsupported","errorCode":"approved_execution_unsupported","errorMessage":"Plugin actions cannot execute outside their originating run","messagePattern":"Plugin actions cannot execute outside their originating run","errorType":"http","errorClass":"ToolGatewayHttpError","httpStatus":409,"severity":"error","filePath":"server/src/services/tool-gateway.ts","lineNumber":4454,"sourceCode":"        const errorRecord = asRecord(payloadRecord.error);\n        await markRemoteConnectionHealth(connection, \"error\", \"Remote MCP server returned a JSON-RPC error.\");\n        throw new ToolGatewayHttpError(502, \"Remote MCP server returned an error\", \"remote_mcp_error\", {\n          code: typeof errorRecord?.code === \"number\" ? errorRecord.code : null,\n          connectionId: connection.id,\n          catalogEntryId: entry.id,\n          execution,\n        });\n      }\n      if (!Object.prototype.hasOwnProperty.call(payloadRecord, \"result\")) {\n        throw malformedRemoteMcpResponse();\n      }\n      const resultElicitation = extractMcpElicitationRequest(payloadRecord.result);\n      if (resultElicitation) {\n        await requestElicitationForRecordedToolCall({ session, tool, invocationId, request: resultElicitation });\n      }\n      const sourceTemplateKey = typeof connection.config.sourceTemplateKey === \"string\"\n        ? connection.config.sourceTemplateKey\n        : null;\n      const result = normalizeMcpToolResult(payloadRecord.result, \"mcp_http\", false, sourceTemplateKey);\n      await markRemoteConnectionHealth(connection, \"ok\", \"Remote MCP server responded to tools/call.\");\n      return { result, headerSummary, execution };\n    } catch (error) {\n      if (error instanceof ToolGatewayHttpError) {\n        throw new ToolGatewayHttpError(error.status, error.message, error.reasonCode, {\n          ...error.details,\n          execution: error.details.execution ?? execution,\n        });\n      }\n      if (error instanceof Error && error.name === \"AbortError\") {\n        await markRemoteConnectionHealth(connection, \"error\", \"Remote MCP tool call timed out.\");\n        throw new ToolGatewayHttpError(504, \"Remote MCP tool call timed out\", \"tool_timeout\", {\n          connectionId: connection.id,\n          catalogEntryId: entry.id,\n          execution,\n        });\n      }","sourceCodeStart":4436,"sourceCodeEnd":4472,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/tool-gateway.ts#L4436-L4472","documentation":"Plugin tool safety guard during approved execution: the invocation's originating run context does not match the run now executing, and plugin actions are pinned to their originating run for isolation and audit integrity. Execution is refused rather than run under a different run's credentials/workspace.","triggerScenarios":"Thrown at server/src/services/tool-gateway.ts:4286 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Plugin tool actions must run within their originating run context; do not carry the action into a different run."],"exampleFix":null,"handlingStrategy":"validation","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-14T00:17:10.932Z"}