{"record":{"id":"0a92c98dbedb6582","repo":"paperclipai/paperclip","slug":"actor-run-mismatch","errorCode":"actor_run_mismatch","errorMessage":"Agent cannot execute tools for another run","messagePattern":"Agent cannot execute tools for another run","errorType":"http","errorClass":"ToolGatewayHttpError","httpStatus":403,"severity":"error","filePath":"server/src/services/tool-gateway.ts","lineNumber":6222,"sourceCode":"          ...(input.body.profileId !== undefined ? { profileId: input.body.profileId } : {}),\n          ...(input.body.defaultProfileMode !== undefined ? { defaultProfileMode: input.body.defaultProfileMode } : {}),\n          ...(input.body.contextScopeType !== undefined ? { contextScopeType: input.body.contextScopeType } : {}),\n          ...(input.body.contextScopeId !== undefined ? { contextScopeId: input.body.contextScopeId ?? null } : {}),\n          ...(input.body.agentId !== undefined ? { agentId: input.body.agentId ?? null } : {}),\n          ...(input.body.projectId !== undefined ? { projectId: input.body.projectId ?? null } : {}),\n          ...(input.body.issueId !== undefined ? { issueId: input.body.issueId ?? null } : {}),\n          ...(input.body.approvalIssueId !== undefined ? { approvalIssueId: input.body.approvalIssueId ?? null } : {}),\n          ...(input.body.authConfig !== undefined ? { authConfig: input.body.authConfig } : {}),\n          ...(input.body.headerPolicy !== undefined ? { headerPolicy: input.body.headerPolicy } : {}),\n          ...(input.body.metadataPolicy !== undefined ? { metadataPolicy: input.body.metadataPolicy } : {}),\n          ...(input.body.onDemandToolsConfig !== undefined ? { onDemandToolsConfig: input.body.onDemandToolsConfig } : {}),\n          ...(input.body.metadata !== undefined ? { metadata: input.body.metadata ?? {} } : {}),\n          updatedAt: new Date(),\n        })\n        .where(and(eq(toolMcpGateways.companyId, input.companyId), eq(toolMcpGateways.id, input.gatewayId)))\n        .returning();\n      if (input.body.profileId && input.body.profileId !== existing.profileId) {\n        await db\n          .insert(toolProfileBindings)\n          .values({\n            companyId: input.companyId,\n            profileId: input.body.profileId,\n            targetType: \"gateway\",\n            targetId: input.gatewayId,\n            priority: 10,\n            metadata: { source: \"named_mcp_gateway\" },\n          })\n          .onConflictDoNothing();\n      }\n      return getGatewayWithTokens(input.companyId, updated.id);\n    },\n\n    async createNamedGatewayToken(input: {\n      companyId: string;\n      gatewayId: string;\n      body: CreateToolMcpGatewayToken;","sourceCodeStart":6204,"sourceCodeEnd":6240,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/tool-gateway.ts#L6204-L6240","documentation":"executePluginTool run-scope guard: the runContext.runId does not belong to the executing agent's current run, so plugin execution is refused with 403. Plugin tool calls must occur inside the run that owns them, preventing orphaned or cross-run side effects.","triggerScenarios":"Thrown at server/src/services/tool-gateway.ts:6035 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Execute tools only within your own run; supplying another run's ID is rejected."],"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"}