Repository navigation
fix(gateway): avoid stale wake delays after node re-pairing - #109647
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 20, 2026, 9:26 AM ET / 13:26 UTC. Summary PR surface: Source +2883, Tests +4178. Total +7061 across 79 files. Reproducibility: yes. from source, with medium confidence: current main keeps pending work and connected node ownership keyed by node ID/connection rather than a durable pairing generation. A live race reproduction for removal or same-ID replacement was not independently executed in this read-only review. Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Have gateway owners confirm one authoritative pairing-generation invariant, then land only after the exact rebased head proves removal, revocation, reapproval, and same-ID replacement behavior without regressing ordinary reconnects. Do we have a high-confidence way to reproduce the issue? Yes from source, with medium confidence: current main keeps pending work and connected node ownership keyed by node ID/connection rather than a durable pairing generation. A live race reproduction for removal or same-ID replacement was not independently executed in this read-only review. Is this the best way to solve the issue? Unclear: generation fencing is a coherent solution to stale ownership, but this implementation makes it a gateway-wide authority model; gateway owners should compare it with a narrower lifecycle-owner repair before accepting that permanent boundary. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against 8d4d02a3cfa4. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +2883, Tests +4178. Total +7061 across 79 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (5 earlier review cycles)
|
4387781 to
f4fa3a2
Compare
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph change authorizedThis PR includes dependency graph changes. A repository admin or member of
A later push changes the PR head SHA and requires a fresh security approval. |
Co-authored-by: zhang-guiping <[email protected]>
|
/allow-dependencies-change Proxyline 0.3.4 is the maintainer-released package required for the reviewed AbortSignal cancellation contract; package, pnpm lock, npm shrinkwrap, and bounded release-age policy entries were verified against the published registry integrity. |
Co-authored-by: zhang-guiping <[email protected]>
Co-authored-by: zhang-guiping <[email protected]>
|
/allow-dependencies-change Proxyline 0.3.4 is the maintainer-released package required for the reviewed AbortSignal cancellation contract; package, pnpm lock, npm shrinkwrap, and bounded release-age policy entries were verified against the published registry integrity. |
Co-authored-by: zhang-guiping <[email protected]>
|
/allow-dependencies-change Proxyline 0.3.4 is the maintainer-released package required for the reviewed AbortSignal cancellation contract; package, pnpm lock, npm shrinkwrap, and bounded release-age policy entries were verified against the published registry integrity. |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(gateway): avoid stale wake delays after node re-pairing This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Land-ready proof for exact head
Known proof gap: a second direct AWS exact-head allocation was unavailable because the Crabbox broker returned HTTP 401 before provisioning. No contributor code ran locally; exact-head secretless GitHub CI supplied the complete final runtime and type proof. |
|
Merged via squash.
|
wow...Your work is far too efficient. Thank you for your review of this large-size PR of mine. |
…#109647) * fix(gateway): clear wake state on node removal * fix(gateway): invalidate wake flows on node removal * fix(gateway): preserve active wakes on disconnect * fix(gateway): share node removal runtime cleanup * fix(gateway): clean up pending node work reliably * fix(gateway): bind node work to pairing generations * fix(gateway): fence stale node pairing sessions * fix(gateway): tighten node pairing ownership * fix(gateway): close node pairing mutation races * fix(gateway): bind node sessions to pairing generation * fix(gateway): harden node pairing generation guards * fix(gateway): close node pairing generation races * fix(gateway): guard APNs transport ownership * fix(gateway): revoke reapproved node transports * fix(gateway): guard retired node lifecycles * fix(gateway): preserve pending work across reconnects * fix(gateway): bind node subscriptions to pairing generations * fix(gateway): settle subscription fanout failures * fix(gateway): fence pairing generation ownership * fix(gateway): fence asynchronous node events * fix(gateway): fence watch results and voice wake fanout * fix(gateway): guard voice wake generation fanout * fix(gateway): carry authenticated snapshot generation * fix(gateway): bind node state to pairing generation * fix(gateway): align generation guards with current base * fix(gateway): enforce pairing-owned node lifecycle * fix(gateway): fence detached voice session writes * chore(deps): bump proxyline to 0.3.4 * fix(gateway): close pairing lifecycle races Co-authored-by: zhang-guiping <[email protected]> * fix(gateway): distinguish pending action mutation Co-authored-by: zhang-guiping <[email protected]> * test(gateway): align lifecycle coverage Co-authored-by: zhang-guiping <[email protected]> * test(skills): split remote reconciliation coverage Co-authored-by: zhang-guiping <[email protected]> * style: format pairing lifecycle changes Co-authored-by: zhang-guiping <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Removing, revoking, reapproving, pruning, or replacing a paired node could leave process-local runtime authority behind. A retired transport could remain visible to dispatch or projections, stale pending/wake state could be inherited by a same-ID replacement, and APNs work could outlive the pairing generation that authorized it.
Why This Change Was Made
The repair makes durable pairing state the canonical owner of node transport authority:
@openclaw/proxyline0.3.4; OpenClaw no longer carries a parallel CONNECT implementation.Maintainer decision: pairing generation is the canonical ownership boundary for approved node authority. Pairing identity remains the boundary for authenticated pre-approval sessions, while connection ID selects the exact live transport.
User Impact
A removed or replaced node can no longer continue using retired transport authority, send or consume replacement-owned work, retain stale wake delays, refresh replacement presence, advertise stale remote capabilities, expose retired node-hosted tools or skills, or leave proxy/APNs connection setup running after its pairing is invalidated. Ordinary same-generation reconnects continue to retain state that belongs to the same pairing.
Evidence
Exact reviewed head:
5912f471675c7d7801c2c70b5761212467edea39.Lifecycle matrix:
Validation and review:
latestresolves to@openclaw/[email protected].mainfound stale-session, APNs acknowledgement, presence-throttle, detached-media, and remote-projection races. Independent authority, persistence, and APNs reviews found active-node lease, node-tool retirement, and active-stream cancellation gaps. Commitc01388f54fixes all accepted findings with focused regressions.6dd26c546makes those helpers call the private pruning primitive directly. Incremental AutoReview was clean at 0.93 confidence.6dd26c546exposed stale test mocks/fixtures, test-only export ownership, type-check gaps, and two max-lines ratchets. Commit4fcda24admoves wake-state test access behind the test-support convention, preserves APNs cancellation and both remote-projection regressions in focused coverage, and aligns the fixtures with the current connection contract. Incremental AutoReview was clean at 0.93 confidence.4fcda24adpassed every runtime, type, dependency, platform, and security lane; onlyremote.test.tsremained above the max-lines ratchet. Commit67c34ca74moves the reconciliation cases into a focused test file. Incremental AutoReview was clean at 0.99 confidence.67c34ca74passed all changed runtime/type/security paths; one unrelated media-store cleanup test flaked, while the lint lane identified nine formatting drifts. Commit5912f4716applies only the trusted formatter output. Formatter-diff AutoReview was clean at 0.99 confidence.