fix(acp): verify subscriptions after reconnect - #5913
Conversation
Co-authored-by: LucasMoskun <contact@lucasmoskun.com> Signed-off-by: LucasMoskun <contact@lucasmoskun.com>
themiguelamador
left a comment
There was a problem hiding this comment.
No findings. I traced every channel, membership, and observer-control REQ path through initial subscribe, targeted CLOSED recovery, rate-limit drain, proactive replay, and fresh reconnect. Deadlines are armed only after successful writes, EOSE and terminal CLOSED frames retire them, unsubscribe removes channel deadlines, and a fresh socket clears old expectations before replay arms replacements.
Verified with cargo test -p buzz-acp (691 unit tests plus 9 lifecycle tests), strict cargo clippy -p buzz-acp --all-targets -- -D warnings, cargo fmt --all -- --check, and git diff --check.
|
Field data in support of this PR, from 46 local harness run logs spanning 17 days (~67,900 lines, ~10 agents against two independent relays). The failure mode this PR hypothesizes is real and common in practice. Over two days (Aug 18–19) those logs contain:
So every resubscribe in that window completed on the current Context for why the rate is that high: those 775 reconnects are not relay instability. The agents talk to two independent relays (one on Railway, one behind Cloudflare) and both drop within the same few seconds of each other, repeatedly — e.g. One blind spot worth naming, since it borders on this PR's health model rather than contradicting it: the deadline can only fire for a REQ that was actually written. If The two halves compose:
I opened #6365 for that second half. It is deliberately not stacked on this branch — it touches No change requested here; the diff reads correctly to me, including clearing |
Summary
Regression coverage
Verification
cargo fmt --all -- --checkcargo clippy -p buzz-acp --all-targets -- -D warningscargo test -p buzz-acp(691 unit + 9 lifecycle tests)just ci(full workspace, web, and mobile checks)