fix(web): Reconnect on a switched-off environment switches it back on #24691
main fromrefs/pull/24691/head·merged by maria-rcks View on GitHubProblem#
Disconnect server switches an environment off. If you come back to one of its threads, for example with Back or a reload, the banner says " is offline" and offers Reconnect. Reconnect calls retryNow, which does nothing while the environment is switched off. It stays offline even once the server is back. The only way out is to switch the environment on again in Settings › Connections.
To reproduce:
- Pair a second environment and open one of its threads.
- Open a thread from another environment, then go back to the first thread.
- Stop the second environment's server and wait for "is reconnecting". Press Disconnect server.
- Start the server again, then press Back twice.
- Press Reconnect. Nothing happens.
Change#
In useSystemComposerBanners.tsx, Reconnect now checks the catalog entry the banner already has. If the environment is switched off (entry.enabled === false), Reconnect switches it back on with setEnabled. Otherwise it calls retryNow as before. The label and the failure toast are unchanged.
Scope and approval#
This is a very small, focused fix for an obvious bug. The button does nothing, and the fix makes it do what its label says. It changes one file, and no contract or shared code.
Found by @B-EtterDigital in their comment on #22024. It is separate from #22024 itself, which is about the "reconnecting" banner having no retry. #22207 addresses that, but it still sends this switched-off case to retryNow. #22207 also touches nearby lines, so whichever of the two merges second needs a small rebase.
Verification#
I ran this in the web app with two local dev servers: A, paired with the browser, and B, saved as a remote environment over a direct connection. I reached the banner by the Back route above, with B already running again before pressing Reconnect. Before and after used the same data, viewport and theme.
- Before (
main): "openclaw is offline" with Reconnect. About 30 seconds after pressing it, the banner still said offline and B's thread was still missing from the sidebar. - After: within about 2 seconds of pressing Reconnect, the banner was gone. B's thread was back in the sidebar, and Settings › Connections showed B as Connected. There was no error toast.
main | This branch | |
|---|---|---|
| Before pressing Reconnect (same on both) | ||
| After pressing Reconnect | ||
| Sidebar after pressing Reconnect |
Settings › Connections after pressing Reconnect on this branch:
main: Back to the thread, press Reconnect, still offline.
https://github.com/user-attachments/assets/77e0f150-6e7c-4621-b140-8bc78e0daf5c
This branch: Back to the thread, press Reconnect, reconnected.
https://github.com/user-attachments/assets/4c44dc1f-abca-4ed0-9286-2505936d44dd
vp run check:changed passed lint, knip and typecheck, and vp fmt --check passed on the changed file.
I added no test. The fix changes which of two existing commands one button calls. A unit test would mock both commands and assert which one was called, which is the callback-wiring test AGENTS.md asks contributors not to write. setEnabled itself is unchanged and covered by the existing registry tests. The before and after captures show the behaviour.
Not checked: desktop (same web UI).
Known, not changed#
On mobile, the connection notice (terminal, review and file preview) shows Retry now on a switched-off environment. It also calls retryNow, so it has the same dead button. It is left for a follow-up because I couldn't test mobile.
Written by Claude Opus 5.5, in Claude Code inside J5 Code, on Jackson's behalf.
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
2eaaa53Macroscope's review found this PR approvable — This is a small, self-contained web bug fix that routes the existing Reconnect action through the established enable-and-connect command only for environments explicitly switched off. Other retry behavior remains unchanged, with no product-default, schema, security, deployment, or static-analysis changes.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 8045537
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d5e7feda-97b1-4e71-9906-b68b00790e59
Commits-
Reviewing files that changed from the base of the PR and between 80455376f01f19c10a06dc08b0629486c017bf79 and 2eaaa533e9233ea3d24c732816eaa873d88a530c.
Files selected for processing: 1-
apps/web/src/components/chat/useSystemComposerBanners.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
Walkthrough
-
The reconnect handler now enables a disabled environment. It continues to retry the connection when the environment is already enabled. Both command results use the existing failure handling.
Changes: Environment reconnect
Priority:Layer / File(s) Summary Reconnect command selection
apps/web/src/components/chat/useSystemComposerBanners.tsxThe handler enables a disabled environment and retries an enabled environment. Both results pass through the existing failure handling. NormalEstimated code review effort: 2 (Simple) | ~5 minutes
Change: Bug fix
Suggested labels:
bugfix,size:XSSuggested reviewers:
juliusmarminge
Merge Risk:
Minimal · up to2eaaa-
The web reconnect action now handles both disabled and enabled environments as intended.
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly and concisely describes the main change: Reconnect re-enables a switched-off environment. Description check The description includes all required sections. It explains the problem and reproduction steps, the implementation, scope rationale, linked issue context, detailed verification results, screenshots an… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Full details: Description check
-
Explanation
The description includes all required sections. It explains the problem and reproduction steps, the implementation, scope rationale, linked issue context, detailed verification results, screenshots and recordings, limitations, and agent attribution.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Note
Written by
gpt-6.1-solon behalf of MariaVerified in a real dev environment#
verified as-is at
2eaaa533e9233ea3d24c732816eaa873d88a530con this linux boat vm, using repo playwright and/usr/bin/google-chrome.- installed and ran
github/main(32ecd71726) in a separate worktree first, then stopped its dev server before running the exact pr head. ranvp ifor both. dev web/server ports were 8693/16733. - paired the vm's existing real server as a second environment through a temporary tcp proxy. created a project pointing at the real
/home/user/maingit worktree through the ui, then ran codexgpt-6.1-sol. no mocks, fixtures or replay provider. - stopped the proxy to create a real connection loss, clicked "disconnect server", restored the proxy, and reopened the thread by its saved url. on main, "reconnect" left the offline banner, hidden sidebar thread and settings toggle off despite the server being reachable.
- with the same saved environment and thread on the pr, "reconnect" removed the banner, restored the sidebar thread, and settings showed connected with its toggle on. a real codex follow-up ran
pwdandgit rev-parse --is-inside-work-tree, then returnedRECONNECT_AFTER_OKin the client. - nearby behavior passed: reload preserved the enabled connection and conversation; a later connection loss recovered automatically without using "disconnect server".
- also created a project for
/home/user/t3codethrough the pr ui and completed a real codex turn through the pr's own server. its visible command output was:
$ pwd /home/user/t3code $ git rev-parse HEAD 2eaaa533e9233ea3d24c732816eaa873d88a530c PR_SERVER_OKall 29 existing ci checks are successful. no source changes or pushes were needed.
main after clicking reconnect, still offline:

pr after clicking reconnect, same conversation and viewport:

real codex follow-up after reconnect:

real codex turn through the pr's own server:

Not verified#
native desktop, ios/android, macos/windows, relay/tunnel connections, and providers other than codex were not exercised on this linux vm. the already-enabled environment's manual reconnect error path was not reached; automatic recovery was exercised. this pass verified the web/direct-connection flow above.
- installed and ran
maria-rcks merged thise5871b6
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes