Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 18, 2026, 7:41 AM ET / 11:41 UTC. Summary PR surface: Source +12, Tests +129. Total +141 across 3 files. Reproducibility: yes. at source level: invoke the ZaloUser gateway start with an already-aborted signal or abort during async allowlist/group preflight; supplied A/B tests and configured-account output report the former behavior and the fix. I could not independently run or inspect that path because the review sandbox rejected read-only command execution. Review metrics: none identified. 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
Security Review detailsBest possible solution: Rebase or merge-queue-refresh this focused plugin-local fix onto current Do we have a high-confidence way to reproduce the issue? Yes, at source level: invoke the ZaloUser gateway start with an already-aborted signal or abort during async allowlist/group preflight; supplied A/B tests and configured-account output report the former behavior and the fix. I could not independently run or inspect that path because the review sandbox rejected read-only command execution. Is this the best way to solve the issue? Yes, based on the supplied diff and proof: guards before cancellable startup work and before listener creation are the narrowest way to ensure shutdown wins without adding lifecycle state or public surface. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against f98bcb7fa73c. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +12, Tests +129. Total +141 across 3 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 (14 earlier review cycles; latest 8 shown)
|
cd5467c to
ffe5ebc
Compare
|
@clawsweeper re-review Head a4be8e9450 adds a committed regression test for abort arriving while startup resolution is still pending. Focused ZaloUser lifecycle coverage is 25/25 passing, openclaw/ci-gate is green, and the Real behavior proof check is green. The PR body now states the evidence boundary explicitly; no configured ZaloUser account is available here, so please reassess the committed production-function boundary proof or leave the maintainer acceptance request as the only remaining action. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@steipete all CI and the Real behavior proof check are green on a4be8e9450, and ClawSweeper reports no remaining code repair. This environment has no configured ZaloUser account, so the only remaining gate is either a live account run or explicit maintainer acceptance of the production-monitor boundary proof. If that evidence bar is acceptable for this narrowly scoped lifecycle fix, please record acceptance and merge when convenient. |
|
@clawsweeper re-review Final head: New evidence since the prior review:
The PR body contains the full commands, result matrix, and the explicit remaining live-account limitation. Please assess the final source and this gateway-boundary A/B evidence rather than the earlier monitor-only proof. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review A real Zalo personal account was configured on final head |
When the gateway stop AbortSignal is already aborted at construction
time, the addEventListener('abort', onAbort) listener never fires per
the AbortSignal spec. This leaves waitForExit pending forever, hanging
channel shutdown. The fix resolves onAbort immediately when
abortSignal.aborted is already true, matching the pre-aborted handling
pattern in WhatsApp connection-controller (openclaw#109903) and QQBot
gateway-connection (openclaw#109896).
Co-Authored-By: Claude <[email protected]>
…ady fired When the gateway stop AbortSignal is already aborted at construction time, return immediately after settling waitForExit instead of falling through to startZaloListener which restores the Zalo API session and resolves the user. An already-aborted shutdown should not perform asynchronous session startup or allocate listener resources. Also add a focused regression test that asserts startZaloListener is not called for a pre-aborted signal and the monitor resolves promptly with a stop handle. Co-Authored-By: Claude <[email protected]>
Move the abort-signal lifecycle guard before the account-resolution preflight (allowlist name resolution, Zalo friends/groups API calls) so an already-aborted shutdown does not perform Zalo API calls or session restoration in startZaloListener. Previously the abort check sat after the preflight block, which could make blocking Zalo API calls (listZaloFriends, listZaloGroups) during a shutdown that was already requested. Co-Authored-By: Claude <[email protected]>
If the abort signal fires during async preflight work (listZaloFriends, listZaloGroups), the abort handler settles waitForExit but execution resumes after the preflight and can still reach startZaloListener during an already-requested shutdown. Add a post-preflight recheck of stopped and abortSignal.aborted to prevent listener startup after abort. Co-Authored-By: Claude <[email protected]>
…guard The helper pre-aborted the signal to skip listener startup while still running the friends/groups resolution in the try block. With the new pre-try-block abort guard the function returns before the try block, so no resolution occurs. Fix: defer the abort into startZaloListenerMock so resolution runs first and the signal is aborted inside the listener, which triggers the post-startZaloListener abortSignal.aborted check (line 961) to settle waitForExit cleanly. Co-Authored-By: Claude <[email protected]>
6b1c1d2 to
e49cbc2
Compare
What Problem This Solves
Fixes an issue where stopping a ZaloUser gateway account during or immediately after connection startup could leave channel shutdown waiting forever. The race occurs when the gateway stop signal is already aborted before the monitor registers its listener, or becomes aborted while startup allowlist/group resolution is in progress.
Why This Change Was Made
AbortSignaldoes not replay anabortevent to listeners registered after the signal has fired. The monitor now checks for shutdown before asynchronous startup work and rechecks after that work before creating the Zalo listener. The existing listener lifecycle remains local to listener startup; no extra lifecycle state is introduced.The fix stays inside the ZaloUser plugin and adds no config, protocol, SDK, dependency, or compatibility surface.
User Impact
ZaloUser stop and restart operations now settle promptly instead of hanging during fast gateway restarts or overlapping account lifecycle transitions. An aborted startup also cannot restore a Zalo listener session.
Evidence
The dedicated lifecycle suite follows the production gateway boundary (
zalouserPlugin.gateway.startAccount->monitorZalouserProvider) and mocks only the outer Zalo SDK/network boundary. It proves:stopexactly once and settles;startZaloListener;Same-test A/B result:
origin/main@347ee45895startZaloListenerafter mid-preflight abort; callslistZaloFriendsafter pre-aborte49cbc2f2cFocused validation on PR head:
pnpm formatandgit diff --checkpass. The local changed-check could not acquire Blacksmith because theblacksmithexecutable is unavailable; the pushed head's standard GitHub lint/type/build gates are the authoritative replacement.Live configured-account proof
Run on the code-equivalent pre-refresh head
6b1c1d291ewith a real Zalo personal account and an isolatedpr109988-proofprofile. The harness used the production gateway, monitor, listener, credential-state migration, andzca-jsnetwork path; it did not mock the Zalo SDK or network. Direct and group inbound policies were disabled, and no messages were sent.During
LIVE_1_ACTIVE, the operating system reported twoEstablishedTCP connections owned by the proof process to Zalo endpoints on remote port 443. After the already-aborted invocation returned, the first live start succeeded immediately; if that invocation had retained a listener for the profile, productionstartZaloListenerwould have rejected it as already running. Both real listener cycles stayed pending while active, settled after abort, and the second start proves the first stop released the listener for restart.This live result closes the previously stated configured-account boundary gap. The branch was subsequently replayed without conflicts onto
origin/main@347ee45895as heade49cbc2f2c; the resulting PR diff remains the same three files (+142/-1). The committed same-test A/B was rerun against that current main (1/3) and refreshed head (3/3). The configured-account run proves the unchanged fix over the real credential and Zalo network boundary.