paperclipai/paperclip · error · ToolGatewayHttpError
actor_run_mismatch
actor_run_mismatch
Error message
Agent cannot execute tools for another run
What it means
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.
Solutions
- Execute tools only within your own run; supplying another run's ID is rejected.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at server/src/services/tool-gateway.ts:6035 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@3f1d897a7c (2026-09-18).
Data as JSON: /api/errors/0a92c98dbedb6582.
Report an issue: GitHub.
Appendix: source
Thrown at server/src/services/tool-gateway.ts:10539
);
}
if (input.actor.type === "agent") {
if (input.actor.companyId !== input.runContext.companyId) {
throw new ToolGatewayHttpError(
403,
"Agent key cannot access another company",
"actor_company_mismatch",
);
}
if (input.actor.agentId !== input.runContext.agentId) {
throw new ToolGatewayHttpError(
403,
"Agent cannot execute tools as another agent",
"actor_agent_mismatch",
);
}
if (input.actor.runId && input.actor.runId !== input.runContext.runId) {
throw new ToolGatewayHttpError(
403,
"Agent cannot execute tools for another run",
"actor_run_mismatch",
);
}
}
const context = await resolveRunContext({
companyId: input.runContext.companyId,
agentId: input.runContext.agentId,
runId: input.runContext.runId,
projectId: input.runContext.projectId,
});
let invocationId = String(randomUUID());
const sessionLike: ToolGatewaySession = {
id: "plugin-route",
token: "plugin-route",
companyId: input.runContext.companyId,View on GitHub (pinned to 3f1d897a7c)