Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions internal/mcp/http_transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,12 +643,19 @@ func (c *Connection) sendHTTPRequest(ctx context.Context, method string, params
headerModifier := c.buildSessionHeaderModifier(ctx)

requestID := atomic.AddUint64(&requestIDCounter, 1)
if !logHTTP.Enabled() {
logConn.Printf("Sending HTTP request to %s: method=%s, id=%d", c.httpURL, method, requestID)
}

result, err := c.executeHTTPRequest(ctx, method, params, requestID, headerModifier)
if err != nil {
Comment on lines 645 to 651

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By removing the request/response logs here, HTTP round-trip visibility now depends entirely on the mcp:http_transport logger (i.e., DEBUG=mcp:connection will no longer show any per-request send/receive lines). If the intent is only to remove duplicates under DEBUG=mcp:* while preserving the existing mcp:connection behavior, consider emitting the logConn lines conditionally (e.g., only when !logHTTP.Enabled()), or otherwise ensuring the connection-level logger still provides a single request/response pair.

Copilot uses AI. Check for mistakes.
return nil, err
}

if !logHTTP.Enabled() {
logConn.Printf("Received HTTP response: status=%d, body_len=%d", result.StatusCode, len(result.ResponseBody))
}

// If the backend reported that the session has expired, reconnect and retry once.
if isSessionNotFoundHTTPResponse(result.StatusCode, result.ResponseBody) {
logConn.Printf("Session not found from %s (serverID=%s), attempting reconnect", c.httpURL, c.serverID)
Expand Down
Loading