Repository navigation
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 11, 2026, 11:18 PM ET / July 12, 2026, 03:18 UTC. Summary PR surface: Source +3, Tests +78. Total +81 across 4 files. Reproducibility: yes. The current-main source path, linked issue, and focused tests provide a high-confidence deterministic reproduction of ownership loss after a transient preview DELETE failure. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Next step before merge
Security Review detailsBest possible solution: Merge the focused shared ownership fix and bounded Discord teardown retry after a redacted real Discord run demonstrates that a transient preview DELETE failure is followed by successful cleanup. Do we have a high-confidence way to reproduce the issue? Yes. The current-main source path, linked issue, and focused tests provide a high-confidence deterministic reproduction of ownership loss after a transient preview DELETE failure. Is this the best way to solve the issue? Yes. The current head repairs ownership at the shared lifecycle boundary and adds exactly one Discord teardown retry without introducing duplicate final delivery, timers, configuration, or a parallel cleanup mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d0764f356603. Label changesLabel justifications:
Evidence reviewedPR surface: Source +3, Tests +78. Total +81 across 4 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 (1 earlier review cycle)
|
179c301 to
e6ebf38
Compare
e6ebf38 to
907fdea
Compare
|
Closing as a duplicate of #104893 for #104865. Both branches implement the same delete-then-compare-clear ownership rule and the same single Discord teardown retry, but #104893 was opened first, is assigned for maintainer follow-through, uses the repository’s shared deferred-test helper, and includes focused cross-channel coverage plus live Discord fault-injection proof. This branch has no distinct runtime behavior to preserve. The underlying issue remains open on the canonical PR. Thanks for the careful concurrency coverage. |
Fixes #104865
What Problem This Solves
Fixes a Discord partial-streaming cleanup regression where a fresh final reply can land while the old preview remains visible after a transient preview DELETE failure. The old implementation also cleared preview ownership too early, so a later cleanup could not retry the same message.
Why This Change Was Made
The shared finalizable draft cleanup now keeps ownership until DELETE succeeds, then clears the stored id only if that same id is still current. That preserves retryability and avoids erasing a replacement preview that was created while the old DELETE was in flight.
Discord teardown now performs the missing bounded cleanup retry for an unfinalized preview even after a fresh final reply was delivered. It still protects previews finalized in place, and it does not add timers, retry loops, configuration, or extra final-message delivery.
User Impact
Discord users with partial/progress preview streaming should no longer get stuck with an unrecoverable stale preview beside the final answer after a transient DELETE failure. Shared cleanup users such as Mattermost inherit the safer delete-then-compare-clear ownership behavior.
Evidence
node scripts/run-vitest.mjs src/channels/draft-stream-controls.test.ts -t "keeps failed deletes available for retry"(passed)node scripts/run-vitest.mjs src/channels/draft-stream-controls.test.ts -t "preserves a replacement id while delete is in flight"(passed)node scripts/run-vitest.mjs extensions/discord/src/monitor/message-handler.process.test.ts -t "retries stale preview cleanup at teardown after fresh final delivery"(passed)pnpm exec oxfmt --check --threads=1 src/channels/draft-stream-controls.ts src/channels/draft-stream-controls.test.ts extensions/discord/src/monitor/message-handler.draft-preview.ts extensions/discord/src/monitor/message-handler.process.test.ts(passed)git diff --check(passed)python .agents/skills/autoreview/scripts/autoreview --mode local --engine codex --model gpt-5.5(clean: no accepted/actionable findings)Remote proof note: this local machine does not have a usable Crabbox binary or sibling Crabbox checkout, so Testbox-backed
check:changedcould not be started here. A direct localpnpm check:test-typesalso did not complete in this Windows worktree after several minutes with no stage output; the pushed heade6ebf380a61418017148273fa51853d71e96b609is now relying on GitHub CI for the broad type/check matrix.