fix(gateway,mac): stop stale protocol mismatch reconnect loop, auto-r…#82876
fix(gateway,mac): stop stale protocol mismatch reconnect loop, auto-r…#82876loeclos wants to merge 1 commit into
Conversation
…emediate updater jobs, rate-limit server side - Add PROTOCOL_MISMATCH to ConnectErrorDetailCodes so clients recognize the error type and pause reconnect instead of looping forever - Server now sends code: PROTOCOL_MISMATCH in protocol mismatch error response; GatewayClient includes it in shouldPauseReconnect list - doctor --fix now auto-removes stale ai.openclaw.update.* launchd jobs - Server-side per-IP rate limiter suppresses logs/error frames after 5 protocol mismatches per 60s from the same address
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: the linked rollback report was resolved by the merged maintainer PR on current main, while this branch is now conflicting and its remaining auto-removal/rate-limit approach is unproven and not the accepted fix direction. Canonical path: The linked rollback issue was closed by maintainer comment as fixed by merged PR #82908 and commit 38b3e73. So I’m closing this here and keeping the remaining discussion on #82908. Review detailsBest possible solution: Keep the merged gateway diagnostics and rollback troubleshooting as the canonical resolution; pursue reconnect gating or automatic updater-job removal only as a new current-main PR with maintainer approval and live macOS proof. Do we have a high-confidence way to reproduce the issue? Partly yes from source and the linked issue logs: the protocol-mismatch and reconnect paths are inspectable, but no live macOS rollback reproduction was established for this branch. Is this the best way to solve the issue? No. The accepted current-main fix is diagnostics and manual stale-process cleanup, while this conflicting branch adds unproven automatic removal and rate-limiting behavior that would need a fresh maintainer decision. Security review: Security review cleared: No supply-chain or secret-handling change was found; the concrete concern is operational compatibility from launchd job removal, covered as merge risk. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against f1b8827d20c8; fix evidence: commit 38b3e7362272, main fix timestamp 2026-05-17T06:33:34+01:00. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
cli v2026.5.12) continuously reconnects to the gateway producing ~1/sec protocol mismatch spam that persists across gateway restarts and killing visible helper processesdoctor --fixauto-removes staleai.openclaw.update.*launchd jobs; (3) server rate-limits repeated protocol mismatches per source IPChange Type
Scope
Linked Issue/PR
Real behavior proof
pnpm test src/gateway/reconnect-gating.test.ts— 13/13 pass including PROTOCOL_MISMATCH blockpnpm test src/daemon/launchd.test.ts— 59/59 passpnpm test src/commands/doctor-platform-notes.launchctl-env-overrides.test.ts— 6/6 passpnpm test src/flows/doctor-health-contributions.test.ts— 16/16 passpnpm test src/cli/daemon-cli/status.gather.test.ts src/cli/daemon-cli/status.print.test.ts— 27/27 passpnpm test src/gateway/protocol/— 87/87 passRoot Cause
GatewayClient.shouldPauseReconnectAfterAuthFailure()did not listPROTOCOL_MISMATCHas a pause-eligible detail code, so any client receiving a protocol mismatch error would retry indefinitely (exponential backoff 1s→30s, never stopping)ai.openclaw.update.*launchd jobs — only detection/reporting existedRegression Test Plan
src/gateway/reconnect-gating.test.ts—isNonRecoverableAuthErrorblock test forPROTOCOL_MISMATCHUser-visible / Behavior Changes
openclaw doctor --fixon macOS now auto-removes staleai.openclaw.update.*launchd jobs instead of only reporting themDiagram