diegosouzapw/OmniRoute · error
Failed to update memory
Error message
Failed to update memory: ${id} What it means
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.
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
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at src/lib/skills/memoryBuiltins.ts:104 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/749c42cdcbbfe4cd.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/skills/memoryBuiltins.ts:104
type?: string;
key?: string;
content?: string;
metadata?: Record<string, unknown>;
};
if (!id || typeof id !== "string") throw new Error("Missing required field: id");
await assertOwner(id, context.apiKeyId);
const updates: Record<string, unknown> = {};
if (type !== undefined) updates.type = toMemoryType(type);
if (key !== undefined) updates.key = key;
if (content !== undefined) updates.content = content;
if (metadata !== undefined) updates.metadata = metadata;
if (Object.keys(updates).length === 0) throw new Error("No fields to update");
const ok = await updateMemory(id, updates);
if (!ok) throw new Error(`Failed to update memory: ${id}`);
return {
success: true,
id,
message: "Memory updated successfully",
context: context.apiKeyId,
};
}
async function handleMemorySearch(input: Record<string, unknown>, context: { apiKeyId: string }) {
const { query, type, limit, maxTokens } = input as {
query?: string;
type?: string;
limit?: number;
maxTokens?: number;
};
const memorySettings = (await getMemorySettings().catch(() => null)) ?? DEFAULT_MEMORY_SETTINGS;View on GitHub (pinned to a179ffed5b)