Repository navigation
fix(ui): catch up Ask OpenClaw from the transcript after reconnects - #188748
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here. Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update. Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it. |
|
@clawsweeper re-review — please review this reconnect repair and identify any authentication/ownership contract or product-policy changes. Runtime before/after proof is being assessed separately; no such decisions are authorized in this repair. |
|
🦞👀 Re-review progress:
|
|
NO-REPRO for the assigned single-drop/restore flow on current main. Built main Both independent runs:
The before/after screenshots attached here are both from main, not candidate proof. Raw Gateway logs, actual WebSocket frames, provider requests and fresh screenshot directories are retained locally. No candidate runtime result is claimed. No product source, tests or budgets were changed, and nothing was pushed. Scope limitation: this does not disprove the contributor's broader cases involving a second interruption during the rejoin, a replaced client/Safari wake, or failed history reads. It establishes that the assigned ordinary pending-turn drop/restore flow already recovers on this main revision. The initial review was requested separately; this comment is not a claim that the PR is landing-ready. Setup attempts excluded from this verdict: independently built runtime/UI identities initially disagreed, which triggered an automatic UI rebuild and an owned stale build lock; rebuilding both with a shared supported timestamp and exact Git SHA resolved that setup issue. The first UI-driver selectors also assumed a page host absent from the real panel; the completed runs use the actual semantic composer and shipped palette action. Those attempts never reached the disconnect reproduction. |
|
Thanks @daniel-lxs for working on this. I couldn't reproduce the stuck Ask OpenClaw chat on current main: with a built Gateway and a real browser, dropping and restoring the Gateway connection reconnected automatically both times, and the reply that finished while disconnected showed up without Retry, a reload or resending (screenshots above). I'm closing this for now. We didn't cover repeated connection loss during rejoin, Safari client replacement or a failed history read; if one of those is what you hit, please reopen with the steps and I'll check that path. |
|
@obviyus Could you reopen this? Both reconnect timings below reproduced on main Start both cases by opening Ask OpenClaw, closing/reopening it normally, and sending one message. Once the provider receives it, drop the socket and temporarily reject reconnects. Allow reconnection while the reply is still held. Wait for the UI's history read and input-free
The WebSocket logs show one user-message submission per run. The original single-drop/finish-offline control recovered automatically. This tests main only; the PR fix and Safari remain untested. |
A dropped socket during a rejoin left a retry error and a blocked composer, and a Safari wake lost catch-up entirely while the agent list reloaded. A reply that finished behind the rejoin was never read. Catch-up now stays owed until chat is available again, restarts after an interrupted rejoin, and re-reads history once the rejoin has queued behind any running turn. Turn outcome flags clear only after that read succeeds.
261482e to
5055e4e
Compare
|
Both reconnect timings from my November 6 reproduction recover automatically on
Both stayed recovered for the same 10-second observation interval used on main. Neither needed Retry, reload or reopening; each sent the original user message exactly once. This used the candidate's built Gateway and bundled UI, normal token/device authentication, fresh Chrome contexts, and throwaway Gateway state. A transparent WebSocket proxy controlled the disconnects; a local model endpoint held the reply. Gateway RPCs and application state were real. One run per timing passed. Safari, physical network/sleep behavior, hosted models and actually submitting the follow-up were not tested. |
…penclaw#188748) * fix(ui): catch up Ask OpenClaw from the transcript after reconnects A dropped socket during a rejoin left a retry error and a blocked composer, and a Safari wake lost catch-up entirely while the agent list reloaded. A reply that finished behind the rejoin was never read. Catch-up now stays owed until chat is available again, restarts after an interrupted rejoin, and re-reads history once the rejoin has queued behind any running turn. Turn outcome flags clear only after that read succeeds. * test(ui): drop default type arguments in custodian store test










What Problem This Solves
Fixes: Ask OpenClaw gets stuck when the Gateway connection drops while a turn is running, for example on flaky Wi-Fi or when Safari wakes a sleeping tab.
The turn keeps running on the Gateway and its reply gets saved, but the panel shows "The connection changed. Try again to continue setup." with a Retry button, and that error stays after the connection comes back.
User Impact
Ask OpenClaw picks up where it left off after a reconnect. While offline, it shows a spinner instead of an error. Once the connection is back, the reply shows up without having to retry.
It never sends your message again. Errors that aren't about the connection still show, with Retry.
Known gaps:
Why This Change Was Made
After a reconnect, the panel rejoins the session and then reloads the transcript from the Gateway, so whatever happened while it was offline shows up. If the connection drops again partway through, it tries again on the next reconnect instead of giving up with an error.
Details
custodian.connectionChangedstring is removed.Evidence
The same steps on each build, against a mocked Gateway in the Control UI browser tests: send a message, drop the connection, let the turn finish, reconnect, then drop the connection again during the rejoin and reconnect.
Before (main), after reconnecting:
After (this PR), while offline:
After (this PR), once reconnected:
Tests:
ui/src/pages/custodian(15 files, 144 tests) andui/src/lib/agents(12 files, 140 tests) pass. Lint, UI typecheck and i18n checks also pass. The new tests cover both a socket close and a replaced client.Not tried against a live Gateway or on a phone.