@@ -25,16 +25,16 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
2525HOOKS_DIR=" ${CLAUDE_PLUGIN_ROOT: +$CLAUDE_PLUGIN_ROOT / hooks} "
2626HOOKS_DIR=" ${HOOKS_DIR:- $SCRIPT_DIR } "
2727
28- # Memory path/cache/mcp-name/port come from the shared resolver (precedence:
29- # WORKBENCH_* override → config.json → default). It also exports the full
30- # MARKDOWN_VAULT_MCP_* set, harmless here. memory_load_env sets MEMORY_PATH,
31- # CACHE_PATH, MCP_NAME, MEMORY_PORT.
28+ # Memory path/cache come from the shared resolver (precedence: WORKBENCH_*
29+ # override → config.json → default). It also exports the full MARKDOWN_VAULT_MCP_*
30+ # set, harmless here. memory_load_env sets MEMORY_PATH and CACHE_PATH, both used
31+ # below. memory-probe.sh is deliberately NOT sourced any more: the shared-server
32+ # health check was disabled when the memory transport reverted to per-session
33+ # stdio (v0.13.0) — there is no external server to probe. See the breadcrumb
34+ # where that block used to live, further down.
3235# shellcheck source=hooks/lib/memory-env.sh
3336. " $HOOKS_DIR /lib/memory-env.sh"
34- # shellcheck source=hooks/lib/memory-probe.sh
35- . " $HOOKS_DIR /lib/memory-probe.sh"
3637memory_load_env
37- MCP_SERVER_NAME=" $MCP_NAME "
3838
3939# Config resolution for warmup-only fields (agent_name, identity_files).
4040# Prefer the current data dir; fall back to the pre-rename location so users
@@ -398,41 +398,20 @@ if [ "$SOURCE" = "startup" ]; then
398398 find " $CACHE_PATH " -name " summary-writer-*.log" -delete 2> /dev/null
399399fi
400400
401- # ──────────── Memory server health check (startup only) ────────────
402- # The memory server is now a shared HTTP server, lazy-started by the
403- # memory-server-up hook that runs just before this warmup. Probe its actual
404- # health (identity-checked) rather than guessing from the index file's presence.
405- # Only surface a notice when something is wrong — a healthy/coming-up server is
406- # the common case and needs no words.
407- if [ " $SOURCE " = " startup" ]; then
408- case " $( memory_probe) " in
409- UP|BUILDING)
410- : # serving (BUILDING = bound, index still building, search available) — quiet.
411- ;;
412- PORT_DRIFT)
413- printf ' ## ⚠ Memory server port drift\n\n'
414- printf ' The running memory server bound a different port than configured (port `%s`).\n' " $MEMORY_PORT "
415- printf ' This usually means `WORKBENCH_MEMORY_PORT` in `~/.claude/settings.json` and the\n'
416- printf ' recorded `%s/server.port` disagree. Reconcile them (or run `/workbench-core:memory-status`), then restart Claude Code.\n\n' " $CACHE_PATH "
417- ;;
418- DOWN_FOREIGN)
419- printf ' ## ⚠ Memory server port conflict\n\n'
420- printf ' Another process is listening on memory port `%s` that is not the `%s` vault.\n' " $MEMORY_PORT " " $MCP_SERVER_NAME "
421- printf ' The shared server was not started to avoid a conflict. Free the port or set a different\n'
422- printf ' `WORKBENCH_MEMORY_PORT`, then restart. See `/workbench-core:memory-status`.\n\n'
423- ;;
424- DOWN_FAILED)
425- printf ' ## ⚠ Memory server failed to start\n\n'
426- printf ' The last attempt to start the shared memory server failed (see `%s/server.log`).\n' " $CACHE_PATH "
427- printf ' Memory search and write will fail until it comes up. Run `/workbench-core:memory-status` to diagnose.\n\n'
428- ;;
429- * ) # DOWN_NONE — not up yet; the up-hook just kicked a spawn that binds in ~2s.
430- printf ' ## ℹ Memory server starting\n\n'
431- printf ' The shared memory server is starting in the background (binds in ~2s; the client retries the connection).\n'
432- printf ' If memory tools are unavailable this turn, they should work shortly — or next session.\n\n'
433- ;;
434- esac
435- fi
401+ # ──────────── Memory server health check — disabled (per-session stdio) ────────
402+ # A shared-HTTP health probe lived here through v0.12: it ran memory_probe and
403+ # surfaced port-drift / conflict / failed / starting notices for the lazy-started
404+ # shared server. It was removed in v0.13.0 when the transport reverted to a
405+ # per-session stdio server: stdio spawns the server in-process per session, so
406+ # there is NO external listener to probe — the probe returned DOWN_NONE every
407+ # startup and printed a phantom "Memory server starting" notice. The MCP host's
408+ # own connect error is the real signal for a broken stdio launcher now.
409+ #
410+ # To RE-ENABLE the shared HTTP server, restore this block and the memory-probe.sh
411+ # source near the top of this file (both are in git history), re-add the
412+ # memory-server-up.sh SessionStart hook in hooks/hooks.json, and switch
413+ # plugin.json's memory MCP back to the http transport. See README, section
414+ # "Memory server transport — re-enabling the shared HTTP server (optional)".
436415
437416# ──────────── Recall-hook liveness check (startup only) ────────────
438417# memory-recall.sh stamps last-attempt on every substantive prompt. A stamp
0 commit comments