Skip to content

fix(configure): stop misrouting Desktop users to the Code connector-verify path#118

Merged
hyoshi merged 1 commit into
mainfrom
fix/configure-host-confirm-desync
May 18, 2026
Merged

fix(configure): stop misrouting Desktop users to the Code connector-verify path#118
hyoshi merged 1 commit into
mainfrom
fix/configure-host-confirm-desync

Conversation

@hyoshi
Copy link
Copy Markdown
Collaborator

@hyoshi hyoshi commented May 18, 2026

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.host can reset to the claude-code default (configure process restart; /api/host was posted only on radio change, fire-and-forget, errors swallowed). So confirm_hosted_provider ran the Claude Code claude mcp list verification path for a Desktop user; with no Claude Code CLI, is_hosted_provider_connected returned a bare False → mapped to not_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)

  1. Client-authoritative host/api/providers/confirm and /api/providers/native-toggle resolve host from the request payload via _resolve_host (validated against SUPPORTED_HOSTS, written back to self-heal a stale session); finalize sends state.host.
  2. Host-sync hardening (wizard.js) — persist the explicit choice to localStorage and prefer it over the server-echoed status.host; syncHostToServer retries once and shows a toast instead of swallowing failures; assert host on host-step entry and on onReady.
  3. Tri-state connectivityhosted_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 (existing no-strand guards 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.

Tests

  • New tri-state TestHostedProviderConnectivity; rewritten/extended confirm tests (unverifiable, affirm, Desktop+affirm); handler host-resolution tests; i18n EN/JA parity for new keys.
  • Clean-env full suite: 3254 passed. ruff/black/mypy clean (changed files). JS syntax OK. code-reviewer: APPROVE (no CRITICAL/HIGH).

Out of scope (acknowledged, left as-is by maintainer): the separate setup_state.json ledger-vs-reality gap for upgraders.

…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).
@hyoshi hyoshi merged commit 4501cb7 into main May 18, 2026
8 checks passed
@hyoshi hyoshi deleted the fix/configure-host-confirm-desync branch May 18, 2026 03:32
@hyoshi hyoshi mentioned this pull request May 18, 2026
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