You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCP client: include the calling Agent's session id in tools/call params._meta
#9519
The MCP client bridge sends { name, arguments } as the tools/call params and leaves _meta empty, so an MCP server can tell which process is calling but never which conversation. For any server holding per-conversation state — browser automation with tab groups, editors, anything with sessions — every conversation in the harness ends up in one bucket.
Why it looks like an oversight rather than a decision
_meta is a first-class optional field on every MCP request:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
What
The MCP client bridge sends
{ name, arguments }as thetools/callparams and leaves_metaempty, so an MCP server can tell which process is calling but never which conversation. For any server holding per-conversation state — browser automation with tab groups, editors, anything with sessions — every conversation in the harness ends up in one bucket.Why it looks like an oversight rather than a decision
_metais a first-class optional field on every MCP request:and the other clients already populate it — ZCode sends
session_id, Trae sendschatSessionId, Antigravity sendsantigravity.google/conversation_id, Codex sendsthread_id, WorkBuddy sendsworkbuddy.ai/conversationId.Frames traced from 0.2.0-rc.2 on macOS carry only protocolVersion / clientInfo / clientCapabilities:
{"io.modelcontextprotocol/protocolVersion":"2026-07-28", "io.modelcontextprotocol/clientInfo":{"name":"dsh-mcp-client","version":"0.0.1"}, "io.modelcontextprotocol/clientCapabilities":{}}The identity is already in scope
The agent loop already sets it on the execution:
packages/core/tools/src/index.ts—ToolExecutionInput.agent: "The agent on whose behalf the call runs (set by the agent loop)"packages/core/agent/src/types.ts—Agent.idis theSessionIdand the
tools/callclosure already receives that execution:so it is roughly a three-line change:
Omitting
_metaentirely (rather than sending a null) keeps "no agent on this dispatch" distinguishable from "agent with an unknown id".One naming request
A bare
session_idwould be nice, because that is the key ZCode already sends — servers can then read one key for both clients.Workaround available today
Since this repo does not take external PRs, I built the same change as an extract-and-patch plugin so servers can rely on it in the meantime: https://github.com/Liang-HZ/dsh-plugin-mcp-session-meta
It becomes obsolete the moment this lands, which is rather the point of posting here. Happy to test a build if anyone wants to try one.
All reactions