fix(cli): auto-reconnect logs --follow on transient gateway disconnect #74782#75059
fix(cli): auto-reconnect logs --follow on transient gateway disconnect #74782#75059RomneyDa merged 2 commits intoopenclaw:mainfrom
Conversation
|
Codex review: needs changes before merge. Summary Reproducibility: yes. Current main has a source-level reproduction: an explicit Next step before merge Security Review findings
Review detailsBest possible solution: Land one canonical focused CLI fix that retries transient follow-mode Gateway disconnects, preserves fatal auth/pairing behavior and implicit-loopback fallback, keeps JSON output machine-readable, includes tests/docs/changelog, and supersedes the competing PR if needed. Do we have a high-confidence way to reproduce the issue? Yes. Current main has a source-level reproduction: an explicit Is this the best way to solve the issue? No, not as-is. The retry loop is the right boundary, but this branch should emit retry notices as JSON under Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 9fff2b779159. |
Fixed in the latest commit, |
|
Nice, I attempted similar fix here but like this better. |
* 'main' of https://github.com/openclaw/openclaw: fix(cli): auto-reconnect logs --follow on transient gateway disconnect #74782 (#75059)
#75059 (fixes #74782) added user-facing CLI behavior — bounded exponential reconnect for `openclaw logs --follow` on transient gateway disconnect — and updated docs/cli/logs.md, but landed without a `## Unreleased` entry. Add the missing line so the credited human contributor is captured in the active release window. Thanks @shashank-poola.
#75372 added `[logs] gateway reconnected` notice and JSON `notice` records as a follow-up to #75059 and landed today, but its changelog entry was placed under `## 2026.4.29` (already released). Move it next to the related #75059 entry under `## Unreleased ### Fixes` so the released section stays frozen and the credited contributor lands in the right release window. Thanks @RomneyDa.
openclaw#75372 added `[logs] gateway reconnected` notice and JSON `notice` records as a follow-up to openclaw#75059 and landed today, but its changelog entry was placed under `## 2026.4.29` (already released). Move it next to the related openclaw#75059 entry under `## Unreleased ### Fixes` so the released section stays frozen and the credited contributor lands in the right release window. Thanks @RomneyDa.
…openclaw#74782 (openclaw#75059) * fix(cli): auto-reconnect logs --follow on transient gateway disconnect * fix(cli): honor errorLine return value in follow retry warning
openclaw#75059 (fixes openclaw#74782) added user-facing CLI behavior — bounded exponential reconnect for `openclaw logs --follow` on transient gateway disconnect — and updated docs/cli/logs.md, but landed without a `## Unreleased` entry. Add the missing line so the credited human contributor is captured in the active release window. Thanks @shashank-poola.
openclaw#75372 added `[logs] gateway reconnected` notice and JSON `notice` records as a follow-up to openclaw#75059 and landed today, but its changelog entry was placed under `## 2026.4.29` (already released). Move it next to the related openclaw#75059 entry under `## Unreleased ### Fixes` so the released section stays frozen and the credited contributor lands in the right release window. Thanks @RomneyDa.
…openclaw#74782 (openclaw#75059) * fix(cli): auto-reconnect logs --follow on transient gateway disconnect * fix(cli): honor errorLine return value in follow retry warning
* 'main' of https://github.com/openclaw/openclaw: fix(cli): auto-reconnect logs --follow on transient gateway disconnect openclaw#74782 (openclaw#75059)
openclaw#75059 (fixes openclaw#74782) added user-facing CLI behavior — bounded exponential reconnect for `openclaw logs --follow` on transient gateway disconnect — and updated docs/cli/logs.md, but landed without a `## Unreleased` entry. Add the missing line so the credited human contributor is captured in the active release window. Thanks @shashank-poola.
openclaw#75372 added `[logs] gateway reconnected` notice and JSON `notice` records as a follow-up to openclaw#75059 and landed today, but its changelog entry was placed under `## 2026.4.29` (already released). Move it next to the related openclaw#75059 entry under `## Unreleased ### Fixes` so the released section stays frozen and the credited contributor lands in the right release window. Thanks @RomneyDa.
Closes #74782
What this fixes
openclaw logs --followexits immediately on any gateway error — including a simplegateway restart — forcing the user to manually re-run the command.
Before:
After:
How it works
The
--followpolling loop now retries on transient transport failures instead ofcalling
process.exit(1). Backoff: 1 s → 2 s → 4 s → … → 30 s cap, up to 8attempts. The retry counter resets after every successful fetch.
Not everything is retried — non-recoverable errors exit immediately:
1008(policy violation / pairing required)4000–4999(auth, rate-limit)Scope
This adds explicit retry for
--urltargets. For implicit loopback connections theexisting local-file fallback already prevents exit — that path is preserved as-is.
Verified