paperclipai/paperclip · error · ToolGatewayHttpError

action_not_pending

action_not_pending

Error message

Tool action request is no longer pending

What it means

Optimistic-concurrency guard when resolving a tool action request: the request's status is no longer pending (already decided, expired, or cancelled) or the signed payload can no longer be read. The 409 asks the client to refresh the review queue because the row changed under it.

Source

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

  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
      .select()
      .from(toolInvocations)
      .where(eq(toolInvocations.id, actionRequest.invocationId))
      .limit(1);
    return {
      ...actionRequest,
      resultSummary: invocation?.resultSummary?.summary ?? null,
      error: invocation?.errorMessage ?? null,
    };
  }

  async function markApprovedActionFailed(input: {
    actionRequestId: string;
    invocationId: string;
    claimUpdatedAt: Date;
    expectedInvocationStatus: "awaiting_approval" | "executing";
    error: unknown;
  }) {
    const reasonCode = input.error instanceof ToolGatewayHttpError
      ? input.error.reasonCode
      : "tool_execution_failed";
    const message = input.error instanceof Error ? input.error.message : String(input.error);
    const now = new Date();
    const settled = await db.transaction(async (tx) => {

View on GitHub (pinned to 01ad858492)

Solutions

  1. The request is no longer pending (already resolved). Refresh its state before acting.
Defensive patterns

Strategy: validation

When it happens

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