refactor(runtime): compose MCP from resolved configuration - #228
refactor(runtime): compose MCP from resolved configuration#228Waishnav wants to merge 4 commits into
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (16)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change adds strict environment and JSON configuration validation, introduces ChangesRuntime configuration and validation
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The refactor centralizes startup configuration without any supplied evidence of a current correctness, availability, security, or deployment risk; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant createServer
participant compileRuntime
participant createMcpServer
participant MCPServer
createServer->>compileRuntime: resolved configuration
compileRuntime->>compileRuntime: select runtime capabilities
compileRuntime-->>createServer: RuntimeConfig
createServer->>createMcpServer: RuntimeConfig
createMcpServer->>MCPServer: register selected tools and metadata
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThe PR centralizes startup policy by compiling validated configuration into concrete MCP runtime capabilities.
Confidence Score: 5/5The PR appears safe to merge, with no concrete changed-code failure identified. Runtime capability compilation remains aligned with tool registration and presentation behavior, strict configuration validation is intentional and covered by tests, and the narrowed configuration contracts include the properties used by their implementations.
|
| Filename | Overview |
|---|---|
| src/runtime-config.ts | Introduces the compiled runtime capability model and preserves the prior tool, widget, skills, artifact, and instruction behavior. |
| src/server.ts | Consumes compiled capabilities consistently for MCP instructions, tool registration, widget metadata, and startup reporting. |
| src/config.ts | Renames the effective model to ResolvedConfig and applies strict parsing to environment boolean settings while preserving defaults. |
| src/user-config.ts | Validates known persisted settings while retaining unknown fields for forward compatibility. |
| src/env-config.ts | Defines a shared strict parser covering common explicit true and false spellings. |
| src/server.test.ts | Adds integration coverage confirming coherent tool surfaces and presentation-specific show_changes registration. |
| src/workspaces.ts | Narrows the registry configuration contract to the properties used directly or by delegated workspace helpers. |
| src/artifact-tools.ts | Extracts platform capability detection and narrows artifact registration configuration without changing transfer behavior. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
E[Environment configuration] --> V[loadConfig validation]
P[Persisted configuration] --> V
V --> R[ResolvedConfig]
R --> C[compileRuntime]
C --> T[Tool surface]
C --> W[Presentation profile]
C --> S[Skills capability]
C --> A[Artifact capability]
T --> M[createMcpServer]
W --> M
S --> M
A --> M
M --> X[Registered tools, metadata, and instructions]
Reviews (1): Last reviewed commit: "refactor(artifacts): isolate platform ca..." | Re-trigger Greptile
DevSpace currently exposes a few startup presets such as
minimal,full, andcodex, but their meaning was being reinterpreted across server instructions, tool registration, widget behavior, skills, and artifact handling. That made configuration changes spread conditional logic through the MCP implementation and created room for the advertised model guidance to drift from the actual tool surface.This refactor makes configuration a startup boundary instead. Persisted and environment configuration is validated into
ResolvedConfig, thencompileRuntime()resolves it into concrete tool, presentation, skills, and artifact capabilities. MCP construction consumes those resolved capabilities rather than repeatedly interpreting raw mode flags, while preserving the existing external presets and behavior. It also narrows configuration dependencies in supporting modules so runtime policy stays concentrated at the composition boundary.The change intentionally keeps genuine runtime/domain branches such as workspace/worktree lifecycle decisions; the goal is to centralize startup configuration interpretation, not eliminate normal control flow.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation