Commit 48659b0
committed
fix(controller): stop masquerading gateway-WS failure as per-channel credential failure
Issue #856: after 0.1.10-nightly.20260406 users reported all IM channels
showing as disconnected with a "Reconnect required" CTA, forcing them to
re-authenticate channels whose tokens on disk were still valid.
Root cause: openclaw-gateway-service.ts#getAllChannelsLiveStatus had two
fallback paths (WS-not-connected pre-check and RPC-throws catch) that
both returned status:"disconnected", configured:false, lastError:null
for every channel. The web UI treats that shape as a real credential
failure and prompts re-auth. When the OpenClaw gateway WS was
transiently unreachable (skillhub sync churn, deterministic-config
reload, langfuse restart, OAuth apiKey rejection) every channel got
flagged disconnected despite nothing being wrong.
Channel records on disk were never touched — only the live-status reply
lied.
Fix: both fallback paths now return status:"connecting", configured:true,
lastError:null. The existing UI path for "connecting" (home.tsx:273-327
getChannelStatusMeta) already renders the amber spinner without a
re-auth CTA, and the existing "Offline" + "Agent starting…" header pills
already communicate the gateway-unavailable state. No new banner or
i18n strings were needed.
Supporting cleanup: runtimeState / isBootPhasePreReady threading was
only used by the branch we just simplified, so the service constructor
drops that parameter. container.ts and the two test fixtures
(openclaw-gateway-service.test.ts, route-compat.test.ts) updated for the
new signature.
Tests: two new cases in openclaw-gateway-service.test.ts cover the
WS-not-connected and RPC-throws branches and assert the honest shape.
Packaged smoke test (macOS arm64, unsigned): baseline green, kill
openclaw via launchctl bootout + kill -9, UI flips to red Offline / amber
Agent-starting / amber Feishu-connecting with NO red shield and NO
Reconnect CTA; restart openclaw, UI returns to green within one poll
cycle with no re-auth required. Full write-up at
specs/design-docs/2026-04-15-channel-status-masquerade-fix.md including
a sidebar on launchd KeepAlive supervision (OpenClaw auto-restarts
within ~5s of a crash as long as the controller is alive).1 parent 1172725 commit 48659b0
5 files changed
Lines changed: 179 additions & 34 deletions
File tree
- apps/controller
- src
- app
- services
- tests
- specs/design-docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
Lines changed: 14 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | 17 | | |
22 | 18 | | |
23 | 19 | | |
| |||
148 | 144 | | |
149 | 145 | | |
150 | 146 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 147 | + | |
155 | 148 | | |
156 | 149 | | |
157 | 150 | | |
| |||
327 | 320 | | |
328 | 321 | | |
329 | 322 | | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
337 | 328 | | |
338 | 329 | | |
339 | 330 | | |
340 | 331 | | |
341 | 332 | | |
342 | 333 | | |
343 | | - | |
| 334 | + | |
344 | 335 | | |
345 | 336 | | |
346 | 337 | | |
347 | | - | |
| 338 | + | |
348 | 339 | | |
349 | 340 | | |
350 | 341 | | |
| |||
492 | 483 | | |
493 | 484 | | |
494 | 485 | | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
495 | 490 | | |
496 | 491 | | |
497 | 492 | | |
498 | 493 | | |
499 | 494 | | |
500 | 495 | | |
501 | | - | |
| 496 | + | |
502 | 497 | | |
503 | 498 | | |
504 | 499 | | |
505 | | - | |
| 500 | + | |
506 | 501 | | |
507 | 502 | | |
508 | 503 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
26 | 23 | | |
27 | 24 | | |
28 | 25 | | |
| |||
47 | 44 | | |
48 | 45 | | |
49 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
50 | 92 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
123 | 120 | | |
124 | 121 | | |
125 | 122 | | |
| |||
Lines changed: 111 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
0 commit comments