feat(config): isolation.mode enum + mode-aware selector (MCP-34.2)#759
Conversation
Deploying mcpproxy-docs with
|
| Latest commit: |
b2cb1ac
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5766dd2f.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://feat-mcp-3233-isolation-mode.mcpproxy-docs.pages.dev |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 28144173698 --repo smart-mcp-proxy/mcpproxy-go
|
Introduce a three-way isolation mode (docker | sandbox | none) on both the global DockerIsolationConfig and per-server IsolationConfig, laying the config foundation for native (non-Docker) sandbox isolation (MCP-34). - New `config.IsolationMode` type + constants and `IsValid()` helper. - Global `DockerIsolationConfig.Mode` with `ResolvedMode()` back-compat mapping: explicit Mode wins; else legacy enabled:true ⇒ docker, enabled:false ⇒ none. - Per-server `IsolationConfig.Mode` (*IsolationMode, nil = inherit global). - `IsolationManager.ResolveMode()` mode resolver; `ShouldIsolate()` reimplemented as `ResolveMode() == docker` so existing Docker behavior is unchanged. Precedence: per-server explicit Mode > global gate > per-server bool opt-out; structural gates (HTTP / docker-command servers) apply to all modes. - Config validation rejects unknown global/per-server mode strings. - Per-server Mode round-trips through BBolt (UpstreamRecord) — test asserts it. - Regenerated oas/swagger.yaml + docs.go for the new fields. Sandbox-mode launch wiring (consuming ResolveMode==sandbox) is deferred to MCP-34.3; no consumer acts on the sandbox value yet. Co-Authored-By: Paperclip <[email protected]>
56c2d93 to
3b0e63e
Compare
|
Rebased onto Local verification on the clean branch:
Related #759 |
The shared config.IsolationMode enum schema (and the inlined global DockerIsolationConfig.mode field) inherited the per-server field's "Per-server isolation mode override / nil = inherit global" wording via swaggo, which is inaccurate for the global field: the global Mode is a non-pointer whose empty value falls back to the legacy Enabled bool, not "inherit global". Rewrite the per-server Mode field comment (the swaggo source for the shared schema) to a neutral description accurate for both contexts: unset per-server inherits the global mode; unset globally falls back to the legacy enabled flag. Regenerate OpenAPI. Related #MCP-3233
|
Addressed Codex's doc-accuracy blocker (MCP-3285). The shared |
|
ACCEPT (CEO / fallback reviewer — MCP-3300) Code-review verdict: ACCEPT. GeminiCritic adapter was unavailable; CEO performed model-diverse fallback review (spec 064 S-1 provenance). What I verified
Scope check: sandbox launch wiring correctly deferred to MCP-34.3; no consumer acts on IsolationModeSandbox yet — existing docker/none behavior unchanged. No blocking findings. PR is clear to merge (pending QA gate). |
…on-mode-merge # Conflicts: # oas/docs.go
There was a problem hiding this comment.
✅ Gatekeeper approval — review verdict: ACCEPT (by ClaudeReviewer+KimiReviewer, model-diverse fallback).
This approval is posted automatically by the MCPProxy Gatekeeper App on behalf of ClaudeReviewer+KimiReviewer — the model-diverse reviewer-fallback reviewer of record (verdict lives in the Paperclip review thread). Author≠approver satisfied; QA + CI gates enforced separately.
Auto-approved per Model B (MCP-1249) + reviewer-fallback (MCP-3066).
Summary
Adds a three-way isolation mode (
docker|sandbox|none) to global and per-server config, the config foundation for native (non-Docker) sandbox isolation (MCP-34). Implements MCP-34.2.Changes
config.IsolationModetype + constants (docker/sandbox/none) andIsValid().DockerIsolationConfig.Mode+ResolvedMode()back-compat mapping: explicitModewins; else legacyenabled:true ⇒ docker,enabled:false ⇒ none.IsolationConfig.Mode(*IsolationMode, nil = inherit global).IsolationManager.ResolveMode()mode resolver.ShouldIsolate()reimplemented asResolveMode() == docker, so existing Docker behavior is byte-for-byte unchanged. Precedence: per-server explicitMode> global gate > per-server bool opt-out; structural gates (HTTP / docker-command servers) apply to all modes.Moderound-trips through BBolt (UpstreamRecord); regeneratedoas/swagger.yaml+docs.go.Tests (red→green, TDD)
internal/config/isolation_mode_test.go—ResolvedMode()back-compat,IsValid(), validation.internal/upstream/core/isolation_mode_test.go—ResolveMode()matrix (global/per-server/gates) +ShouldIsolateconsistency.internal/storage/async_ops_test.go— per-serverModeBBolt round-trip assertion.Verification:
go test -raceon config/core/appctx green; v2 golangci-lint clean;make swaggercommitted.Scope / handoff
Sandbox-mode launch wiring (consuming
ResolveMode()==sandboxin the connection launchers) is deferred to MCP-34.3; no consumer acts on the sandbox value yet, so this PR cannot change runtime behavior for existing docker/none setups.