Skip to content

fix(openclaw): improve gateway startup diagnostics and fix UI polling loop#13495

Merged
kangfenmao merged 2 commits intomainfrom
DeJeune/sacramento
Mar 16, 2026
Merged

fix(openclaw): improve gateway startup diagnostics and fix UI polling loop#13495
kangfenmao merged 2 commits intomainfrom
DeJeune/sacramento

Conversation

@DeJeune
Copy link
Copy Markdown
Collaborator

@DeJeune DeJeune commented Mar 16, 2026

What this PR does

Before this PR:

  • Gateway startup failures showed limited diagnostics (only stderr, no stdout)
  • OpenClawPage had infinite re-render loops caused by setInterval + dispatch in useEffect deps
  • Process exit with code 0 was not properly diagnosed when the daemonized child failed

After this PR:

  • Capture both stdout and stderr from the gateway process for better failure diagnostics
  • Replace setInterval polling with SWR for stable, dedup'd status/health polling in the UI
  • Improve error messages for gateway startup timeout (combine health, stderr, stdout diagnostics)
  • Handle edge case where gateway exits with code 0 but never becomes healthy

Why we need it and why it was done in this way

The infinite re-render loop in the renderer was the root cause of false timeout errors during gateway health checks. Switching to SWR provides stable polling without the pitfall of setInterval + dispatch in useEffect deps.

The diagnostics improvements (stdout capture, combined error output) are independent quality-of-life improvements that help debug gateway startup failures.

Breaking changes

None.

Checklist

  • PR: The PR description is expressive enough and will help future contributors
  • Code: Write code that humans can understand and Keep it simple
  • Self-review: I have reviewed my own code before requesting review from others

Release note

NONE

DeJeune and others added 2 commits March 16, 2026 13:50
diagnostics

Replace Electron's fetch with Node.js http module for local gateway
health
checks to avoid system proxy interception (e.g., Surge, Clash). Capture
both
stdout and stderr for better startup failure diagnostics. Use SWR for
stable
status polling in the UI to prevent infinite re-render loops.
The root cause of false timeout errors was an infinite re-render loop
in the renderer, which was fixed by switching to SWR polling. The
node:http bypass for system proxy is unnecessary.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: suyao <[email protected]>
@DeJeune DeJeune requested a review from kangfenmao March 16, 2026 06:06
@DeJeune DeJeune changed the title fix(openclaw): bypass system proxy for local health checks and improve fix(openclaw): improve gateway startup diagnostics and fix UI polling loop Mar 16, 2026
@kangfenmao kangfenmao merged commit 590815b into main Mar 16, 2026
9 checks passed
@kangfenmao kangfenmao deleted the DeJeune/sacramento branch March 16, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants