Skip to content

fix(mcp): stop host MCP servers failing as "endpoint not found" and make Reconnect show its result - #51268

Merged
AmoabaKelvin merged 4 commits into
mainfrom
mcp-relay-missing-tool
Nov 28, 2026
Merged

AmoabaKelvin merged 4 commits into
mainfrom
mcp-relay-missing-tool

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

Orca keeps each MCP server's sign-in or key locked with this computer's keychain. If that lock can't be opened (a reset keychain, a copied home folder), Orca treated the server as if it didn't exist, so chats showed "MCP endpoint not found" and Settings offered no fix. Now Orca says what's wrong and lets you sign in again. The chat's /mcp tray also reports what Reconnect did and marks servers you removed or changed since the chat started.

Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​138 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​133
Prod 53 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​687 $\color{#cf222e}{\Huge{\mathbf{−}}}$​190 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​497

What Changed

  • Relay (host-list servers): a saved entry that won't open on this computer now gets its own answer, unreadable, separate from missing. Each request gets a JSON-RPC error saying to sign in again or re-enter the key in Orca's MCP servers settings. Before, it got a 404 "This bot has no such tool.", which agents showed as "MCP endpoint not found". The 404 for a server that's really gone no longer says "bot" for non-bot sessions. Bots keep the old 404 for both cases.
  • Settings (desktop and phone): such a server reads "Sign in again". Its page says "Saved sign-in or key can’t be opened on this computer" (phone: "Saved sign-in or key can’t be opened. Sign in again."), and its details stay editable so a key server can take its key again. Sign in first checks that the address uses OAuth, then replaces the unreadable entry with a signed-out sign-in and runs the normal flow. Key servers are never converted. Sign out on such an entry, which older phones still offer, returns the row instead of an error.
  • /mcp tray, running chats:
    • An Orca server that failed only because Orca's sign-in is missing shows "Needs sign-in" instead of "Failed: …".
    • A server Orca removed or changed since the chat launched shows "Removed: restarts on next message" or "Changed: restarts on next message". It gets a muted dot, has no Reconnect or switch, and isn't counted as needing sign-in.
    • Reconnect on a removed server returns "Orca removed this server. Your next message restarts the chat without it." Older clients get this too.
    • A Reconnect that leaves a server failed shows "Still failing after reconnecting." Before, nothing visibly happened.
  • The removed/changed comparison runs once per host-list write per running chat, then is reused by every tray poll.

Why

Kelvin's linear and sentry servers failed in chat with "MCP endpoint not found". Their saved entries had been sealed by a hidden test launch that used Chromium's mock keychain against his real dev profile. I decrypted them with the mock key: both are signed-out sign-ins for the right folder and URL. Under the real keychain they don't open, so the credential source answered missing. A really signed-out sign-in on a working keychain already answered sign-in-needed on main; I confirmed that live and pinned it in a test.

The code gap was that "stored but won't open here" looked the same as "no entry". Real users hit it after a keychain reset, a Linux password-store switch, or a copied home folder. Making them remove and re-add the server would lose its agent and workspace choices, so Sign in repairs the entry in place.

The tray items come from the same report. Reconnect failed again in under 200 ms, which is before the spinner appears, and the error matched the status line, so the row stayed exactly the same. A removed server stays in a running chat until its next message by design (#48785); the tray now says so.

Linked Issue

N/A, reported by Kelvin on the MCP servers turn-on build (no issue).

Visual Proof

Real UI from a hidden dev build with ORCA_MCP_SERVERS=1 (desktop) and the phone page harness (phone), next to the closest approved mock.

Desktop /mcp tray. Before (the old "Failed" row for a signed-out Orca server), then after: linear removed since launch, broken (a project server) still failing after Reconnect.

Before After (light) After (dark) Mock
(screenshot removed: contained real product data) (screenshot removed: contained real product data) (screenshot removed: contained real product data) (screenshot removed: contained real product data)

Desktop Settings, a server whose entry won't open here

List (light) List (dark) Mock
(screenshot removed: contained real product data) (screenshot removed: contained real product data) (screenshot removed: contained real product data)
Page (light) Page (dark) Mock
(screenshot removed: contained real product data) (screenshot removed: contained real product data) (screenshot removed: contained real product data)

Phone

Tray (light) Tray (dark) Mock
(screenshot removed: contained real product data) (screenshot removed: contained real product data) (screenshot removed: contained real product data)
List (light) List (dark) Mock
(screenshot removed: contained real product data) (screenshot removed: contained real product data) (screenshot removed: contained real product data)
Server (light) Server (dark) Mock
(screenshot removed: contained real product data) (screenshot removed: contained real product data) (screenshot removed: contained real product data)

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

Live on macOS, in a hidden dev build of this branch with ORCA_MCP_SERVERS=1, a temp profile, and a real Claude chat in a scratch repo:

  • Linear added, not signed in. Claude's MCP log shows the relay answering -32001 Sign in to this app in Orca to use it. and the tray reads "Needs sign-in".
  • The entry re-sealed under a different key. The relay answers the unreadable message, Settings shows "Sign in again", and mcpServers.signIn.start replaced the entry (the row went from lost/unreadable to signed-out).
  • Linear removed mid-chat. The row reads "Removed: restarts on next message", and Reconnect returns the explanation.
  • A project server at 127.0.0.1:9 under Reconnect shows "Still failing after reconnecting."

Phone screens come from the phone page harness with the real components.

Tests:

  • bot-tool-credential-source.test.ts (new) pins the credential-source decision: signed-out → sign-in-needed; an entry sealed under another keychain → unreadable, never missing; an id the tools file doesn't name → missing; a replacement only goes over an entry that doesn't open. It fails with the unreadable branch reverted.
  • session-mcp-launch.performance.test.ts gets a perf contract: one comparison across 20 tray polls after a write. Without the cache it's 20.
  • bot-tool-credentials.test.ts: the tampered-entry case now expects unreadable. It's still never sent upstream.

Performance

None that grows at scale. The tray's status read now also checks whether Orca changed the host list since the chat launched. Between writes that check is a counter comparison with no I/O. After a write it compares once per running chat per write, reusing the shared cached list read; every later poll reuses that result, which the perf contract pins. The relay and Settings read the same credential entries as before (one store read, one decrypt per call). Sign in on an unreadable entry does one extra OAuth discovery, once per button press.

Risk

Level: Low

All of this sits behind isMcpServersFeatureEnabled(). With the switch off, Orca behaves like main:

  • Host-list servers aren't delivered, so the relay's host scope and the tray's Orca rows never occur.
  • Bot-scope relay answers keep the old 404.
  • orcaChange is only computed when the switch is on.
  • The "Still failing" note is gated on the host's mcp-servers.v1 capability on both desktop and phone.

The riskiest part is Sign in replacing an unreadable entry. It runs inside the folder's credential transaction and re-reads the file, writes only when the id is still stored and still doesn't open, and runs only after discovery confirms the address does OAuth. Older phones and hosts ignore the new optional fields. A plain revert backs it out.

AI Disclosure

Review

Two review rounds (Codex, a Claude reviewer, Codex perf). Rejected:

  • Sign in discovering twice on an unreadable entry: one extra probe per user press on a rare state, and the first discovery is what keeps key servers from being converted.
  • An Orca "needs-auth" row offering Reconnect: after signing in from Settings, the row reads "Changed: restarts on next message" and the next message restarts the chat with the sign-in, as fix(mcp): restart a running chat when the host MCP servers it got change #48785 designs.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

  • Where Kelvin's two bad entries came from: linear and sentry in his dev profile (orca-dev-wt/a29786b1dc) were sealed with Chromium's mock keychain. A hidden test launch with --password-store=basic --use-mock-keychain ran against his real profile, likely while adding the mock servers for screenshots. cloudflare and context7 were sealed with the real keychain and work. With this PR he can press Sign in on linear and sentry to repair them.
  • For fleet workers: hidden test launches must use their own --user-data-dir / ORCA_DEV_USER_DATA_PATH, never a teammate's dev profile. The mock keychain writes entries the real one can't open.
  • context7's failure was a running chat holding a removed server's old credential id. The tray now marks such rows as removed.
  • One copy for sign-in and key servers: which kind an unreadable entry was is sealed inside it, and the tools file keeps only its id, so the line can't say "key" or "sign-in" alone. The page keeps both Sign in and the editable Connection group.
  • Security: an unreadable entry is never sent upstream. Sign in rebuilds it from the tools file's own URL, not from anything inside the entry.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

The changes distinguish unreadable saved credentials from missing credentials and add a path to replace unreadable OAuth entries during sign-in. Desktop and mobile settings identify unreadable sign-in data and provide sign-in-again guidance. Running sessions now report when delivered host MCP servers have been removed or changed. Session panels use those status markers, block reconnects to removed servers, and display feedback when a server remains failed after reconnecting. Locales add corresponding messages.

Merge Risk: Low · up to ffcc4

Several minor tray and settings inconsistencies remain: removed or changed MCP rows can still show actions that should be hidden, reconnect-failure messages can persist or reappear, and unreadable key-only servers on mobile are offered a sign-in that cannot succeed. These can confuse users but do not block core flows, so they are worth fixing before or shortly after merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the two main changes: host MCP servers no longer fail as "endpoint not found" (the unreadable-credential handling in the relay and Settings) and Reconnect now reports its result in the…
Description check Passed The description follows the template closely. It has ELI5, What Changed, Why, Visual Proof with before/after images, Testing with checked items and specific test files, a Performance line, a Risk sect…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the two main changes: host MCP servers no longer fail as "endpoint not found" (the unreadable-credential handling in the relay and Settings) and Reconnect now reports its result in the tray. The changeset covers both. The title uses the conventional commit format and is specific, though it is long at 98 characters.

Full details: Description check

Explanation

The description follows the template closely. It has ELI5, What Changed, Why, Visual Proof with before/after images, Testing with checked items and specific test files, a Performance line, a Risk section with level and backout plan, a Review section, and Notes and Checklist. The Linked Issue section says N/A and gives a reason, but the template says there should always be an issue for outside contributors. The AI Disclosure section is empty. The Performance section is substantive but does not begin with the required one-line form. The Risk section gives a level and a revert path.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8c0b07da-6cae-49fa-84ff-115978888eae
Commits

Reviewing files that changed from the base of the PR and between bb0d9a5 and b54dd0a.

Files selected for processing: 56

  • config/main-blocking-helper-baseline.txt
  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
  • mobile/src/mcp-servers/MobileMcpServerList.tsx
  • mobile/src/mcp-servers/MobileMcpServerPage.tsx
  • mobile/src/session/native-chat/mcp/MobileNativeChatMcpPanel.tsx
  • mobile/src/session/native-chat/mcp/MobileNativeChatMcpTray.tsx
  • mobile/src/session/native-chat/mcp/mobile-native-chat-mcp-server-copy.ts
  • src/main/bots/bot-structured-session-wiring.ts
  • src/main/bots/bot-tool-credentials.test.ts
  • src/main/bots/bot-tool-credentials.ts
  • src/main/bots/bot-tool-saved-headers.ts
  • src/main/bots/bot-tools-file.ts
  • src/main/bots/bot-tools-host.ts
  • src/main/bots/tool-oauth/bot-tool-credential-source.test.ts
  • src/main/bots/tool-oauth/bot-tool-credential-source.ts
  • src/main/bots/tool-relay/bot-tool-relay-sign-in-answer.ts
  • src/main/bots/tool-relay/bot-tool-relay.ts
  • src/main/mcp-servers/mcp-host-list-sign-in.ts
  • src/main/mcp-servers/mcp-host-list.ts
  • src/main/mcp-servers/session-host-mcp-delivery.ts
  • src/main/mcp-servers/session-mcp-launch.performance.test.ts
  • src/main/mcp-servers/session-mcp-launch.ts
  • src/main/native-chat/agent-session-wire/host/structured-agent-session-host-types.ts
  • src/main/runtime/rpc/methods/mcp-servers-sign-in.ts
  • src/main/runtime/rpc/methods/structured-sessions/catalog/structured-agent-session-mcp.ts
  • src/renderer/src/components/native-chat/mcp/NativeChatMcpServerRow.tsx
  • src/renderer/src/components/native-chat/mcp/NativeChatMcpTray.tsx
  • src/renderer/src/components/native-chat/mcp/native-chat-mcp-server-text.ts
  • src/renderer/src/components/settings/mcp-servers/McpServerPage.tsx
  • src/renderer/src/components/settings/mcp-servers/mcp-server-words.ts
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/agent-session/options/protocol/agent-session-mcp.ts
  • src/shared/agent-session/view/agent-session-mcp-server-presentation.ts
  • src/shared/agent-session/view/use-agent-session-mcp-panel.ts
  • src/shared/bot-tool-sign-in.ts
  • src/shared/plugins/languages/protected-copy-keys.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

Comment on lines +124 to +125
'mcpServers.unreadable',
'Its saved sign-in or key doesn’t open on the computer. Sign in again.'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Unreadable key-only servers get a "Sign in again" action that cannot succeed.

When a saved entry does not open, the account row says "Sign in again," and the footer shows Sign in. For a key-only server, the sign-in start path calls mcpServerSignInKey with starting set. Discovery then runs on the address. If it does not return OAuth, the host throws BotToolSignInError('unsupported'). The footer action therefore fails for any server whose discovery finds no OAuth.

This page also gives no way to re-enter the key or edit headers. While signIn is set, the connection details are not rendered. The "Sign in again" wording does not fit a key-only server, and "re-enter the key" would not fit mobile either, because this page has no key editor.

The OAuth check happens during discovery on the host, not on this page. Choose the unreadable-state message and footer action from that host result. A key-only unreadable server needs a recovery path that works on mobile. The message and footer action must not promise a sign-in that the host rejects. Keep Sign in for servers whose discovery returns OAuth.

signIn,
failure: operation.action === 'status' ? current.failure : null
failure:
operation.action === 'status' ? current.failure : stillFailing(operation, reply)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Clear reconnect feedback when a status reply reports recovery.

After a failed reconnect, this branch preserves stillFailing feedback even when a status reply reports the server as connected. The row hides the feedback but does not remove it. If another server keeps polling active and this server later fails again, both clients show “Still failing after reconnecting” for the new failure.

Clear the target's stillFailing feedback when a status reply reports it as connected. Preserve the feedback while the target remains failed.

Based on learnings, “check whether the retry action or its lifecycle clears prior error state.”

Source: Learnings

…ake Reconnect show its result

A saved sign-in or key that doesn't open on this computer (sealed under another keychain) read as
no entry at all: the relay answered 404 "This bot has no such tool", which agents show as "MCP
endpoint not found", and the Settings row offered nothing to fix it. The credential source now
answers `unreadable` for it; a host-list server gets a per-request JSON-RPC error that says how to
fix it, its Settings row (desktop and phone) reads "Sign in again", and Sign in replaces the entry
once discovery confirms the address signs in. Bots keep the 404.

In a running chat's /mcp tray, an Orca server that failed only for want of Orca's sign-in reads
"Needs sign-in", a server Orca removed or changed since the chat launched says it restarts on the
next message (Reconnect on a removed one says why instead of failing again), and a Reconnect that
leaves a server failed says "Still failing after reconnecting." on hosts with MCP servers on.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 34e6396f-2d4a-46ca-adfe-5c59a057cfa5
Commits

Reviewing files that changed from the base of the PR and between b54dd0a and 107f52c.

Files selected for processing: 26

  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
  • mobile/src/mcp-servers/MobileMcpServerPage.tsx
  • mobile/src/session/native-chat/mcp/MobileNativeChatMcpPanel.tsx
  • src/renderer/src/components/native-chat/mcp/NativeChatMcpServerRow.tsx
  • src/renderer/src/components/settings/mcp-servers/McpServerPage.tsx
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json
Files skipped from review as they are similar to previous changes: 24

  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
  • mobile/src/mcp-servers/MobileMcpServerPage.tsx
  • src/renderer/src/components/settings/mcp-servers/McpServerPage.tsx
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

Comment on lines +289 to +290
: refusal.kind === 'stillFailing'
? t('chat.mcp.stillFailing', 'Still failing after reconnecting.')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Clear reconnect feedback when a server is removed.

If a failed reconnect is followed by removal, status polling retains failure.stillFailing. agentSessionMcpRowFailure checks raw server.status, so a removed row that remains raw failed still displays “Still failing after reconnecting.” The row also displays “Removed: restarts on next message.”

Suppress reconnect feedback for orcaChange === 'removed' in the shared failure selector. This also fixes the desktop row. Keep the feedback for servers that remain present and failed.

</span>
{actions}
{server.canToggle && !signIn ? (
{server.canToggle && !signIn && server.orcaChange !== 'removed' ? (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Disable Reconnect and the switch for changed Orca rows.

The row gates hide these controls only for removed rows. agentSessionMcpShownStatus maps only removed to 'not-started', so a changed row whose raw status is failed still shows Reconnect when canReconnect is true. The same row still shows the switch when canToggle is true. The PR intent is to disable both controls for rows removed or changed since launch. The producer does not clear these capabilities, so the row gates must enforce the rule.

Gate both controls on the row being unchanged:

Suggested fix

-  ) : server.canReconnect && agentSessionMcpShownStatus(server) === 'failed' ? (
+  ) : server.canReconnect && server.orcaChange === undefined && agentSessionMcpShownStatus(server) === 'failed' ? (
...
-        {server.canToggle && !signIn && server.orcaChange !== 'removed' ? (
+        {server.canToggle && !signIn && server.orcaChange === undefined ? (
Committable suggestion

IMPORTANT
Review the replacement and indentation, then test before committing.

Suggested change
{server.canToggle && !signIn && server.orcaChange !== 'removed' ? (
{server.canToggle && !signIn && server.orcaChange === undefined ? (

@AmoabaKelvin
AmoabaKelvin force-pushed the mcp-relay-missing-tool branch from 107f52c to 9bcd5d4 Compare November 28, 2026 00:59

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e99d1279-2375-4b32-a85a-645d3dcb1845
Commits

Reviewing files that changed from the base of the PR and between 107f52c and 9bcd5d4.

Files selected for processing: 34

  • config/main-blocking-helper-baseline.txt
  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
  • mobile/src/session/native-chat/mcp/MobileNativeChatMcpPanel.tsx
  • mobile/src/session/native-chat/mcp/MobileNativeChatMcpTray.tsx
  • mobile/src/session/native-chat/mcp/mobile-native-chat-mcp-server-copy.ts
  • src/main/bots/bot-tool-details.ts
  • src/main/bots/bot-tools-host.ts
  • src/main/mcp-servers/mcp-host-list.ts
  • src/renderer/src/components/native-chat/mcp/NativeChatMcpServerRow.tsx
  • src/renderer/src/components/native-chat/mcp/NativeChatMcpTray.tsx
  • src/renderer/src/components/native-chat/mcp/native-chat-mcp-server-text.ts
  • src/renderer/src/components/settings/mcp-servers/mcp-server-words.ts
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/agent-session/options/protocol/agent-session-mcp.ts
Files skipped from review as they are similar to previous changes: 23

  • config/main-blocking-helper-baseline.txt
  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

signingIn === null && (server.canSignIn || withOrca) && server.status === 'needs-auth'
? ({ action: 'signIn', server: server.name } as const)
: server.canReconnect && server.status === 'failed'
: server.canReconnect && agentSessionMcpShownStatus(server) === 'failed'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Hide Reconnect and the switch for changed mobile rows.

If orcaChange === 'changed', agentSessionMcpShownStatus returns the raw status. A changed row with status === 'failed' and both capabilities enabled therefore shows Reconnect and the switch.

Require server.orcaChange === undefined for both controls. This hides controls for changed and removed rows and preserves controls for unchanged rows.

Based on the PR objectives, removed or changed servers must have neither control.

Also applies to: 277-277

// Its headers come from a source Orca fills per call; a generic edit would drop them.
throw new BotFailureError('toolSourceManaged')
}
return saved ? { ...rest, url: saved.url, headers: saved.headers } : rest

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Heavy lift

Keep the saved sign-in link when an edit supplies no replacement values for an unreadable entry.

For a header server whose saved credential cannot be opened, withSavedBotToolHeaders returns the server without its credential (src/main/bots/bot-tool-details.ts:127-132). resolveBotToolInput keeps a credential reference only when the edit has no header rows (src/main/bots/bot-tool-details.ts:100-102). The editor sends no header rows for an unreadable entry, because botToolCredentialHeaderNames returns an empty list (src/main/bots/bot-tool-credentials.ts:242-244).

A name-only edit of such a server therefore saves a server with no credential and no headers. The Sign in again state depends only on the stored credential reference (src/main/bots/bot-tools-file.ts:282-288). After this edit, the state no longer appears, and the server reads as an unauthenticated URL. The unreadable entry stays in the store, but no server references it.

Require that an edit with no replacement header values keep the credential reference for an unreadable entry, so the list still reports Sign in again. Keep the current behavior for entries that are absent from the store. A new header value or a changed address must still follow the existing replacement rules. Detect the unreadable case through the existing unreadable reader, because both reader results are null for unreadable and missing entries.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Use the shown status for the Sign in gate. · NativeChatMcpServerRow.tsx:120

src/renderer/src/components/native-chat/mcp/NativeChatMcpServerRow.tsx:120
Minor · Functional Correctness · Quick win

Use the shown status for the Sign in gate.

The Sign in condition reads the raw server.status. The Reconnect condition below it reads agentSessionMcpShownStatus(server), which reports removed Orca servers as not-started. A server that Orca removed can therefore keep canSignIn or signInWithOrca and still show Sign in beside "Removed: restarts on next message". That row offers an action its shown status excludes. The change applies to the whole condition, so both canSignIn and signInWithOrca are covered. Rows that are not removed keep their current behavior.

Suggested fix

-  ) : (server.canSignIn || signInWithOrca) && server.status === 'needs-auth' ? (
+  ) : (server.canSignIn || signInWithOrca) && agentSessionMcpShownStatus(server) === 'needs-auth' ? (
Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4265d208-a7e0-4b7c-9ff2-abca004e1467
Commits

Reviewing files that changed from the base of the PR and between 9bcd5d4 and ffcc4e5.

Files selected for processing: 2

  • src/renderer/src/components/native-chat/mcp/NativeChatMcpServerRow.tsx
  • src/shared/agent-session/view/agent-session-mcp-server-presentation.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

<div className="flex h-8 min-w-0 items-center gap-2 pr-2 pl-3">
<span aria-hidden="true" className="flex size-3 shrink-0 items-center justify-center">
{signIn || server.status === 'pending' ? (
{signIn || agentSessionMcpShownStatus(server) === 'pending' ? (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Hide the active sign-in state on a removed server row.

A server removed from the Orca host list can keep signIn set in the panel state. The agent keeps running the server until the next message. Its reply still lists the server with a non-connected status, so apply keeps signIn. The tray passes that signIn to the row without checking orcaChange. The row then gives signIn precedence over the removed status. It shows a spinner, the waiting text, and the Open again, Cancel, or Done actions. Done also reconnects a server that Orca removed from its host list.

A callback sign-in clears after the five-minute window. An external sign-in has no timer, so it lasts until the user cancels it or the agent stops reporting the server.

Pass signIn only to servers that are not removed:

Suggested fix

-                  signIn={state.signIn?.server === server.name ? state.signIn : null}
+                  signIn={
+                    state.signIn?.server === server.name && server.orcaChange !== 'removed'
+                      ? state.signIn
+                      : null
+                  }

@AmoabaKelvin
AmoabaKelvin merged commit 07145fb into main Nov 28, 2026
103 of 105 checks passed
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