{"record":{"id":"c5915b8d838a2689","repo":"paperclipai/paperclip","slug":"action-context-mismatch","errorCode":"action_context_mismatch","errorMessage":"Tool action request does not belong to this interaction","messagePattern":"Tool action request does not belong to this interaction","errorType":"http","errorClass":"ToolGatewayHttpError","httpStatus":409,"severity":"error","filePath":"server/src/services/tool-gateway.ts","lineNumber":5390,"sourceCode":"      const row = match?.actionRequest;\n      if (!row || row.status !== \"executing\") return row ?? null;\n      deadline = extendApprovedExecutionWaitDeadline({\n        currentDeadlineMs: deadline,\n        invocationStatus: match.invocationStatus,\n        invocationStartedAt: match.invocationStartedAt,\n        preparationStartedAt: row.updatedAt,\n        preparationWaitMs: ACTION_REQUEST_PREPARATION_WAIT_MS,\n        executionWaitMs: ACTION_REQUEST_EXECUTION_WAIT_MS,\n      });\n      const remainingMs = deadline - Date.now();\n      if (remainingMs <= 0) break;\n      await new Promise((resolve) => setTimeout(\n        resolve,\n        Math.min(ACTION_REQUEST_EXECUTION_POLL_MS, remainingMs),\n      ));\n    }\n    throw new ToolGatewayHttpError(409, \"Approved tool action is still executing\", \"action_execution_in_progress\", {\n      actionRequestId,\n      preparationWaitMs: ACTION_REQUEST_PREPARATION_WAIT_MS,\n      executionWaitMs: ACTION_REQUEST_EXECUTION_WAIT_MS,\n    });\n  }\n\n  function storedInvocationResult(invocation: typeof toolInvocations.$inferSelect): unknown {\n    const summary = invocation.resultSummary?.summary;\n    if (typeof summary !== \"string\") return null;\n    try {\n      return JSON.parse(summary);\n    } catch {\n      return summary;\n    }\n  }\n\n  async function actionRequestResolution(actionRequest: typeof toolActionRequests.$inferSelect) {\n    if (actionRequest.status !== \"executed\" && actionRequest.status !== \"failed\") return actionRequest;\n    const [invocation] = await db","sourceCodeStart":5372,"sourceCodeEnd":5408,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/tool-gateway.ts#L5372-L5408","documentation":"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.","triggerScenarios":"Thrown at server/src/services/tool-gateway.ts:5222 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the tool action request that belongs to the current interaction; IDs from other interactions are rejected."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}