[log] Add debug logging to delegation RuntimeConfig - #13064
Conversation
Add logConfig logger (namespace delegation:config) to internal/delegation/config.go and log meaningful events in Validate() and ControlDeps(): - each validation failure branch (nil config, missing store, missing capability, missing state path) - successful validation with statePath/controlListenAddr - ControlDeps() called on a nil config (delegation disabled) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The change is low-risk and the remaining test-coverage suggestion is a minor nit.
Pull request overview
Adds debug logging for delegation runtime configuration validation and dependency access.
Changes:
- Adds a
delegation:configlogger. - Logs validation failures, successful validation, and nil control dependencies.
File summaries
| File | Summary |
|---|---|
internal/delegation/config.go |
Adds runtime configuration diagnostics. Nit: add focused tests for the new logging branches. |
Review details
Suppressed comments (1)
internal/delegation/config.go:42
- The existing config tests cover only return values and forwarded dependencies, so none of the new
logConfigbranches or the success fields are exercised. Since this PR's behavior is the debug diagnostics themselves (and delegation already has dedicated logging tests inselector_logging_test.go,recovery_logging_test.go, andcontrol_handler_logging_test.go), add a focused capture test covering the validation failures, successful validation, and nilControlDeps()message.
logConfig.Printf("Delegation runtime config validated: statePath=%s, controlListenAddr=%s", c.StatePath, c.ControlListenAddr)
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE Notes:
|
🔒 mcpg Read-Only Stress — gvisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE No write leaked in this run. Part B write-tool targets are absent from the gateway's exposed catalog entirely (only 23 read-only tools registered —
|
Summary
Adds debug logging to
internal/delegation/config.go, which previously had no logger despite containing meaningful startup validation logic used by bothinternal/server/unified.goandinternal/proxy/proxy.go.Changes
logConfiglogger vialogger.ForFile()(namespacedelegation:config).RuntimeConfig.Validate(): logs each of the four failure branches (nil config, missing store, missing capability, missing state path) plus a success log includingstatePathandcontrolListenAddr.RuntimeConfig.ControlDeps(): logs when called on a nil config, since that path silently returns a zero value that disables delegation control.Validation
go build -o awmg ./...— succeedsgo vet ./internal/delegation/...— cleango test ./internal/delegation/...— passesgofmt -l internal/delegation/config.go— no issues