fix: mempalace-mcp uninterruptible hang resolved via toolkit ext timeout

The per-request timeout + stall-kill landed in mempalace-toolkit's
mempalace.ts pi extension (commit a3b8829), which the base clones at
build via MEMPALACE_TOOLKIT_REF=main. A base rebuild picks it up.

- CHANGELOG: move from 'Known issues' to 'Fixed'; document the env knobs
  (MEMPALACE_MCP_TIMEOUT_MS / MEMPALACE_MCP_INIT_TIMEOUT_MS) and why the
  standalone stdio-watchdog shim was dropped.
- Dockerfile.base: replace the TODO with a note pointing at the fix.
This commit is contained in:
pi
2026-06-13 23:49:36 +02:00
parent 7f67c36a1c
commit 05e88c5c75
2 changed files with 39 additions and 27 deletions
+9 -8
View File
@@ -280,14 +280,15 @@ RUN ARCH=$(case "${TARGETARCH}" in amd64) echo "x86_64" ;; arm64) echo "aarch64"
# Always installed in the base. Set INSTALL_MEMPALACE=false at base-build
# time to shave ~300 MB.
#
# TODO(2026-06-13): wrap mempalace-mcp with a stdio-watchdog shim that
# applies a per-REQUEST timeout (not a per-process timeout — naive
# `timeout 60 mempalace-mcp` would kill the long-lived server mid-session).
# When the palace is bind-mounted from macOS via OrbStack virtiofs, cold
# chroma.sqlite3 open or HNSW load can stall the JSON-RPC `initialize`
# response and pi's TUI sits uninterruptibly (ESC cancels the LLM stream,
# not the MCP child stdio). See CHANGELOG.md "Unreleased > Known issues".
# Recovery today: `docker exec <ctr> pkill -9 -f mempalace-mcp`.
# Stall protection (fixed 2026-06-13): mempalace-mcp is launched by the
# `mempalace.ts` pi extension from mempalace-toolkit (cloned below). That
# extension now applies a per-REQUEST timeout in its JSON-RPC client and
# kills the child on stall, so a virtiofs cold-open of chroma.sqlite3 /
# HNSW load can no longer hang the pi TUI uninterruptibly. Tunables:
# MEMPALACE_MCP_TIMEOUT_MS (default 60000), MEMPALACE_MCP_INIT_TIMEOUT_MS
# (default 120000); 0 disables. A standalone stdio-watchdog shim is NOT
# needed — the extension already owns request/response correlation. See
# CHANGELOG.md "Unreleased > Fixed".
ARG INSTALL_MEMPALACE=true
# Pin to a known-good version. Bump deliberately, not implicitly: an
# unpinned install silently swept in mempalace 3.3.x/3.4.0 with a broken