diegosouzapw/OmniRoute · error

Missing required field: content

Error message

Missing required field: content

What it means

Required-field guard in handleMemorySave: `content` is missing or not a string (it follows the key check). The memory body itself is mandatory — there is no such thing as an empty memory — so the save is rejected before persistence.

Solutions

  1. Include a non-empty string content field in the memory_save input
  2. Pre-stringify structured data before saving
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/skills/memoryBuiltins.ts:63 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/34c6ddfb24ec95dc. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/skills/memoryBuiltins.ts:63

    id: memory.id,
    type: memory.type,
    key: memory.key,
    content: memory.content,
    metadata: memory.metadata,
    createdAt: memory.createdAt.toISOString(),
    updatedAt: memory.updatedAt.toISOString(),
  };
}

async function handleMemorySave(input: Record<string, unknown>, context: { apiKeyId: string; sessionId: string }) {
  const { type, key, content, metadata } = input as {
    type?: string;
    key: string;
    content: string;
    metadata?: Record<string, unknown>;
  };
  if (!key || typeof key !== "string") throw new Error("Missing required field: key");
  if (!content || typeof content !== "string") throw new Error("Missing required field: content");

  const saved = await createMemory({
    apiKeyId: context.apiKeyId,
    sessionId: context.sessionId || "",
    type: toMemoryType(type),
    key,
    content,
    metadata: metadata && typeof metadata === "object" ? metadata : {},
    expiresAt: null,
  });

  return {
    success: true,
    memory: memoryToPlain(saved),
    message: "Memory saved successfully",
    context: context.apiKeyId,
  };
}

View on GitHub (pinned to a179ffed5b)