Skip to content

fix(ui): catch up Ask OpenClaw from the transcript after reconnects - #188748

Merged
RomneyDa merged 2 commits into
openclaw:mainfrom
daniel-lxs:openclaw-ask-openclaw-chat-stuck
Nov 10, 2026
Merged

RomneyDa merged 2 commits into
openclaw:mainfrom
daniel-lxs:openclaw-ask-openclaw-chat-stuck

Conversation

@daniel-lxs

@daniel-lxs daniel-lxs commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

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:

  • If the socket hangs without closing, nothing happens until wake detection or the request timeout notices.
  • If your message never reached the Gateway, it disappears after the catch-up, and nothing tells you.

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
  • The rejoin request queues behind any turn that is still running, so the transcript read after it includes that turn's reply.
  • The transcript isn't read before the rejoin, because a running turn isn't in it yet and your sent message would vanish.
  • The unused custodian.connectionChanged string 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:

main: connection error with Retry after reconnecting

After (this PR), while offline:

PR: spinner under the sent message while offline

After (this PR), once reconnected:

PR: the reply shows up after reconnecting

Tests: ui/src/pages/custodian (15 files, 144 tests) and ui/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.

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review blocked

Automated 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.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Oct 30, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@obviyus

obviyus commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

@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.

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus

obviyus commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

NO-REPRO for the assigned single-drop/restore flow on current main.

Built main cf83a69f74eed57a3467bba3963d433e25d20743 and exercised its real Gateway-served Control UI in Chromium 156.0.8078.73, Node 24.22.1, secretless Linux arm64 Docker. Runtime and UI use the same supported build identity; the actual JS entry asset received by Chromium was hashed. The Gateway uses its normal token/device connection and existing operator.admin checks, with no authentication bypass or source changes.

Both independent runs:

  1. Open Ask OpenClaw through the shipped command palette, then close and reopen it normally.
  2. Submit one real openclaw.chat user turn. A deterministic local HTTP model fixture holds the actual provider response after the Gateway admits the turn.
  3. Destroy the real proxied Gateway WebSocket while Ask OpenClaw remains open; reject reconnect attempts temporarily. The UI observes disconnection and shows the existing connection-changed warning.
  4. Finish the provider reply while still disconnected, then restore the transport.
  5. Without clicking Retry, reloading, closing/reopening the panel again, or resubmitting the user input, main reconnects and displays the completed reply. The transient warning disappears.
                       main run 1          main run 2
normal open/close      passed              passed
reply finished offline yes                 yes
automatic catch-up     succeeded           succeeded
visible final reply    PROOF_REPLY_base1e  PROOF_REPLY_base2
user submissions       1                   1
input-free chat calls  2                   2
history reads          3                   3

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.

Main run 1 before transport drop

Main run 1 automatically recovered after transport restore

Main run 2 before transport drop

Main run 2 automatically recovered after transport restore

@obviyus

obviyus commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

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 obviyus closed this Oct 30, 2026
@daniel-lxs

Copy link
Copy Markdown
Member Author

@obviyus Could you reopen this? Both reconnect timings below reproduced on main 4a29006e89e7f13c042bf6ee557b9c64e3a99dc4, using a built Gateway and its bundled UI, Chromium 156.0.8078.79, Node 24.22.2, and isolated Linux arm64 state. A local HTTP model fixture held the provider reply; a WebSocket proxy dropped the real transport. Authentication used the normal token/device flow.

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 openclaw.chat rejoin request, with no rejoin response yet.

  • Second drop: drop the socket again, finish the provider reply offline, then allow reconnection. The reply appears, but Send stays disabled with a nonempty follow-up and “The connection changed. Try again to continue setup.” This reproduced twice; clicking Retry in the second run restored sending.
  • Reply during rejoin: finish the provider reply before rejoin responds. Rejoin succeeds and Send works, but the reply remains absent for the next 10 seconds, with no further history request. Closing/reopening the panel shows the stored reply.

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.

Second reconnect: reply visible, Send disabled, Retry error
Retry restores sending
Reply completed during rejoin but is absent
Closing and reopening reveals the stored reply

@hannesrudolph hannesrudolph reopened this Nov 7, 2026
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.
@daniel-lxs
daniel-lxs force-pushed the openclaw-ask-openclaw-chat-stuck branch from 261482e to 5055e4e Compare November 7, 2026 23:30
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Nov 7, 2026
@roboclaw-bot roboclaw-bot added the clawtributors PR from a clawtributor label Nov 8, 2026
@daniel-lxs

Copy link
Copy Markdown
Member Author

Both reconnect timings from my November 6 reproduction recover automatically on 5055e4e0e529a998e5ddbaee448fb4e3f280f96e.

  • Second drop during rejoin: after the reply finishes offline and the connection returns, the reply appears and Send is enabled with a follow-up typed.
  • Reply finishes during rejoin: the successful rejoin is followed by a history read containing the completed reply, which appears without closing and reopening the panel.

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.

Second drop: reply visible and Send enabled

Reply during rejoin: completed reply visible and Send enabled

Timing and evidence notes

@RomneyDa
RomneyDa merged commit 441b613 into openclaw:main Nov 10, 2026
100 of 103 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 11, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. clawtributors PR from a clawtributor size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants