Fix WhatsApp pairing to show actionable recovery instead of a raw exception (#957)#988
Merged
shanselman merged 1 commit intoJul 14, 2026
Conversation
When starting WhatsApp/web-login QR pairing against a gateway that has no web-login provider loaded, the Channels page dumped a raw System.InvalidOperationException plus a .NET stack trace containing internal CI build paths, instead of actionable recovery. Root cause is a Windows-node UX defect, not a WhatsApp-API workaround: the 'web login provider is not available' message is gateway-generated and relayed by the node, but the node (1) leaked its own stack trace via RawResponse = ex.ToString() and (2) never translated the known gateway signal into recovery. Changes: - WebLoginStartResult gains two detection properties mirroring ChannelStartResult.LooksLikeMissingPlugin: LooksLikeMissingWebLoginProvider (provider not loaded -> install guidance) and LooksLikeWebLoginUnsupported (gateway too old to implement web.login -> upgrade guidance). - OpenClawGatewayClient web-login catch blocks surface ex.Message instead of ex.ToString(), so no internal stack trace / build paths reach the UI. - ChannelsPage renders distinct, actionable recovery (copyable install command or upgrade guidance) and keeps the clean gateway detail in the collapsed diagnostic. - Adds Shared detection tests and a Tray source-contract test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Fixes #957.
Problem
Starting WhatsApp QR pairing from the Channels page, against a connected gateway that has no web-login provider loaded, failed by dumping a raw
System.InvalidOperationExceptionplus a .NET stack trace containing internal CI build paths (D:\a\openclaw-windows-node\...) to a non-technical user — instead of actionable recovery.Root-cause ownership (verified — a real Windows-node UX defect, not a WhatsApp-API workaround)
"web login provider is not available"exists nowhere in this repo — it is gateway-generated and only relayed by the node.{ ok: false, error: "web login provider is not available" };OpenClawGatewayClientwraps that message in anInvalidOperationException;WebLoginStartAsynccaught it and storedRawResponse = ex.ToString()— the full .NET stack trace with build-machine paths seen in the issue screenshot.Changes
OpenClaw.Shared/ChannelsSnapshot.cs—WebLoginStartResultgains two computed detection properties, mirroring the existingChannelStartResult.LooksLikeMissingPluginpattern:LooksLikeMissingWebLoginProvider— provider not loaded → guide the user to install the provider on the gateway host.LooksLikeWebLoginUnsupported— gateway doesn't implement theweb.loginRPC at all → guide the user to upgrade the gateway (installing a plugin wouldn't add the missing method).OpenClaw.Shared/OpenClawGatewayClient.cs—WebLoginStartAsync/WebLoginWaitAsynccatch blocks now surfaceex.Message(the clean gateway reason) instead ofex.ToString(), so no internal stack trace / CI build paths reach the UI.OpenClaw.Tray.WinUI/Pages/ChannelsPage.xaml.cs— the linking flow routes the two detected states to distinct, actionable recovery UIs (a copyableopenclaw plugins install @openclaw/<channelId>command with a Copy button, or upgrade guidance) with a non-actionable-exception headline, and keeps the clean gateway detail available in the collapsed "Why isn't this working?" diagnostic.Validation
./build.ps1✅dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore✅ (2772 passed, 31 skipped)dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore✅ (1709 passed)ChannelResultTests.WebLoginStartResultTests(both detection properties, including cross-classification checks) andChannelsPageWebLoginRecoveryContractTests(source-contract: both properties referenced, recovery-command affordance present, actionable headline present, and the web-login region contains noRawResponse = ex.ToString()).Real behavior proof
"web login provider is not available") and assert it maps toLooksLikeMissingWebLoginProviderand NOTLooksLikeWebLoginUnsupported; the Tray source-contract test asserts the linking flow renders the recovery affordance and that the web-login catch region no longer emitsex.ToString().web login provider is not availableforweb.login.start— a gateway-host provider state that cannot be reproduced from this repo/host. Manual repro: connect the tray to a gateway whose WhatsApp web-login provider is not loaded, open Channels → WhatsApp → Show QR. Expected: headline "WhatsApp linking isn't available on this gateway yet — see how to enable it below.", a recovery panel with a copyableopenclaw plugins install @openclaw/whatsappcommand + Copy button, and the raw gateway detail available only under the collapsed diagnostic (noSystem.InvalidOperationException/ stack trace /D:\a\...paths in the headline).Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com