Repository navigation
Consolidate guard setup and delegation control serving - #16556
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
The timeout failure at internal/cmd/delegation_test.go:85 should use require.Fail to follow the repository’s Testify-only assertion convention while preserving immediate abort behavior.
1 open issue
What changed in this PR
Consolidates shared setup in the MCP Gateway, making tool and prompt guard logging consistent while preserving delegation-control failure handling.
Changes:
- Share guard initialization, request-scoped evaluators, and sensitive-logging policy.
- Extract the delegation-control serve loop and test failure and shutdown behavior.
- Reuse the common container-runtime normalization helper.
| File | Description |
|---|---|
internal/server/prompt_call.go |
Uses shared guard setup for prompt calls. |
internal/server/guard_pipeline.go |
Centralizes guard setup and sensitive-logging policy. |
internal/server/guard_pipeline_test.go |
Tests pipeline configuration, redaction, and initialization errors. |
internal/server/backend_call.go |
Uses shared setup, enabling consistent sensitive logging. |
internal/config/container_runtime.go |
Reuses util.NormalizeStringCI. |
internal/cmd/proxy.go |
Uses the shared delegation-control serve loop. |
internal/cmd/delegation.go |
Extracts common listener failure handling. |
internal/cmd/delegation_test.go |
Tests listener failure and graceful shutdown. |
Review effort: Max (dynamic)
|
@copilot address review feedback and fix linting errors https://github.com/github/gh-aw-mcpg/actions/runs/43655572192/job/132687845485?pr=16556 |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Addressed the timeout assertion feedback and the |
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No write of any kind succeeded or leaked through either surface in this run. No runtime-pass label applied since the result is INCONCLUSIVE rather than a confirmed PASS.
|

Tool and prompt guard setup was duplicated, with tool calls omitting sensitive logging. Logger-wide selector redaction does not cover arbitrary resource descriptions or tags; delegation control listeners also duplicated fatal-error handling.
buildPipelineInput. Tool calls now match prompt redaction behavior.util.NormalizeStringCIfor container runtime names.