From 31fff1c3546f4043ca67f03c1168b452bfd4ccd1 Mon Sep 17 00:00:00 2001 From: Igor Lins e Silva <4753812+igorls@users.noreply.github.com> Date: Sat, 20 Jun 2026 19:25:53 -0300 Subject: [PATCH] fix(mcp): route _sqlite_graph_stats through sqlite_read_uri MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The graph_stats sqlite reader (#1837) and the sqlite_read_uri encoding fix (#1838) landed in parallel, so _sqlite_graph_stats was the one reader left on the naive f"file:{db_path}?mode=ro" construction that mis-parses paths with spaces/special chars. Convert it too — now every read-only sqlite reader percent-encodes its path. sqlite_read_uri is already imported in mcp_server from #1838, so this is a call-site-only change. --- mempalace/mcp_server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mempalace/mcp_server.py b/mempalace/mcp_server.py index 6323c70..071ab61 100644 --- a/mempalace/mcp_server.py +++ b/mempalace/mcp_server.py @@ -1048,7 +1048,7 @@ def _sqlite_graph_stats(): # graph_stats degrades to build_graph() rather than raising — mirroring the # sibling sqlite fast paths (_sqlite_taxonomy / _sqlite_wing_room_counts). try: - conn = _sqlite3.connect(f"file:{db_path}?mode=ro", uri=True) + conn = _sqlite3.connect(sqlite_read_uri(db_path), uri=True) try: conn.execute("PRAGMA busy_timeout = 3000") if (