-
Notifications
You must be signed in to change notification settings - Fork 39
fix(cli): crash with elide init w.r.t. mcp config
#1534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Sam Gammon <sam@elide.dev>
elide init w.r.t. mcp configelide init w.r.t. mcp config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a crash when running elide init by resolving a naming clash in the MCP configuration and hardening request handling.
- Added a null check for
sessionIdquery parameter in the MCP server endpoint - Disabled JSON class discriminators to avoid collisions with a reserved
typefield - Improved text normalization logic in
AgentAdviceto collapse excess newlines via regex
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/tooling/src/main/kotlin/elide/tooling/project/mcp/ModelContextProtocol.kt | Add null check for missing sessionId query parameter to prevent NPE |
| packages/tooling/src/main/kotlin/elide/tooling/project/mcp/McpProjectConfig.kt | Opt in to ExperimentalSerializationApi and set classDiscriminatorMode = NONE |
| packages/tooling/src/main/kotlin/elide/tooling/project/agents/AgentAdvice.kt | Replace manual newline replace with a Regex("\n{2,}") call for better trimming logic |
Comments suppressed due to low confidence (1)
packages/tooling/src/main/kotlin/elide/tooling/project/mcp/McpProjectConfig.kt:47
- [nitpick] Add a brief comment explaining why
ClassDiscriminatorMode.NONEis used here to clarify the intent and avoid confusion for future maintainers.
classDiscriminatorMode = ClassDiscriminatorMode.NONE
packages/tooling/src/main/kotlin/elide/tooling/project/mcp/ModelContextProtocol.kt
Show resolved
Hide resolved
packages/tooling/src/main/kotlin/elide/tooling/project/agents/AgentAdvice.kt
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1534 +/- ##
==========================================
- Coverage 40.45% 40.43% -0.02%
==========================================
Files 749 749
Lines 35325 35329 +4
Branches 4967 4968 +1
==========================================
- Hits 14290 14287 -3
- Misses 19332 19340 +8
+ Partials 1703 1702 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Summary
MCP configuration introduced a bug because of a clash with the
typeparameter to server blocks.