paperclipai/paperclip · error · ToolGatewayHttpError

approved_execution_unsupported

approved_execution_unsupported

Error message

Plugin actions cannot execute outside their originating run

What it means

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.

Source

Thrown at server/src/services/tool-gateway.ts:4454

        const errorRecord = asRecord(payloadRecord.error);
        await markRemoteConnectionHealth(connection, "error", "Remote MCP server returned a JSON-RPC error.");
        throw new ToolGatewayHttpError(502, "Remote MCP server returned an error", "remote_mcp_error", {
          code: typeof errorRecord?.code === "number" ? errorRecord.code : null,
          connectionId: connection.id,
          catalogEntryId: entry.id,
          execution,
        });
      }
      if (!Object.prototype.hasOwnProperty.call(payloadRecord, "result")) {
        throw malformedRemoteMcpResponse();
      }
      const resultElicitation = extractMcpElicitationRequest(payloadRecord.result);
      if (resultElicitation) {
        await requestElicitationForRecordedToolCall({ session, tool, invocationId, request: resultElicitation });
      }
      const sourceTemplateKey = typeof connection.config.sourceTemplateKey === "string"
        ? connection.config.sourceTemplateKey
        : null;
      const result = normalizeMcpToolResult(payloadRecord.result, "mcp_http", false, sourceTemplateKey);
      await markRemoteConnectionHealth(connection, "ok", "Remote MCP server responded to tools/call.");
      return { result, headerSummary, execution };
    } catch (error) {
      if (error instanceof ToolGatewayHttpError) {
        throw new ToolGatewayHttpError(error.status, error.message, error.reasonCode, {
          ...error.details,
          execution: error.details.execution ?? execution,
        });
      }
      if (error instanceof Error && error.name === "AbortError") {
        await markRemoteConnectionHealth(connection, "error", "Remote MCP tool call timed out.");
        throw new ToolGatewayHttpError(504, "Remote MCP tool call timed out", "tool_timeout", {
          connectionId: connection.id,
          catalogEntryId: entry.id,
          execution,
        });
      }

View on GitHub (pinned to 01ad858492)

Solutions

  1. Plugin tool actions must run within their originating run context; do not carry the action into a different run.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/services/tool-gateway.ts:4286 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-08-18). Data as JSON: /api/errors/c6ffa3699ff7fe8e. Report an issue: GitHub.