Skip to content

[log] Add debug logging to mcp/http_transport.go - #16190

Merged
lpcox merged 3 commits into
mainfrom
log/mcp-http-transport-58a003a7dcf19b6c
Nov 9, 2026
Merged

lpcox merged 3 commits into
mainfrom
log/mcp-http-transport-58a003a7dcf19b6c

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Adds debug logging (existing logHTTP/logConn loggers) to previously unlogged paths in internal/mcp/http_transport.go:

  • isHTTPConnectionError: network op error detection
  • isSessionNotFoundError / isSessionNotFoundHTTPResponse: which detection path matched
  • initializeHTTPSessionContext: failure paths (request error, non-OK status, JSON-RPC error)

No side effects in log args; no secrets or bodies logged. Validated with go vet, go test ./internal/mcp, and go build.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • thishostdoesnotexist12345.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "thishostdoesnotexist12345.com"

See Network Configuration for more information.

Generated by Go Logger Enhancement · copilot · auto (Claude Sonnet 5.5) · ~36 AIC · ⊞ 6.4K · ◷

@github-actions github-actions Bot added automation enhancement New feature or request labels Nov 8, 2026
@lpcox
lpcox marked this pull request as ready for review November 9, 2026 00:49
Copilot AI adaptive review requested due to automatic review settings November 9, 2026 00:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A critical active finding remains because the debug log can emit credentials or query tokens from the wrapped request URL without applying the required enclave-aware redaction.

1 open issue
What changed in this PR

Adds debug logging to previously unlogged HTTP transport connection, session-detection, and initialization failure paths in internal/mcp/http_transport.go.

Changes:

  • Logs network-operation and session-not-found detection paths.
  • Logs initialization request failures, non-OK responses, and JSON-RPC errors.
  • Preserves response body-length-only diagnostics.
File Review
internal/​mcp/​http_transport.go Adds diagnostic logging across HTTP transport and initialization paths. A critical issue remains: wrapped errors may include credentials or query-token parameters from backend URLs and must be sanitized before being logged.

This pull request requires changes.

Review effort: Lite (auto)

Comment thread internal/mcp/http_transport.go Resolved
@github-actions

This comment has been minimized.

Updated error logging to sanitize sensitive information.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Comment thread internal/mcp/http_transport.go Resolved
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — default

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default (normal container isolation)

Part Surface Op Result Expected Status
A MCP reads (list_issues/list_pull_requests/get_file_contents/list_commits) data returned ALLOWED ✅
B MCP writes (reaction/star/issue/comment/branch/file/PR) all 6 write tools absent from catalog (only 23 read tools exposed) BLOCKED ⚠️
C CLI reads (github list_issues, get_file_contents) data returned ALLOWED ✅
D CLI REST writes gh CLI not authenticated (gh auth status: not logged in) BLOCKED ⚠️
E CLI GraphQL mutations gh CLI not authenticated BLOCKED ⚠️

Overall: INCONCLUSIVE

(⚠️ = no write leaked, but gateway-level enforcement could not be independently confirmed: Part B write tools were never registered in the github CLI catalog — consistent with gh-aw's GITHUB_READ_ONLY=1 backend wrapper, not proof of mcpg's own DIFC/guard layer; Parts D/E could not run because gh had no credentials in this environment.)

No write of any kind succeeded or leaked through on this run.

🔒 mcpg read-only stress (default AWF runtime) by Read-Only Stress: default runtime

@lpcox
lpcox merged commit 4817db9 into main Nov 9, 2026
30 checks passed
@lpcox
lpcox deleted the log/mcp-http-transport-58a003a7dcf19b6c branch November 9, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants