fix(configure): stop misrouting Desktop users to the Code connector-verify path#118
Merged
Merged
Conversation
…erify path A Claude Desktop user who connected the Meta hosted MCP got the misleading 'not connected — redo the Meta login' message. Root cause: the in-memory session.host could reset to the claude-code default (configure restart; /api/host posted only on radio change, fire-and-forget, errors swallowed), so confirm_hosted_provider ran the Claude Code 'claude mcp list' path for a Desktop user; with no Claude Code CLI, the bare False mapped to an accusatory dead-end. - Client-authoritative host: /api/providers/confirm and /api/providers/native-toggle resolve host from the request payload (validated, self-heals the session) via _resolve_host; finalize sends state.host. - Host-sync hardening (wizard.js): persist explicit choice to localStorage and prefer it over the server-echoed status.host; syncHostToServer retries once and surfaces a toast instead of swallowing failures; assert host on host-step entry and onReady. - Tri-state hosted_provider_connectivity (connected/not_connected/ unknown): 'unknown' (no Claude Code CLI / timeout / rc!=0) is NOT 'not connected'. is_hosted_provider_connected kept as a =="connected" wrapper so existing no-strand guards are unchanged. confirm_hosted_provider gains affirm: Desktop / unknown no longer dead-end — an explicit user affirmation applies the switch (no-strand by deliberate consent). New EN/JA i18n + affirm button. The official Meta MCP itself was always usable; only the switch-native-off step was wrongly blocked (tool ambiguity, never a strand).
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.
Problem
A Claude Desktop user who had connected the Meta hosted MCP got the misleading "まだ接続されていません…(redo the Meta login)" when clicking finalize in
mureo configure.Root cause: the in-memory
session.hostcan reset to theclaude-codedefault (configure process restart;/api/hostwas posted only on radiochange, fire-and-forget, errors swallowed). Soconfirm_hosted_providerran the Claude Codeclaude mcp listverification path for a Desktop user; with no Claude Code CLI,is_hosted_provider_connectedreturned a bareFalse→ mapped tonot_connected, an accusatory dead-end. The official Meta MCP itself was always usable — only the switch-native-off step was wrongly blocked (tool ambiguity, never a strand).Fix (scope 1+2+3)
/api/providers/confirmand/api/providers/native-toggleresolvehostfrom the request payload via_resolve_host(validated against SUPPORTED_HOSTS, written back to self-heal a stale session); finalize sendsstate.host.wizard.js) — persist the explicit choice to localStorage and prefer it over the server-echoedstatus.host;syncHostToServerretries once and shows a toast instead of swallowing failures; assert host on host-step entry and ononReady.hosted_provider_connectivity → connected|not_connected|unknown.unknown(no Claude Code CLI / timeout / rc≠0) is not "not connected".is_hosted_provider_connectedkept as a== "connected"wrapper (existing no-strand guards unchanged).confirm_hosted_providergainsaffirm: Desktop /unknownno longer dead-end — an explicit user affirmation applies the switch (no-strand by deliberate consent). New EN/JA i18n + affirm button.Tests
TestHostedProviderConnectivity; rewritten/extended confirm tests (unverifiable, affirm, Desktop+affirm); handler host-resolution tests; i18n EN/JA parity for new keys.Out of scope (acknowledged, left as-is by maintainer): the separate
setup_state.jsonledger-vs-reality gap for upgraders.