{"record":{"id":"fe07ac3fa52a0bcf","repo":"diegosouzapw/OmniRoute","slug":"memory-not-found-memoryid-fe07ac","errorCode":null,"errorMessage":"Memory not found: ${memoryId}","messagePattern":"Memory not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/skills/memoryBuiltins.ts","lineNumber":37,"sourceCode":"] as const;\n\nconst MEMORY_TYPES = [\"factual\", \"episodic\", \"procedural\", \"semantic\"] as const;\n\nfunction toMemoryType(value: unknown): MemoryType {\n  return MEMORY_TYPES.includes(value as (typeof MEMORY_TYPES)[number])\n    ? (value as MemoryType)\n    : MemoryType.FACTUAL;\n}\n\nfunction toPositiveInt(value: unknown, fallback: number, max: number): number {\n  const parsed = Number(value);\n  if (!Number.isInteger(parsed) || parsed <= 0) return fallback;\n  return Math.min(parsed, max);\n}\n\nasync function assertOwner(memoryId: string, apiKeyId: string): Promise<void> {\n  const memory = await getMemory(memoryId);\n  if (!memory) throw new Error(`Memory not found: ${memoryId}`);\n  if (memory.apiKeyId !== apiKeyId) {\n    throw new Error(\"Memory does not belong to this API key\");\n  }\n}\n\nfunction memoryToPlain(memory: Awaited<ReturnType<typeof createMemory>>) {\n  return {\n    id: memory.id,\n    type: memory.type,\n    key: memory.key,\n    content: memory.content,\n    metadata: memory.metadata,\n    createdAt: memory.createdAt.toISOString(),\n    updatedAt: memory.updatedAt.toISOString(),\n  };\n}\n\nasync function handleMemorySave(input: Record<string, unknown>, context: { apiKeyId: string; sessionId: string }) {","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/skills/memoryBuiltins.ts#L19-L55","documentation":"Error \"Memory not found: ${memoryId}\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/skills/memoryBuiltins.ts:37 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}