Skip to content

fix: one name for the memory MCP server; drop "Claude" from a shared notice - #307

Merged
saucam merged 2 commits into
mainfrom
fix/qwen-memory-name-and-provider-agnostic-notice
Aug 29, 2026
Merged

fix: one name for the memory MCP server; drop "Claude" from a shared notice#307
saucam merged 2 commits into
mainfrom
fix/qwen-memory-name-and-provider-agnostic-notice

Conversation

@saucam

@saucam saucam commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Two backend-leakage bugs, both found in a live qwen session.

1. The memory MCP server had two names

value who uses it
MEMORY_MCP_SERVER_NAME codeoid_memory every mount key + all isSafeTool prefixes
instance name (mcp.ts) codeoid-memory hard-coded literal

Backends disagree about which one they namespace mounted tools by: the Claude SDK uses the mcpServers map key; qwen-code uses the server instance's own name.

So on qwen the recall tools were exposed as mcp__codeoid-memory__* — matching neither the provider's allowedTools grant nor any isSafeTool prefix. The read-only memory tools raised an approval prompt on every call, when the entire point of recall is that it's transparently available.

Claude was unaffected (map key = the constant), which is exactly why nothing caught it.

Visible in a real transcript — same session, adjacent turns:

02:06:19  MCP ready: … codeoid_memory (247 tools)     ← claude turns
03:09:42  MCP ready: codeoid-memory, … (64 tools)     ← qwen turns

Fix: the instance uses the constant. One name removes the whole class of mismatch, rather than teaching each backend about both spellings.

The test is the reason this survived — it asserted the literal "codeoid-memory", so it passed while the divergence existed. It now asserts against the constant and additionally checks the resulting tool names are actually auto-approvable, which is the property that was broken.

2. A shared code path named Claude

The mid-turn queue notice is reached by any keep-warm backend supporting injection, but read:

⎆ Queued mid-turn — Claude is re-integrating with new context

In a Qwen session that renders between the user's question and Qwen's answer, reading like the wrong backend replied. This was the observation that kicked off the investigation.

Not included

While confirming this I also saw the qwen mcp_init tool count vary across turns with an identical server list (64 → 153 → 125). That's a discovery race — a snapshot taken before MCP discovery settles, not a leak, since counts fall as well as rise. It needs a separate look and isn't bundled here.

Verification

lint + typecheck clean, 2383 pass / 0 fail.

🤖 Generated with Claude Code

…notice

Both surfaced in a live qwen session and both are backend-leakage bugs.

1. The memory MCP server had two names.

`MEMORY_MCP_SERVER_NAME` is "codeoid_memory" and every mount key and
`isSafeTool` prefix derives from it, but `buildMemoryMcpServer` hard-coded the
INSTANCE name as "codeoid-memory". Backends disagree about which of the two
they namespace mounted tools by: the Claude SDK uses the mcpServers map KEY,
qwen-code uses the instance's own name.

So on the qwen backend the recall tools were exposed as
`mcp__codeoid-memory__*`, which matched neither the provider's `allowedTools`
grant nor any `isSafeTool` prefix — and the read-only memory tools raised an
approval prompt on every single call, when the whole point is that recall is
transparently available. Claude was unaffected, which is why nothing caught it.

The instance now uses the constant. One name removes the class of mismatch
rather than teaching each backend about both spellings. The test that asserted
the literal is the reason this survived, so it now asserts against the constant
and additionally checks the resulting tool names are auto-approvable.

2. A shared code path named Claude.

The mid-turn queue notice is reached by any keep-warm backend that supports
injection, but read "Claude is re-integrating with new context". In a Qwen
session that renders between the user's question and Qwen's answer, which reads
like the wrong backend replied — the observation that started this
investigation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@saucam
saucam merged commit 0284648 into main Aug 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants