1.9.0
Minor Changes
-
#5942
a94641dThanks @lucasheriques! - Tool calls from Claude, Cursor, and otheropenai-mcp/clients now take their session from the client's own conversation id inparams._meta, so their calls stay grouped with conversation correlation turned off:com.anthropic/sessionfrom Claude (User-AgentClaude-Userorclaude-code/…, or client nameAnthropic/ClaudeAIorclaude-code).gen_ai.conversation.idfrom Cursor (User-AgentCursor/…, or client nameCursororcursor-vscode).openai/sessionfrom anyopenai-mcp/User-Agent, not only ChatGPT's. A request with thatUser-Agentand client namecodex-mcp-clientnow readsopenai/sessioninstead ofsessionId.
A call that carries one of these ids now gets no
conversation_idblock in its result, records$mcp_session_sourceasclient_metadatawith no$mcp_conversation_id, and leaves the id out of$mcp_parameters. Conversations in flight at upgrade start a new session. These clients still get a conversation handle on calls that carry no id. (2026-11-30) -
#5895
6f0a733Thanks @lucasheriques! -PostHogMCP's step path (prepareToolCall,prepareToolResult) now resolves sessions the wayinstrument()does, per the sdk-specs MCP analytics spec. Notable behavior change: a raw transport id passed toprepareToolCallnow yields a hashed$session_id, so a session in flight at upgrade splits once, and calls stop matchingcaptureInitializeandcaptureToolsListevents that still send the raw id until you spread inresolveSession.prepareToolCall'ssessionIdis a transport session: a PostHog session token gives the session inside it, and any other id is hashed into ases_id. Before, it was sent as given, so the sameMcp-Session-Idproduced different$session_idvalues on the two paths.- New
connectionKeyoption for one-client connections (stdio): the SDK keeps a session per key and rotates it on the first call 30 minutes or more after the previous one ended. CallprepareToolResultfor failed calls too, since a call holds the session open until then. - New
resolveSession({ sessionId, connectionKey })givescaptureInitialize,captureToolsListand other out-of-call captures the tool calls' session. Those methods still send asessionIdas given, so if you passed the raw transport id to them, spreadresolveSessionin instead to keep one session per connection. - A minted conversation handle that never reaches the agent no longer sets the session.
prepareToolCallandprepareToolResultreturnsessionSource, and capture methods accept it as$mcp_session_source. A capture without asessionIdrecordsgenerated. (2026-11-30)
Patch Changes
-
#5894
e43bf37Thanks @lucasheriques! - Session identity now follows the sdk-specs MCP analytics spec more closely:- A session from your
sessionIdoption records$mcp_session_sourceashost(wastransport). - On a one-client connection (stdio), the generated session rotates on the first tool call that arrives 30 minutes or more after the previous tool call ended. Listings and other requests no longer keep it alive or rotate it, and the most recent call, while it runs, holds it open. An earlier call that never settles does not.
- While a call's session rests on a conversation handle minted for it, its custom events wait and go out with the call's final session and identity. Past 1,000 held events, the rest are now sent at once with the session the call has without its handle, instead of being dropped. (2026-11-30)
- A session from your
-
Updated dependencies [
d65dde7]:- @posthog/core@1.69.3
- posthog-node@6.2.1