mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
951d5d1ac4
MCP clients (e.g. openclaw-basic-memory) may send explicit null values for unused optional fields such as find_text, section, and expected_replacements. Previously, expected_replacements was typed as `int = 1` (non-optional), so FastMCP's JSON Schema validation rejected null payloads before the function body ran. Fix: change expected_replacements to Optional[int] = None and resolve the effective value (defaulting to 1) inside the function body. find_text and section were already Optional[str] so they handle null correctly once schema validation passes. Adds a regression test covering the exact payload shape from issue #606. Fixes #606 Co-authored-by: bm-clawd <bm-clawd@users.noreply.github.com> Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>