[log] Add debug logging to unified server functions#6769
Merged
Conversation
Add meaningful debug log calls to three functions in internal/server/unified.go that previously had no logging: - isToolAllowed: log when a tool is blocked by the allowlist - enforceToolCallLimit: log when counters are incremented and when limits are exceeded - GetServerStatus: log the number of servers being queried and each server's status These additions improve observability for debugging tool call limits, tool filtering, and server health checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds debug logUnified.Printf calls to three previously silent functions in the unified server to aid troubleshooting allowlist denials, per-tool call limit enforcement, and server status queries.
Changes:
- Log when
isToolAlloweddenies a tool via the per-server allowlist. - Log per-tool call counter increments and limit-reached events in
enforceToolCallLimit. - Log server count and per-server status/uptime in
GetServerStatus.
Show a summary per file
| File | Description |
|---|---|
| internal/server/unified.go | Adds debug log lines in isToolAllowed, enforceToolCallLimit, and GetServerStatus, with no behavioral changes. |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds meaningful debug log calls to three functions in
internal/server/unified.gothat previously had no logging:Changes
isToolAllowed— Logs when a tool is blocked by the server's allowlist. This helps debug cases where clients see unexpected "tool not found" errors.enforceToolCallLimit— Logs when call counters are incremented and when limits are exceeded. This provides visibility into per-session tool call budget enforcement, making it easier to troubleshoot agents hitting rate limits set by guards.GetServerStatus— Logs the number of servers being queried and each server's current status/uptime. Useful when debugging health check responses.Validation
go buildpassesgo vetpassesmake test-all)Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
index.crates.ioSee Network Configuration for more information.