Repository navigation
feat: Add mcp-handler tracing - #2696
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b890521076
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| ); | ||
| // Per-request HTTP transports close as part of sending the terminal result, | ||
| // before the send promise settles. Let that promise determine the outcome. | ||
| if (!request.responseInFlight) { |
There was a problem hiding this comment.
Restrict close suppression to per-request transports
When a normal stateful transport such as WebSocket or stdio closes while its response send() is pending, responseInFlight now suppresses the connection-closed failure for every transport. If that send later resolves, the request is incorrectly recorded as successful; if it never settles after disconnection, the span remains open indefinitely. The comment describes behavior specific to per-request HTTP transports, so the suppression should be limited to those transports rather than all in-flight sends.
Useful? React with 👍 / 👎.
Add automatic Braintrust tracing for MCP servers created with
mcp-handlerv1 and v2.Add
wrapMCPHandler()for manual tracing andintegrations.mcpHandlerto configure the integration.Wait for response sending to finish before recording an MCP request as complete.
Previously, HTTP connection cleanup could mark successful requests as failed.