fix(discord): bind delayed identify to socket generation#82225
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. for the source-level race: current main can wait in Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the socket-source guard after maintainer review and either live Discord proof or an explicit proof override, while leaving broader READY/1006 tracking on the linked reports. Do we have a high-confidence way to reproduce the issue? Yes for the source-level race: current main can wait in Is this the best way to solve the issue? Yes for the narrow race: carrying the HELLO source socket into delayed IDENTIFY is the smallest maintainable fix I found. It should not be treated as a complete fix for the broader Discord READY/1006 reports without live proof. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 16e5d6692dcc. |
OpenClaw QA ArtifactsSummaryDiscord gateway IDENTIFY socket-generation proof for PR #82225.
Evidence
|
1e5ed86 to
3aa359d
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3aa359d to
e283c8a
Compare

Summary
HELLOthrough gateway payload handling.IDENTIFYwhen that same socket is still the current open gateway socket.HELLO.Real behavior proof
origin/main) and the PR branch.origin/main, copied the PR regression spec into it, rannode scripts/test-projects.mjs extensions/discord/src/internal/gateway.test.ts, then ran the same command on PR branch348310af0b.origin/mainplus the regression spec) failed because the replacement socket received an IDENTIFY payload from stale HELLO work; after (348310af0b) passed all 21 focused gateway tests and only IDENTIFYs the replacement socket after its own HELLO.v2026.5.7-beta.1is still queued, so this PR remains scoped to the source-level stale HELLO/IDENTIFY race.does not identify a replacement socket from a stale HELLOfailing onorigin/mainwithReceived: "{\"op\":2...}sent by the replacement socket.Validation
COREPACK_ENABLE_DOWNLOAD_PROMPT=0 pnpm test extensions/discord/src/internal/gateway.test.tsCOREPACK_ENABLE_DOWNLOAD_PROMPT=0 pnpm exec oxfmt --check --threads=1 extensions/discord/src/internal/gateway.ts extensions/discord/src/internal/gateway.test.tsCOREPACK_ENABLE_DOWNLOAD_PROMPT=0 pnpm check:changedRelated to #79794, #78910, and duplicate/satellite #80873. This addresses a source-level stale HELLO/IDENTIFY race without claiming the broader field reports are fully closed.