paperclipai/paperclip · error · ToolGatewayHttpError

action_scope_mismatch

action_scope_mismatch

Error message

Approved action request is not scoped to this gateway session

What it means

Session-scoping guard when an agent replays an approved action over the gateway: the action request's run/session context (runId, issueId, agent linkage) does not match the presenting session. The mismatch means the approval was granted in a different context and cannot be executed through this session.

Source

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

        invocationId: invocation.id,
        claimUpdatedAt: claimed.updatedAt,
        expectedInvocationStatus: "awaiting_approval",
        error,
      });
      throw error;
    }
    let managedArgumentsRemainCurrent: boolean;
    try {
      managedArgumentsRemainCurrent = await approvedManagedArgumentsRemainCurrent(session, tool, parameters);
    } catch (error) {
      await markApprovedActionFailed({
        actionRequestId: claimed.id,
        invocationId: invocation.id,
        claimUpdatedAt: claimed.updatedAt,
        expectedInvocationStatus: "awaiting_approval",
        error,
      });
      throw error;
    }
    if (!managedArgumentsRemainCurrent) {
      throw await expireApprovedActionForManagedArgumentDrift({
        actionRequestId: claimed.id,
        invocationId: invocation.id,
        toolName: invocation.toolName,
        ownsExecutingClaim: true,
      });
    }

    const argumentsSummary = validateToolContent({
      value: parameters,
      direction: "arguments",
      sensitiveMode: "redact",
      promptInjectionMode: "ignore",
    }).summary;
    // Final recheck at the last DB write before dispatch: tool and snapshot
    // resolution above involve network calls, so re-verify the issue is still

View on GitHub (pinned to 01ad858492)

Solutions

  1. Use the approved action within the gateway session it was approved for; session scoping is enforced.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/services/tool-gateway.ts:5553 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/c51d360f74d2ccd7. Report an issue: GitHub.