{"record":{"id":"2c9e6957d3c5463d","repo":"paperclipai/paperclip","slug":"action-not-pending","errorCode":"action_not_pending","errorMessage":"Tool action request is no longer pending","messagePattern":"Tool action request is no longer pending","errorType":"http","errorClass":"ToolGatewayHttpError","httpStatus":409,"severity":"error","filePath":"server/src/services/tool-gateway.ts","lineNumber":7369,"sourceCode":"      return summary;\n    }\n  }\n\n  async function actionRequestResolution(\n    actionRequest: typeof toolActionRequests.$inferSelect,\n  ) {\n    if (\n      actionRequest.status !== \"executed\" &&\n      actionRequest.status !== \"failed\"\n    )\n      return actionRequest;\n    const [invocation] = await db\n      .select()\n      .from(toolInvocations)\n      .where(eq(toolInvocations.id, actionRequest.invocationId))\n      .limit(1);\n    return {\n      ...actionRequest,\n      resultSummary: invocation?.resultSummary?.summary ?? null,\n      error: invocation?.errorMessage ?? null,\n    };\n  }\n\n  async function markApprovedActionFailed(input: {\n    actionRequestId: string;\n    invocationId: string;\n    claimUpdatedAt: Date;\n    expectedInvocationStatus: \"awaiting_approval\" | \"executing\";\n    error: unknown;\n  }) {\n    const reasonCode =\n      input.error instanceof ToolGatewayHttpError\n        ? input.error.reasonCode\n        : \"tool_execution_failed\";\n    const message =\n      input.error instanceof Error ? input.error.message : String(input.error);","sourceCodeStart":7351,"sourceCodeEnd":7387,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/server/src/services/tool-gateway.ts#L7351-L7387","documentation":"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.","triggerScenarios":"Thrown at server/src/services/tool-gateway.ts:5246 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The request is no longer pending (already resolved). Refresh its state before acting."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}