Repository navigation
Conversation
|
Thanks for the context here. I did a careful shell check against current Close: current main already preserves manager-owned crash-loop backoff using a narrower recorded ownership fact, so this conflicting branch no longer provides a distinct fix. So I’m closing this as already implemented rather than keeping a duplicate issue open. Review detailsBest possible solution: Keep current main’s recorded retry-supervisor ownership boundary and route any distinct current-main failure to a new focused report. Do we have a high-confidence way to reproduce the issue? No. Current main records active retry-supervisor ownership and its focused tests prove the monitor neither resets attempts nor starts the account during that backoff. Is this the best way to solve the issue? No. The branch infers ownership from retry state, whereas current main records the authoritative in-flight supervisor fact and preserves the distinct timed-out-stop recovery path. Security review: Security review cleared: The branch changes only gateway lifecycle TypeScript and tests, with no dependency, workflow, credential, permission, or artifact-execution surface. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against c925634ae83b; fix evidence: commit 618fba92bf01, main fix timestamp 2026-08-04T20:05:15-05:00. |
343306d to
2ea60ec
Compare
|
Revised the policy boundary at
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
2ea60ec to
f5f7628
Compare
|
Addressed the timed-out hot-reload ownership finding at
Added a composed production-manager + production-monitor regression: two prior crashes → hanging third task → non-manual stop timeout → first reload-style start arms recovery → monitor sweep replaces stale task → reconnect attempts reset to zero. Focused result: 14 files / 398 tests passed. The PR body now contains this sequence. I am still treating the requested live gateway/channel transcript as a separate proof requirement rather than pretending fake-time output is live evidence. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
f5f7628 to
1d7a7be
Compare
1d7a7be to
be8ca9e
Compare
|
ClawSweeper applied the proposed close for this PR.
|
Summary
ChannelManagerauthoritative while crash-loop backoff is activeidle | backoff | gave-up) to the health monitorFixes #104458
What Problem This Solves
The channel manager owns crash-loop attempts and backs off between retries. The health monitor separately evaluates stopped accounts and calls
resetRestartAttempts()before recovery.During an active manager backoff, a health sweep could therefore:
startChannel(), which no-ops because the manager task still exists,That composition prevents the manager from reaching its retry cap and can keep a persistently failing account in an unbounded restart loop.
The monitor cannot safely infer manager ownership from snapshot fields such as
running,restartPending, andreconnectAttempts, because timed-out monitor recovery also usesrestartPending. This patch puts the ownership decision at the manager boundary that owns the private attempt map.Implementation
ChannelManager.getRestartState()returns:idle: no active manager backoff; the health monitor may own recoverybackoff: manager retry progress is active and must not be resetgave-up: the manager exhausted its retry budgetThe health monitor skips only
backoff. Agave-upaccount continues through the monitor's existing cooldown andmaxRestartsPerHourbudget, preserving the established bounded revival contract. Timed-out stop recovery takes precedence over retained crash-attempt state and reportsidle, allowing the monitor to issue the second start required to replace the stale task.Evidence
RED: current-main behavior before the fix
The manager-plus-monitor integration regression uses the real
createChannelManager, realstartChannelHealthMonitor, production retry limit, and deterministic fake time.Before the fix, the monitor cleared active manager progress and the failing account reached 16 starts instead of terminating its first manager cycle at 11.
GREEN: exact-head behavior after the fix
With the monitor active through the first six attempts, the manager now observes the complete monotonic sequence:
The monitor is then stopped in that test so the first cycle can be asserted independently from the separate post-give-up policy.
A second real manager-plus-monitor integration test configures
maxRestartsPerHour: 1and proves the existing bounded revival contract remains intact:A composed timeout regression proves the hot-reload sequence with retained retry history:
Focused validation:
Changed-file gate
This includes production and test typechecks, changed-file lint, dependency/package guards, database-first guards, and runtime import-cycle checks.
Review feedback addressed
The reviews identified two distinct ownership boundaries: manager give-up must preserve bounded monitor revival, and timed-out stop recovery must remain monitor-owned even when prior crash attempts are retained. The revised patch now:
Compatibility and risk