Repository navigation
fix: Bindings keeps spinning when the gateway is disconnected - #1809
Conversation
Opening Bindings treated a non-null client as connected. RequestConfigAsync returns before the handshake, so the loading state never finished. Fail that state and show the disconnected bar, and request config again when the client connects. BindingsPageConnectionTests passed. ./build.ps1 exit 0. Shared 4638 passed, 24 skipped. Tray 4462 passed. Signed-off-by: Sebastien Tardif <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesBindings checks gateway readiness before loading and reloads configuration when the connection returns. Example: Open Bindings while its gateway client has not completed the handshake.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current-main loading bug, and both earlier callback findings are resolved; no blocking introduced defect remains. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherBindingsPage observes the manager-owned operator client and AppState configuration, sends config.get through the existing client, and renders routing rows or loading and connection states. flowchart LR
Manager[Connection manager] --> Client[Operator client]
Manager --> Page[Bindings page]
Page --> Client
Client --> Gateway[Gateway config]
Gateway --> State[GatewayService and AppState]
State --> Page
Page --> View[Routing and connection display]
Technical reviewBest possible solution: Keep the existing configuration and connection owners while gating Bindings requests on readiness and respecting page lifetime during recovery. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the failure: a non-null unready client starts Bindings loading while config.get is suppressed without a configuration event; this review did not execute a current-main reproduction. Is this the best way to solve the issue? Readiness gating and observing the existing manager-owned client address the stated defect without changing routing, configuration storage, or connection ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 20fddaf66846. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 21, 2026, 6:27 PM ET / 22:27 UTC (Revision 2). |
A handshake can drop, or the page can unload, before the dispatcher runs the reconnect callback. Recovery now checks that the page is still observing and that the client is still connected. Unload clears that observation first, so a queued swap cannot reattach the page. BindingsPageConnectionTests passed 5. WinUI x64 build succeeded. Tray tests passed 4466. Shared sources are unchanged from the 4638 passing run on this branch. Signed-off-by: Sebastien Tardif <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
OnClientStatusChanged returned early when the tracked client was not connected, so a Disconnected or Error event raised after recovery had started a config request was discarded and the loading state never cleared. Enqueue the event for the tracked client and let the queued callback decide: it already re-checks the observation and client identity. Adds a headless regression that drives the real BindingsPage owner through recovery followed by a same-client Disconnected or Error. Co-authored-by: Copilot App <[email protected]>
After the same-client disconnect fix, every status event of the tracked client reaches the UI thread. Queued Connecting and Connected events then both saw the reconnected client and each requested the config. Only the Connected event recovers now; a queued Connecting or Disconnected callback that finds the client already reconnected returns. Co-authored-by: Copilot App <[email protected]>
|
Hi @SebTardif, I'm a Copilot triage agent helping the maintainers (a bot, not a person). Thanks for this fix. While reviewing I found one more corner, so I pushed two small commits on top of your head (maintainer edits were enabled; please pull before pushing again, and feel free to revert or adjust either one). First, a Disconnected or Error event from the same client that arrives after a recovery reload starts was dropped by the connected check at event time, leaving the spinner on and Refresh disabled; the queued callback now decides from the current client state. Second, that made a queued Connecting plus Connected pair request the config twice, so only Connected recovers now. Headless tests that drive the real BindingsPage code-behind fail on the earlier head and pass now. On top of current main: build, Shared 4645 passed, Tray 4502 passed, and an independent review found nothing. Not verified: real native UI behavior. I'll merge once CI is green unless you'd like changes. |
Recovery proof
Head 5c8748c. Same isolated tray. A loopback Gateway, OpenClaw 2026.10.5, listened on 127.0.0.1:18799. The tray paired once, then stayed on the Bindings page.
UI Automation on OpenClaw Settings:
The earlier disconnected opening, with no Gateway configured, is in the section above. PrintWindow still returned a black frame, so this record is the live UI Automation tree.
Disconnected page proof
Head 5c8748c. Isolated tray data dir C:\Users\sebta\AppData\Local\Temp\pr1809-proof. MCP port 8779. No gateway configured.
app.status returned connectionStatus Disconnected, overallState Idle, operatorState Idle, gatewayVersion null.
app.navigate page bindings returned navigated true.
UI Automation on the OpenClaw Settings window, process 3008, then showed:
PrintWindow of that WinUI window returned a black frame, so this record is the live UI Automation tree rather than a bitmap.
Not in this capture: the page after a later successful gateway connection. This isolated profile has no gateway, so recovery was not shown.
Latest head
Head 5c8748c rechecks the page and the gateway connection when a queued Bindings callback runs. If the page has unloaded, the callback does not reattach the client. If the handshake dropped, the page keeps the disconnected bar instead of starting a load that config.get will suppress.
BindingsPageConnectionTests passed 5. WinUI x64 build succeeded. Tray tests passed 4466. A live tray screenshot of the disconnected bar and the later recovery is still not captured.
What Problem This Solves
Fixes: the Bindings page keeps its spinner up when the gateway client exists but is not connected.
User Impact
User impact: opening Bindings while the gateway is disconnected shows the disconnected bar and leaves Refresh disabled. When the gateway connects, the page requests the config again.
Why This Change Was Made
RequestConfigAsync returns without a config event until the handshake is ready. The page treated any non-null client as connected, so the loading state never finished. It now uses the same connected check as Usage, and it listens for the client to become connected.
Evidence
BindingsPageConnectionTests passed. The page source requires IsConnectedToGateway before RequestConfigAsync on open and on Refresh.
./build.ps1 succeeded.
dotnet test tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj passed 4638, skipped 24, total 4662.
dotnet test tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore passed 4462, skipped 0, total 4462.
No screenshot. The disconnected bar was not captured from a running tray.
Change Type
Scope
winnodeRequired proof pools
Validation
Real Behavior Proof
Security Impact