Skip to content

[log] Add debug logging to mcpresult content handling - #16555

Merged
lpcox merged 1 commit into
mainfrom
log/mcpresult-debug-logging-5b80fa0d0f151411
Nov 15, 2026
Merged

lpcox merged 1 commit into
mainfrom
log/mcpresult-debug-logging-5b80fa0d0f151411

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Adds meaningful debug logging to internal/mcpresult/mcpresult.go, reusing the existing logMCPResult logger.

New log points (no side effects in arguments):

  • IsErrorResult: logs when a result is marked isError=true
  • NormalizeContentItems: logs the count of non-map items silently skipped
  • ExtractTextContent: logs unknown content types treated as text, and the count of skipped image/audio/resource items

Validation: go vet and go test ./internal/mcpresult pass, and go build -o awmg succeeds.

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

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

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 actionable issues were identified in the targeted logging changes, which add diagnostic visibility without altering result-processing behavior.

No open issues 🎉

What changed in this PR

This pull request adds targeted debug logging to MCP result content handling without changing result-processing behavior.

Changes:

  • Logs MCP results marked with isError=true.
  • Logs counts of non-map items skipped during content normalization.
  • Logs unknown content types treated as text and skipped non-text content during extraction.

No actionable issues were identified.

File Description
internal/​mcpresult/​mcpresult.go Adds debug logging around MCP result classification, content normalization skips, and text extraction decisions.

Review effort: Lite (dynamic)

@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 7 write-tool targets absent from the github CLI catalog (23 read-only tools) BLOCKED ⚠️ INCONCLUSIVE
C CLI reads (same 4 as Part A via proxy) data returned ALLOWED ✅
D CLI REST writes (reaction/star/issue/comment) not attempted — gh auth status = not logged in BLOCKED ⚠️ INCONCLUSIVE
E CLI GraphQL mutations (addReaction/addStar/createIssue) not attempted — gh unauthenticated BLOCKED ⚠️ INCONCLUSIVE

Overall: INCONCLUSIVE (no write leaked through mcpg)

Notes:

  • Part B: the github CLI (gateway-proxied MCP) only exposes 23 read-only tools; none of the 7 target write tools (add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request) are present in the catalog at all, so the gateway's own write-blocking layer could not be independently exercised on this surface — this reflects backend config (GITHUB_READ_ONLY=1), not confirmed mcpg enforcement.
  • Parts D/E: gh CLI is not authenticated in this environment (You are not logged into any GitHub hosts), so REST/GraphQL write attempts were skipped per the test's safety rules rather than silently treated as blocked.
  • No reaction, star, issue, comment, branch, file, or PR was created or leaked during this run.

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

@lpcox
lpcox merged commit d88cff4 into main Nov 15, 2026
28 checks passed
@lpcox
lpcox deleted the log/mcpresult-debug-logging-5b80fa0d0f151411 branch November 15, 2026 00:53
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