{"record":{"id":"749c42cdcbbfe4cd","repo":"diegosouzapw/OmniRoute","slug":"failed-to-update-memory-id","errorCode":null,"errorMessage":"Failed to update memory: ${id}","messagePattern":"Failed to update memory: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/skills/memoryBuiltins.ts","lineNumber":104,"sourceCode":"    type?: string;\n    key?: string;\n    content?: string;\n    metadata?: Record<string, unknown>;\n  };\n  if (!id || typeof id !== \"string\") throw new Error(\"Missing required field: id\");\n\n  await assertOwner(id, context.apiKeyId);\n\n  const updates: Record<string, unknown> = {};\n  if (type !== undefined) updates.type = toMemoryType(type);\n  if (key !== undefined) updates.key = key;\n  if (content !== undefined) updates.content = content;\n  if (metadata !== undefined) updates.metadata = metadata;\n\n  if (Object.keys(updates).length === 0) throw new Error(\"No fields to update\");\n\n  const ok = await updateMemory(id, updates);\n  if (!ok) throw new Error(`Failed to update memory: ${id}`);\n\n  return {\n    success: true,\n    id,\n    message: \"Memory updated successfully\",\n    context: context.apiKeyId,\n  };\n}\n\nasync function handleMemorySearch(input: Record<string, unknown>, context: { apiKeyId: string }) {\n  const { query, type, limit, maxTokens } = input as {\n    query?: string;\n    type?: string;\n    limit?: number;\n    maxTokens?: number;\n  };\n\n  const memorySettings = (await getMemorySettings().catch(() => null)) ?? DEFAULT_MEMORY_SETTINGS;","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/skills/memoryBuiltins.ts#L86-L122","documentation":"Persistence failure in handleMemoryUpdate: ownership passed, fields were provided, but the underlying updateMemory(id, updates) call returned falsy — the DB layer could not apply the update (row vanished concurrently, constraint violation, or SQLite error). The message names the id that failed to update.","triggerScenarios":"Thrown at src/lib/skills/memoryBuiltins.ts:104 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-list memories to confirm the id still exists, then retry","Inspect server logs for the underlying SQLite error","Retry the update — transient DB lock (SQLITE_BUSY) is a common cause"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}