Skip to content

Verify: MCP memory_save reports saved from the fallback #462

Closed

Description

@possiblyneal

Part of #448

Question

Does fork issue #447 reproduce, where a save that only reached the in-memory fallback reports success and is lost? Upstream: rohitg00#1552, rohitg00#1563, rohitg00#1781, rohitg00#695.

Activity

  1. self-assigned this
    on Nov 18, 2026
  2. possiblyneal commented on Nov 18, 2026

    @possiblyneal
    OwnerAuthor

    Verdict for #462 (fork #447): PARTIAL (reply flag applied; queue not applied)

    • Defect exists on this tree, narrowly: handleLocal memory_save (src/mcp/standalone.ts:349) replied {saved: id} with no marker. It is reached when the livez probe fails or a proxy call fails with a connection error AND no daemon URL is named explicitly (handleToolCall, daemonNamedExplicitly() false). When AGENTMEMORY_URL/FORCE_PROXY is set, memory_save already throws "nothing was saved" (daemonUnreachableMessage); 503 also throws.
    • Repro: test/mcp-save-fallback.test.ts "says the daemon never received it", fails 1/1 on base (localOnly undefined). Passes after fix; with mcp-standalone, mcp-standalone-proxy, mcp-lesson-queue 78/78.
    • Fix applied (acceptance option 1): the local reply keeps saved (existing tests and local recall read it) and adds localOnly: true plus a message saying the daemon will never recall it. Only src/mcp/standalone.ts changed.
    • Not applied: queue-and-replay like Lessons. test/mcp-standalone.test.ts mocks node:fs and asserts writeFileSync call counts, so queueing in the local path would break or need a rewrite of that file; the local store also serves local recall. Queueing would also need lesson-queue.ts generalized (entry carries tool name). Non-atomic InMemoryKV.persist() (in-memory-kv.ts:45-58, plain writeFileSync, concurrent shims overwrite) also not changed; only matters for a path whose data the daemon never reads.
    • Retry if: the Operator runs agentmemory mcp with no AGENTMEMORY_URL and the daemon is down often enough that Memories are lost, or the local store starts to be consumed/merged by the daemon.
    • Operator reach: NO in practice. plugin/.mcp.json and ~/.claude.json:5938 set AGENTMEMORY_URL=${AGENTMEMORY_URL:-http://localhost:3111}, which Claude Code expands to a non-empty value, so the shim is in strict mode and memory_save fails loudly with a down daemon. Only a bare agentmemory mcp launch with no env hits the fallback.
    • Class 2: NO (MCP shim reply only; no Recall/Injection/storage content). eval:suite was run anyway: all 15 metrics unchanged.
    • Bar (tmp/verify/447-verify.log, branch verify/447-save-fallback-queue): typecheck 0 errors; npm test 272 files, 3,117 passed, 1 skipped; build ok; eval:gate and eval:gate:rules pass.
    • Left for apply time: CLAUDE.md "Lesson saves with the daemon down" could add one line that the local memory_save fallback replies localOnly: true.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions