Commit 537b132
authored
[Repo Assist] fix(mcp): remove duplicate debug log statements in HTTP transport (#4592)
🤖 *This PR was created by Repo Assist, an automated AI assistant.*
Removes 5 redundant debug log lines identified in issues #4584 and
#4585.
## Root Cause
Two recent commits introduced debug logging inside `http_transport.go`
that duplicated existing logs already present at the call sites in
`connection.go`:
1. **Issue #4584**: `connection.go` logged `"Attempting X transport for
%s"` before calling each `try*Transport` function, while
`http_transport.go` already logged the same event at function entry —
with *more* context (`serverID`, `connectTimeout`).
2. **Issue #4585**: `sendHTTPRequest` logged `"Sending HTTP request"`
and `"Received HTTP response"` at the wrapper level, while the inner
`executeHTTPRequest` function already logged `"Executing HTTP request"`
and `"HTTP response received"` with equivalent (or more granular)
information.
## Fix
- `connection.go`: removed 3 call-site `logConn.Printf("Attempting ...
transport")` lines (258, 267, 277). The failure logs (`"Streamable HTTP
failed"`, etc.) are kept.
- `http_transport.go`: removed 2 wrapper-level logs from
`sendHTTPRequest` (lines 646, 653). The per-function-entry logs in
`executeHTTPRequest` are retained.
## Trade-offs
- **Retained**: all failure/error logs, success logs, reconnect logs —
nothing diagnostic is lost.
- **Removed**: purely duplicated "attempt started" and "request
sent/received" lines.
- Net effect: `DEBUG=mcp:*` traces produce one log per transport attempt
and one log per HTTP round-trip instead of two.
## Test Status
2 files changed
Lines changed: 0 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
259 | 258 | | |
260 | 259 | | |
261 | 260 | | |
| |||
264 | 263 | | |
265 | 264 | | |
266 | 265 | | |
267 | | - | |
268 | 266 | | |
269 | 267 | | |
270 | 268 | | |
| |||
274 | 272 | | |
275 | 273 | | |
276 | 274 | | |
277 | | - | |
278 | 275 | | |
279 | 276 | | |
280 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
646 | | - | |
647 | 646 | | |
648 | 647 | | |
649 | 648 | | |
650 | 649 | | |
651 | 650 | | |
652 | 651 | | |
653 | | - | |
654 | | - | |
655 | 652 | | |
656 | 653 | | |
657 | 654 | | |
| |||
0 commit comments