Skip to content

[log] Add debug logging to unified server key functions#5031

Merged
lpcox merged 1 commit intomainfrom
log/unified-server-logging-11e9ab5cd63a3fbf
May 3, 2026
Merged

[log] Add debug logging to unified server key functions#5031
lpcox merged 1 commit intomainfrom
log/unified-server-logging-11e9ab5cd63a3fbf

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 3, 2026

Adds meaningful debug logging to three functions in internal/server/unified.go that previously had no logging:

Changes

  • executeBackendToolCall: Logs entry with serverID and toolName for tracing tool dispatch, and logs when the backend returns an error (with error code) to help correlate backend failures.
  • getCircuitBreaker: Logs when a new circuit breaker is created on-demand (i.e., outside of the normal NewUnified path), including the configured threshold and cooldown values.
  • GetToolHandler: Logs when no handler is found for the requested backendID/toolName combination, which helps diagnose tool routing issues in routed mode.

Testing

  • go build passes
  • go test ./... passes (pre-existing unrelated failure in TestFetchAndFixSchema_NetworkError in internal/config)
  • Only internal/server/unified.go was modified

Warning

⚠️ Firewall blocked 1 domain

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

  • invalidhostthatdoesnotexist12345.com

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

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

See Network Configuration for more information.

Generated by Go Logger Enhancement · ● 7.4M ·

Add meaningful debug logging to three functions in internal/server/unified.go
that previously had no logging:

- executeBackendToolCall: log entry with serverID/toolName and backend errors
- getCircuitBreaker: log when creating a new circuit breaker on-demand
- GetToolHandler: log when no handler is found for a requested tool

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automation enhancement New feature or request labels May 3, 2026
@lpcox lpcox marked this pull request as ready for review May 3, 2026 13:52
Copilot AI review requested due to automatic review settings May 3, 2026 13:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds additional debug-level observability in the unified MCP server to make backend tool dispatch, circuit-breaker initialization, and routed tool lookups easier to trace during troubleshooting.

Changes:

  • Log entry + backend error code in executeBackendToolCall to correlate tool dispatch with backend failures.
  • Log when getCircuitBreaker creates a breaker on-demand (outside the normal NewUnified initialization path).
  • Log when GetToolHandler can’t find a handler for a requested backendID/toolName pair.
Show a summary per file
File Description
internal/server/unified.go Adds debug logging to key unified-server functions for improved tracing and diagnosis.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@lpcox lpcox merged commit 41ed4be into main May 3, 2026
26 checks passed
@lpcox lpcox deleted the log/unified-server-logging-11e9ab5cd63a3fbf branch May 3, 2026 22:54
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