Align proxy --policy default with shared env config helpers - #9779
Conversation
--policy default with shared env config helpers
There was a problem hiding this comment.
Pull request overview
Aligns the proxy policy environment default with shared configuration helpers, resolving issue #9776.
Changes:
- Uses
envutil.GetEnvStringandconfig.EnvGuardPolicyJSON. - Updates tests to use the canonical environment variable constant.
Show a summary per file
| File | Description |
|---|---|
internal/cmd/proxy.go |
Centralizes proxy policy default lookup. |
internal/cmd/proxy_test.go |
Aligns tests with the shared constant. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Medium
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS
References: §29830711641
|
🔒 mcpg Read-Only Stress — default AWFSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Part B note: Write tool rejections at ~30–48ms confirm gateway-level tool filtering (read round-trips ~800ms). Overall: PASS References: §29830711625
|
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS
|
The proxy subcommand was the one place in
internal/cmdstill readingMCP_GATEWAY_GUARD_POLICY_JSONvia a rawos.Getenvcall. This updates it to follow the same env-default pattern used by the rest of the CLI and ties the flag to the shared config constant.Proxy flag default
--policydefault wiring from a string literal +os.Getenv(...)toenvutil.GetEnvString(config.EnvGuardPolicyJSON, "")config.EnvGuardPolicyJSONconstant instead of duplicating the env var nameTest alignment
config.EnvGuardPolicyJSONso the coverage follows the same source of truth as production codeResult