Skip to content

refactor(runtime): compose MCP from resolved configuration - #228

Closed
Waishnav wants to merge 4 commits into
mainfrom
refactor/runtime-config-composition
Closed

refactor(runtime): compose MCP from resolved configuration#228
Waishnav wants to merge 4 commits into
mainfrom
refactor/runtime-config-composition

Conversation

@Waishnav

@Waishnav Waishnav commented Aug 23, 2026

Copy link
Copy Markdown
Owner

DevSpace currently exposes a few startup presets such as minimal, full, and codex, 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, then compileRuntime() 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

    • Added runtime configuration for minimal, full, and Codex tool modes.
    • Added configurable tool widgets, skills support, workspace guidance, and artifact-download capabilities.
    • Artifact downloads are now available on supported Linux platforms.
  • Bug Fixes

    • Invalid environment configuration values now produce clear validation errors instead of being silently accepted.
    • User and authentication configuration files receive stronger validation.
  • Documentation

    • Clarified how Codex mode is selected and configured.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2817ae24-790f-4b91-8287-a5fbf060dbb2

📥 Commits

Reviewing files that changed from the base of the PR and between fdbff75 and 1e7c7ab.

📒 Files selected for processing (16)
  • docs/configuration.md
  • src/artifact-platform.ts
  • src/artifact-tools.ts
  • src/config.test.ts
  • src/config.ts
  • src/env-config.ts
  • src/git-worktrees.ts
  • src/local-agent-config.test.ts
  • src/local-agent-config.ts
  • src/local-agent-profiles.ts
  • src/runtime-config.ts
  • src/server.test.ts
  • src/server.ts
  • src/skills.ts
  • src/user-config.ts
  • src/workspaces.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change adds strict environment and JSON configuration validation, introduces RuntimeConfig compilation for tool and capability selection, and updates MCP server creation and tests to use compiled runtime settings.

Changes

Runtime configuration and validation

Layer / File(s) Summary
Configuration validation and typed contracts
src/config.ts, src/env-config.ts, src/user-config.ts, src/git-worktrees.ts, src/local-agent-config.ts, src/local-agent-profiles.ts, src/skills.ts, src/workspaces.ts, src/config.test.ts, src/local-agent-config.test.ts, docs/configuration.md
Boolean environment values now use strict parsing. JSON configuration uses Zod validation. Exported configuration types and subsystem inputs use narrower contracts. Tests cover invalid values, unknown fields, and invalid file configuration.
Runtime capability compilation
src/runtime-config.ts, src/artifact-platform.ts, src/artifact-tools.ts
compileRuntime now selects tool surfaces, widget profiles, skills capabilities, artifact availability, and instructions. Artifact platform support is centralized and Linux-only.
MCP server runtime integration
src/server.ts, src/server.test.ts
MCP server creation and tool registration now use RuntimeConfig. Widget metadata, instructions, change tracking, artifact status, and mode-specific tool exposure come from runtime capabilities. Tests cover minimal, full, Codex, and widget modes.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 1e7c7

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
Loading

Poem

I hop through configs, both tidy and bright,
Strict booleans now keep values right.
Runtime tools gather in orderly rows,
Widgets appear where the profile says so.
A rabbit cheers: “The server now knows!”

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 15 files. (1 skipped: 1 unsupported.) Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: composing MCP startup from resolved runtime configuration.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/runtime-config-composition

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 23, 2026

Copy link
Copy Markdown

Greptile Summary

The PR centralizes startup policy by compiling validated configuration into concrete MCP runtime capabilities.

  • Adds runtime profiles for tool surfaces, widgets, skills, artifacts, and server instructions.
  • Updates MCP construction and tool registration to consume compiled capabilities.
  • Adds strict environment and persisted-configuration validation.
  • Narrows configuration dependencies in workspace, worktree, skill, profile, and artifact modules.
  • Adds coverage for tool-mode surfaces, presentation behavior, invalid booleans, and persisted configuration validation.

Confidence Score: 5/5

The 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.

Important Files Changed

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]
Loading

Reviews (1): Last reviewed commit: "refactor(artifacts): isolate platform ca..." | Re-trigger Greptile

@Waishnav Waishnav closed this Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant