fix(gateway): bound permanent startup failures (#284) - #308
Conversation
|
Warning Review limit reached
Next review available in: 14 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review detailsβοΈ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: π Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
π¦ ClawReviewYour friendly reef crab, here with the lay of the land. This PR fixes a systemd restart-loop bug where At a glance
Good to know
β ClawReview π¦, scuttling off. General info only β see CodeRabbit for the detailed review. Conventions: docs. |
- Redaction now also covers password=/api_key=/bare sk-β¦ provider keys, not just token/secret/credential/Bearer/telegram β the offline page is LAN-visible during setup, so a leaked key/password would be exposed. - install.sh: reset-failed before every gateway restart/start in the setup + legacy-recovery paths, so a tripped start-limit breaker can't leave the gateway offline after an update (systemctl restart is refused until reset-failed once start-limit-hit). - journalctl scoped by _SYSTEMD_INVOCATION_ID alone (dropping -u UNIT, which OR-expands and broke the AND) so the surfaced error is the current failure. - Tighten health-probe timeouts (systemctl 3s->2s, journalctl 5s->2.5s) so the offline page can't block ~8s. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Fixes #284. Supersedes #297 β same fix (@jamesachurchill's commits, authorship preserved), re-homed onto current beta and run through our flow.
The bug
clawbox-gateway.servicehadRestart=alwaysand no start limit, so a permanently failing gateway restarted forever. (systemd's default 5-in-10s limiter never trips withRestartSec=5β the window is too short β the exact footgun behind #284.)The fix
StartLimitIntervalSec=3600+StartLimitBurst=5in the[Unit]section (not[Service], where modern systemd ignores them) +Restart=on-failure: a permanently-failing gateway now stops after 5 attempts withstart-limit-hitinstead of thrashing. Recovery issystemctl reset-failed && restart.src/lib/gateway-health.ts: surfaces the breaker state on the authenticated gateway-offline page (unprivilegedsystemctl show;journalctlonly when failed, scoped to the current invocation; secret redaction + HTML-escaping).Verified on the Jetson (aarch64)
tsc --noEmit: clean Β· tests: 19 pass (gateway.test.ts,gateway-health.test.ts,install-post-update-units.test.ts).[Unit].failed), andreset-failedrecovered β with the realclawbox-gatewayuntouched (throwaway units).