Skip to content

fix(virtual-mcp): show the instance selector before a second sibling exists - #7187

Merged
pedrofrxncx merged 1 commit into
mainfrom
fix/connection-instance-selector-first-instance-w4
Sep 14, 2026
Merged

pedrofrxncx merged 1 commit into
mainfrom
fix/connection-instance-selector-first-instance-w4

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

Found while hunting for navigation/UI bugs in the Virtual MCP entry view (apps/web/src/views/virtual-mcp/index.tsx) and its connection-item.tsx sibling.

The bug: SiblingInstanceSelector (in connection-item.tsx) renders null whenever a connection has fewer than 2 siblings sharing the same app_name. But the + New instance option — the only UI path to actually create a second instance of a connection — lives inside that same selector. So the very first connection of an app can never spawn a second instance from the UI: the control that creates instance #2 only appears once instance #2 already exists by some other means.

Why a maintainer wants this: this is a UI dead-end for any org that wants two instances of the same connection (e.g. two Google accounts, two GitHub orgs) starting from a single connection — a common real case for per-user OAuth connections.

Fix: keep the selector mounted when there's only one sibling, as long as onNewInstance is available (it always is from the current caller in index.tsx), so + New instance stays discoverable. Falls back to the old null behavior if onNewInstance isn't passed.

Net diff: +2/-1, one conditional.

To confirm: open a Virtual MCP's Connections settings with exactly one connection for an app that supports multiple instances — the instance selector (with + New instance) now shows instead of nothing.

Verified locally: bun run fmt, bunx oxlint apps/web/src/views/virtual-mcp/connection-item.tsx (0 warnings/errors). Full tsc/test suite left to CI (an unrelated pre-existing prosemirror version-mismatch type error exists on this workspace, unrelated to this file).


Summary by cubic

Fixes the Virtual MCP connection instance selector so + New instance stays visible when a connection has only one sibling. Previously the selector rendered null for fewer than 2 siblings, hiding the only UI path to create a second instance; now it stays mounted when onNewInstance is provided, and falls back to the old hide behavior if not.

Written for commit ca96dc2. Summary will update on new commits.

Review in cubic

…exists

The + New instance option only lives inside SiblingInstanceSelector, which
was hidden whenever a connection had fewer than 2 siblings of the same app.
That meant the very first connection of an app could never spawn a second
instance from the UI — the control that creates instance #2 only appeared
after instance #2 already existed.

Keep the selector mounted with a single sibling when onNewInstance is
available, so + New instance stays reachable from the first connection.
@pedrofrxncx
pedrofrxncx merged commit 2fdefbc into main Sep 14, 2026
34 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/connection-instance-selector-first-instance-w4 branch September 14, 2026 19:14
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.

1 participant