{"record":{"id":"aee367fe66f024bd","repo":"paperclipai/paperclip","slug":"invocation-not-found","errorCode":"invocation_not_found","errorMessage":"Tool invocation not found","messagePattern":"Tool invocation not found","errorType":"http","errorClass":"ToolGatewayHttpError","httpStatus":404,"severity":"error","filePath":"server/src/services/tool-gateway.ts","lineNumber":7288,"sourceCode":"      });\n      await reflectToolActionInteractionLifecycle({\n        actionRequestId,\n        status: \"executed\",\n      });\n    } catch (err) {\n      const message = err instanceof Error ? err.message : String(err);\n      await db\n        .update(toolInvocations)\n        .set({\n          status: \"failed\",\n          errorCode: \"tool_execution_failed\",\n          errorMessage: message,\n          completedAt: new Date(),\n          updatedAt: new Date(),\n        })\n        .where(eq(toolInvocations.id, invocation.id));\n      await reflectToolActionInteractionLifecycle({\n        actionRequestId,\n        status: \"failed\",\n        errorCode: \"tool_execution_failed\",\n        errorMessage: message,\n      });\n    }\n  }\n\n  async function waitForActionRequestExecution(actionRequestId: string) {\n    let deadline = Date.now() + ACTION_REQUEST_EXECUTION_WAIT_MS;\n    while (true) {\n      const [match] = await db\n        .select({\n          actionRequest: toolActionRequests,\n          invocationStatus: toolInvocations.status,\n          invocationStartedAt: toolInvocations.startedAt,\n        })\n        .from(toolActionRequests)\n        .innerJoin(","sourceCodeStart":7270,"sourceCodeEnd":7306,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/server/src/services/tool-gateway.ts#L7270-L7306","documentation":"Ask-first test-call status follow-up: the action request exists but the tool invocation it references is missing or in another company. The 404 invocation_not_found indicates data inconsistency between the action request and its invocation, or cross-company access.","triggerScenarios":"Thrown at server/src/services/tool-gateway.ts:5183 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the tool invocation ID; refresh the invocation list and use a current ID."],"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"}