Conversation
Add debugLog calls to three functions in flags_difc.go to improve troubleshooting of DIFC policy configuration: - getDefaultDIFCMode: log when MCP_GATEWAY_GUARDS_MODE env var is used (both valid and invalid values) to clarify which mode was selected - buildAllowOnlyPolicy: log entry parameters, nil policy short-circuit, resolved scope, and successful policy construction - parseDIFCSinkServerIDs: log parsing start, duplicate deduplication, and final resolved server ID list All logging reuses the existing package-level debugLog variable (cmd:root namespace) — no new imports or declarations needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds debug logging to internal/cmd/flags_difc.go to improve observability of DIFC (guards) policy configuration at startup, covering mode resolution, policy building, and sink server ID parsing.
Changes:
- Adds 9
debugLogcalls across three functions (getDefaultDIFCMode,buildAllowOnlyPolicy,parseDIFCSinkServerIDs) to trace environment variable resolution, policy construction, and input parsing - Reuses the existing package-level
debugLoglogger with no new imports or declarations
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
This was referenced Mar 13, 2026
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
debugLogcalls tointernal/cmd/flags_difc.goto improve troubleshooting of DIFC (guards) policy configuration at startup.File modified
internal/cmd/flags_difc.go— reuses the existing package-leveldebugLog = logger.New("cmd:root")declared inroot.go. No new logger declaration or imports needed.Logging added
getDefaultDIFCMode(2 calls)MCP_GATEWAY_GUARDS_MODEenv var is used and its value is validstrict) is usedbuildAllowOnlyPolicy(4 calls)public,owner,repo,minIntegrity) for full contextreposvalue and resolved integrity levelparseDIFCSinkServerIDs(3 calls)Quality checklist
debugLoglogger (no new declaration needed)pkg:filenameconvention (cmd:root)