Skip to content

[log] Add debug logging to mcp/tool_result.go#2061

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/aw-go-logger-enhancement-debug
Draft

[log] Add debug logging to mcp/tool_result.go#2061
Copilot wants to merge 2 commits intomainfrom
copilot/aw-go-logger-enhancement-debug

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

The "Go Logger Enhancement" agentic workflow failed because the agent made valid changes to internal/mcp/tool_result.go but couldn't validate or commit them — bash commands like make agent-finished and go build ./... were blocked by the workflow's strict tool allowlist, causing the job to exit without producing a patch.

Changes

  • ConvertToCallToolResult — added entry log and success log (reports content_items and is_error)
  • ParseToolArguments — added entry log (tool name) and success log (argument count); previously had zero logging calls

Uses the existing logToolResult = logger.New("mcp:tool_result") logger; no new imports or declarations needed.

func ConvertToCallToolResult(data interface{}) (*sdk.CallToolResult, error) {
    logToolResult.Print("Converting backend result to CallToolResult")
    // ...
    logToolResult.Printf("Converted result: content_items=%d, is_error=%v", len(content), backendResult.IsError)
    return &sdk.CallToolResult{...}, nil
}

func ParseToolArguments(req *sdk.CallToolRequest) (map[string]interface{}, error) {
    logToolResult.Printf("Parsing arguments for tool: %s", req.Params.Name)
    // ...
    logToolResult.Printf("Parsed %d arguments for tool: %s", len(toolArgs), req.Params.Name)
    return toolArgs, nil
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /tmp/go-build4231811108/b332/launcher.test /tmp/go-build4231811108/b332/launcher.test -test.testlogfile=/tmp/go-build4231811108/b332/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build4231811108/b270/vet.cfg ache/go/1.25.8/x64/src/runtime/c-c=4 _cgo_.o x_amd64/vet OUTPUT -d 168.63.129.16 x_amd64/vet --de�� 64/src/net --log-level x_amd64/vet --log-target journal-or-kmsg (dns block)
  • invalid-host-that-does-not-exist-12345.com
    • Triggering command: /tmp/go-build4231811108/b317/config.test /tmp/go-build4231811108/b317/config.test -test.testlogfile=/tmp/go-build4231811108/b317/testlog.txt -test.paniconexit0 -test.timeout=10m0s --no�� 64/src/runtime/cgo (dns block)
  • nonexistent.local
    • Triggering command: /tmp/go-build4231811108/b332/launcher.test /tmp/go-build4231811108/b332/launcher.test -test.testlogfile=/tmp/go-build4231811108/b332/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build4231811108/b270/vet.cfg ache/go/1.25.8/x64/src/runtime/c-c=4 _cgo_.o x_amd64/vet OUTPUT -d 168.63.129.16 x_amd64/vet --de�� 64/src/net --log-level x_amd64/vet --log-target journal-or-kmsg (dns block)
  • slow.example.com
    • Triggering command: /tmp/go-build4231811108/b332/launcher.test /tmp/go-build4231811108/b332/launcher.test -test.testlogfile=/tmp/go-build4231811108/b332/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build4231811108/b270/vet.cfg ache/go/1.25.8/x64/src/runtime/c-c=4 _cgo_.o x_amd64/vet OUTPUT -d 168.63.129.16 x_amd64/vet --de�� 64/src/net --log-level x_amd64/vet --log-target journal-or-kmsg (dns block)
  • this-host-does-not-exist-12345.com
    • Triggering command: /tmp/go-build4231811108/b341/mcp.test /tmp/go-build4231811108/b341/mcp.test -test.testlogfile=/tmp/go-build4231811108/b341/testlog.txt -test.paniconexit0 -test.timeout=10m0s @v1.�� 64/src/net ache/go/1.25.8/x64/src/net/netip/netip.go x_amd64/compile -p crypto/internal//usr/bin/runc -lang=go1.25 x_amd64/compile -I /opt/hostedtoolcache/go/1.25.8/x64/src/runtime/c-p 4742298/b100/ x_amd64/vet -pthread -Wl,--no-gc-sectinspect -fmessage-length--format x_amd64/vet (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI linked an issue Mar 17, 2026 that may be closed by this pull request
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] [aw] Debug Go Logger Enhancement workflow failure [log] Add debug logging to mcp/tool_result.go Mar 17, 2026
Copilot AI requested a review from lpcox March 17, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw] Go Logger Enhancement failed

2 participants