Save-hook diary checkpoint is refused while a `mempalace serve` hub holds the writer lease (3.10.0)
Version / platform: mempalace 3.10.0, chromadb 1.5.9, Windows 11, Python 3.13, Claude Code harness.
Setup: one mempalace serve --palace <path> hub is the palace's only writer (as recommended for
several concurrent agent sessions). Sessions use the stdio mempalace-mcp proxy, which forwards to
the hub, and the Stop/PreCompact save hooks run mempalace hook run.
What happens: on every save, the transcript mine is forwarded to the hub and succeeds, but the diary checkpoint is refused:
[20:46:52] TRIGGERING SAVE at exchange 15
[20:46:59] Diary checkpoint failed: another mine is in progress: palace C:\...\palace is held by PID 18872 (...\mempalace\mcp_server\__main__.py --transport http); wait for it to finish or stop the holder before retrying
mempalace: forwarding mine to palace hub http://127.0.0.1:8765 (pid 18872)Why, as far as we can tell: hooks_cli._save_diary_direct calls tool_diary_write in-process
(around hooks_cli.py:1110-1135). Unlike cmd_mine, which hands the job to a live hub via
_forward_mine_to_hub, the diary path has no hub forward, so it needs the writer lease the hub
already holds. The daemon path (write_routing) is covered, but a hub is not.
Impact: transcripts are still captured (thanks to the mine forwarding added in 3.9), so the
verbatim record is intact. What is lost is the per-save diary entry, so mempalace_diary_read has
no checkpoints for sessions saved while a hub is running.
Possible fix: when server_registry.read_live_serverinfo() finds a live, writable hub, send the
checkpoint as a mempalace_diary_write tool call over HTTP, the same way _forward_mine_to_hub
does for mines, and keep the in-process write as the fallback when no hub is running.
Thank you for the hub forwarding and the stdio proxy in 3.8–3.9; they made a multi-session setup workable on this machine.
Source: MemPalace/mempalace