Fix MCP servers console crash when servers is not an array#585
Fix MCP servers console crash when servers is not an array#585
Conversation
Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>
🤖 LLM Evaluation ResultsOpenAI
❌ Failed EvaluationsShow 1 failuresOPENAI1. TestReactEval/[openai]_react_cat_message
Anthropic
❌ Failed EvaluationsShow 2 failuresANTHROPIC1. TestReactEval/[anthropic]_react_cat_message
2. TestChannelSummarization/[anthropic]_channel_summarization_developers_webapp_channel
This comment was automatically generated by the eval CI pipeline. |
There was a problem hiding this comment.
Security Review: No issues found
This PR is a minimal, frontend-only defensive fix in the system console admin panel. It hoists an existing Array.isArray(mcpConfig?.servers) guard into a shared normalizedServers variable to prevent a crash when the config data has an unexpected shape (e.g., object/map instead of array).
No new endpoints, data flows, permission changes, or server-side logic are introduced. The validation logic is identical to the prior code — just deduplicated. No security concerns.
Sent by Cursor Automation: Find vulnerabilities
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change introduces a normalized servers array to centralize handling of potentially non-array Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |


Summary
Fixes a System Console MCP panel crash caused by calling
.map()on a non-arraymcp.serversvalue.mcpConfig.serversonce withArray.isArray(...) ? ... : []TypeError: ...map is not a functionwhen malformed/legacy config data is presentTicket Link
NONE
Screenshots
Manual UI screenshots/video were not produced in this environment because the local containerized System Console test stack could not be brought to a fully runnable state for browser validation.
Release Note
Summary by CodeRabbit