Skip to content

[log] Add debug logging to proxy/response_headers.go - #16965

Merged
lpcox merged 1 commit into
mainfrom
log/proxy-response-headers-a3068f87d49cd472
Nov 21, 2026
Merged

lpcox merged 1 commit into
mainfrom
log/proxy-response-headers-a3068f87d49cd472

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Adds 5 debug log calls to internal/proxy/response_headers.go, reusing the existing logHandler (proxy:handler):

  • isArtifactDownload: logs when a streamed artifact download is detected
  • clientAPIURL: logs the resolved client API base and /gh prefix handling
  • rewriteLinkHeader: logs the Link header size before rewriting
  • injectRetryAfterIfRateLimited: logs the no-signal path and Retry-After injection

Log arguments are plain values with no side effects.

Validation: go vet ./internal/proxy, go test ./internal/proxy, and go build -o awmg all pass.

Generated by Go Logger Enhancement · copilot · routed: sonnet55 high · ~32 AIC · ⊞ 5.9K · ◷

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

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.

🟢 Approval recommended

No active review issues are identified, and the changes are limited to debug logging without altering request or response behavior.

No open issues 🎉

What changed in this PR

Adds debug-level observability to proxy response-header and artifact-download handling using the existing proxy:handler logger, without changing request or response behavior.

Changes:

  • Logs streamed artifact-download detection.
  • Logs client API URL resolution and /gh prefix handling.
  • Logs Link header sizes and rate-limit Retry-After handling.
File Description
internal/​proxy/​response_headers.go Adds debug logging for artifact detection, client URL resolution, Link header rewriting, and rate-limit handling.

Review effort: Lite (adaptive)

@github-actions

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — default

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default AWF (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 the 23-tool catalog; calls return \"unknown tool\" (-32602) BLOCKED ⚠️
C CLI reads (same gateway-backed github CLI) data returned ALLOWED ✅
D CLI REST writes (reaction/star/issue/comment) gh CLI not authenticated in this environment BLOCKED ⚠️
E CLI GraphQL mutations (addReaction/addStar/createIssue) gh CLI not authenticated BLOCKED ⚠️

Overall: INCONCLUSIVE

⚠️ Part B: the gateway-backed github MCP tool catalog exposes only 23 read-only tools (list_/get_/search_*/issue_read/pull_request_read); none of the targeted write tools (add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request) are present, so calls fail as \"unknown tool\" rather than a gateway-specific DIFC refusal. This confirms backend read-only configuration but does not independently exercise mcpg's own write-blocking layer for an in-catalog tool.

⚠️ Parts D/E: gh auth status shows no authenticated host (GH_TOKEN not set), so REST/GraphQL write attempts could not be issued to validate the token-scope boundary in this run.

No write succeeded on any surface; no artifacts were leaked.

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

@lpcox
lpcox merged commit 6aa4659 into main Nov 21, 2026
28 checks passed
@lpcox
lpcox deleted the log/proxy-response-headers-a3068f87d49cd472 branch November 21, 2026 16:36
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.

2 participants