paperclipai/paperclip · error · ToolGatewayHttpError

action_context_mismatch

action_context_mismatch

Error message

Tool action request does not belong to this interaction

What it means

Scope validation when filtering action requests by issue/interaction: the action request's issueId/interactionId do not match the supplied pair (or one is missing while the other is given). The 409 action_context_mismatch prevents acting on a request outside the interaction being viewed.

Source

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

      const row = match?.actionRequest;
      if (!row || row.status !== "executing") return row ?? null;
      deadline = extendApprovedExecutionWaitDeadline({
        currentDeadlineMs: deadline,
        invocationStatus: match.invocationStatus,
        invocationStartedAt: match.invocationStartedAt,
        preparationStartedAt: row.updatedAt,
        preparationWaitMs: ACTION_REQUEST_PREPARATION_WAIT_MS,
        executionWaitMs: ACTION_REQUEST_EXECUTION_WAIT_MS,
      });
      const remainingMs = deadline - Date.now();
      if (remainingMs <= 0) break;
      await new Promise((resolve) => setTimeout(
        resolve,
        Math.min(ACTION_REQUEST_EXECUTION_POLL_MS, remainingMs),
      ));
    }
    throw new ToolGatewayHttpError(409, "Approved tool action is still executing", "action_execution_in_progress", {
      actionRequestId,
      preparationWaitMs: ACTION_REQUEST_PREPARATION_WAIT_MS,
      executionWaitMs: ACTION_REQUEST_EXECUTION_WAIT_MS,
    });
  }

  function storedInvocationResult(invocation: typeof toolInvocations.$inferSelect): unknown {
    const summary = invocation.resultSummary?.summary;
    if (typeof summary !== "string") return null;
    try {
      return JSON.parse(summary);
    } catch {
      return summary;
    }
  }

  async function actionRequestResolution(actionRequest: typeof toolActionRequests.$inferSelect) {
    if (actionRequest.status !== "executed" && actionRequest.status !== "failed") return actionRequest;
    const [invocation] = await db

View on GitHub (pinned to 01ad858492)

Solutions

  1. Use the tool action request that belongs to the current interaction; IDs from other interactions are rejected.
Defensive patterns

Strategy: validation

When it happens

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