Skip to content

Fix Settings page crash when local MCP server command is a string - #3403

Open
mohitdebian wants to merge 1 commit into
different-ai:devfrom
mohitdebian:fix/3372-mcp-string-command
Open

Fix Settings page crash when local MCP server command is a string#3403
mohitdebian wants to merge 1 commit into
different-ai:devfrom
mohitdebian:fix/3372-mcp-string-command

Conversation

@mohitdebian

@mohitdebian mohitdebian commented Jul 31, 2026

Copy link
Copy Markdown

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.json configurations where an MCP server uses a string command rather than an array.

Root Cause

In settings-route.tsx, checking if the browser plugin is configured involved checking if s.config.command?.some(...) contains "chrome-devtools". Because s.config.command can legitimately be a string (e.g. "python3"), calling .some() on it throws TypeError: s.config.command?.some is not a function. Since this was unhandled during render, it completely crashed the route.

Solution Overview

Normalized s.config.command to an array inline before checking for the substring, mirroring the exact normalization logic already present in the server's backend parsing.

Testing Performed

  • Validated via pnpm --filter @openwork/app typecheck
  • Verified that providing a string command in opencode.json no 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 useMemo block.

Follow-up Improvements

  • Ensure other frontend components consuming s.config.command or s.config.args also correctly normalize or type-guard the fields since they are not strictly typed across the wire.
  • Potentially export the backend normalization function and share it with the frontend so we don't repeat the Array.isArray fallback logic.

Fixes #3372

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown
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.

@vercel
vercel Bot temporarily deployed to Preview – openwork-diagnostics July 31, 2026 23:14 Inactive
@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-landing Ready Ready Preview, v0 Jul 31, 2026 11:18pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
openwork-diagnostics Skipped Skipped Jul 31, 2026 11:18pm

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.

Settings page renders blank/white when a local MCP server uses string command (config.command?.some is not a function)

1 participant