Fix Settings page crash when local MCP server command is a string - #3403
Open
mohitdebian wants to merge 1 commit into
Open
Fix Settings page crash when local MCP server command is a string#3403mohitdebian wants to merge 1 commit into
mohitdebian wants to merge 1 commit into
Conversation
Contributor
|
@mohitdebian is attempting to deploy a commit to the Different AI Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
mohitdebian
force-pushed
the
fix/3372-mcp-string-command
branch
from
July 31, 2026 23:17
d29f6f7 to
6d2fe4d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: Fix Settings page crash with string MCP command
Title
Fix Settings page crash when local MCP server command is a string
Description
This PR resolves a complete UI crash on the Settings page caused by valid
opencode.jsonconfigurations where an MCP server uses a stringcommandrather than an array.Root Cause
In
settings-route.tsx, checking if the browser plugin is configured involved checking ifs.config.command?.some(...)contains"chrome-devtools". Becauses.config.commandcan legitimately be a string (e.g."python3"), calling.some()on it throwsTypeError: s.config.command?.some is not a function. Since this was unhandled during render, it completely crashed the route.Solution Overview
Normalized
s.config.commandto an array inline before checking for the substring, mirroring the exact normalization logic already present in the server's backend parsing.Testing Performed
pnpm --filter @openwork/app typecheckopencode.jsonno longer crashes the Settings page.Screenshots
N/A - This resolves a crash (white screen). The UI appearance is unchanged when working correctly.
Risks
None. This is a purely defensive type coercion guard in a
useMemoblock.Follow-up Improvements
s.config.commandors.config.argsalso correctly normalize or type-guard the fields since they are not strictly typed across the wire.Array.isArrayfallback logic.Fixes #3372