{"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":10539,"sourceCode":"        );\n      }\n      if (input.actor.type === \"agent\") {\n        if (input.actor.companyId !== input.runContext.companyId) {\n          throw new ToolGatewayHttpError(\n            403,\n            \"Agent key cannot access another company\",\n            \"actor_company_mismatch\",\n          );\n        }\n        if (input.actor.agentId !== input.runContext.agentId) {\n          throw new ToolGatewayHttpError(\n            403,\n            \"Agent cannot execute tools as another agent\",\n            \"actor_agent_mismatch\",\n          );\n        }\n        if (input.actor.runId && input.actor.runId !== input.runContext.runId) {\n          throw new ToolGatewayHttpError(\n            403,\n            \"Agent cannot execute tools for another run\",\n            \"actor_run_mismatch\",\n          );\n        }\n      }\n\n      const context = await resolveRunContext({\n        companyId: input.runContext.companyId,\n        agentId: input.runContext.agentId,\n        runId: input.runContext.runId,\n        projectId: input.runContext.projectId,\n      });\n      let invocationId = String(randomUUID());\n      const sessionLike: ToolGatewaySession = {\n        id: \"plugin-route\",\n        token: \"plugin-route\",\n        companyId: input.runContext.companyId,","sourceCodeStart":10521,"sourceCodeEnd":10557,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/server/src/services/tool-gateway.ts#L10521-L10557","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":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-09-18T08:03:59.046Z","contentChangedAt":"2026-09-18T08:03:59.046Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}