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
Simplify endpoint filter: tag before next() for child span inheritance
Move Activity.AddTag before next() so child spans created during
request processing inherit the transport session ID. Accept that the
first initialize request won't have the tag (no request header yet).
Update test to match the simplified pattern.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
> In stateful mode, the `Mcp-Session-Id` response header is set on **every POST and GET response**, not just the `initialize`response. This means the session ID is always available in the filter after `await next(context)`. The only case where `sessionId` is `null` is in stateless mode, where the server doesn't use sessions at all.
678
+
> The tag is added **before** calling `next()` so that any child activities created during request processing inherit it. The trade-off is that the very first `initialize`request won't have the tag, because the client doesn't have a session ID yet — the server assigns it in the response. All subsequent requests will have it.
0 commit comments