refactor(runtime): compile mode profiles once - #225
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 SummaryThis PR separates resolved configuration from compiled runtime capabilities so tool, presentation, skills, artifact, and instruction profiles are derived once during server startup.
Confidence Score: 5/5The PR appears safe to merge, with no concrete changed-code failure identified. The compiled profiles preserve the prior configuration branches, all repository call sites use the new RuntimeConfig contract, and no reachable stale-configuration path exists in current callers.
|
| Filename | Overview |
|---|---|
| src/runtime-config.ts | Introduces centralized, typed compilation of tool, presentation, skills, artifact, and instruction profiles without a concrete behavioral regression. |
| src/server.ts | Consumes one compiled runtime profile across MCP sessions and consistently replaces the previous inline mode checks. |
| src/config.ts | Renames the effective configuration interface to ResolvedConfig while preserving ServerConfig as a compatibility alias. |
| src/server.test.ts | Updates direct createMcpServer construction to satisfy the new RuntimeConfig boundary. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Environment and config files] --> B[loadConfig]
B --> C[ResolvedConfig]
C --> D[compileRuntime]
D --> E[RuntimeConfig]
E --> F[createServer]
F --> G[Shared MCP server sessions]
E --> H[Tool surface]
E --> I[Presentation profile]
E --> J[Skills capability]
E --> K[Artifact capability]
E --> L[Compiled instructions]
Reviews (1): Last reviewed commit: "refactor(runtime): compile mode profiles..." | Re-trigger Greptile
|
Closing this stacked review in favor of a single PR containing the complete runtime/config composition refactor. |
The server currently rediscovers the meaning of tool, widget, skill, and artifact settings through repeated conditionals, which makes registration and model guidance easy to drift apart. This compiles resolved configuration once into typed runtime profiles and makes server composition consume those concrete capabilities instead of interpreting raw mode selectors throughout the request path.
This PR is stacked on #224 and is intended to preserve the existing public tool surfaces and instructions.