Repository navigation
fix: managed media E2E races streaming retirement - #175638
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR waits for generation to finish before checking that the managed-media reply has one closing paragraph. Example: The managed-media scenario briefly renders two copies of “Both cards stay between their heading and the next paragraph.”
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a documented test synchronization error while preserving the strict settled-output assertions. No introduced defect was found; required CI remains red. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe browser E2E sends a message through a real Gateway with synthetic inference, then verifies rendered media order, persisted history, and reload behavior. flowchart LR
A[Browser E2E] --> B[Gateway chat send]
B --> C[Synthetic inference endpoint]
C --> D[Live and durable reply]
D --> E[Generation settlement]
E --> F[Strict order and reload assertions]
Technical reviewBest possible solution: Keep the generation-settlement wait and all existing strict media-order, uniqueness, history, and reload checks. Do we have a high-confidence way to reproduce the issue? The original CI trace verifies the two-element strict-locator failure, and current main still checks uniqueness before settlement; no target code was executed during this review. Is this the best way to solve the issue? The minimal assertion reorder matches the documented live-text lifecycle without suppressing settled duplicates or weakening media-order coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 972ba247cabc. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +2. Total +2 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 17, 2026, 11:48 AM ET / 15:48 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
What Problem This Solves
Fixes the managed-image ordering E2E flake when a durable assistant reply briefly overlaps its streaming copy before the run finishes.
Related failure: https://github.com/openclaw/openclaw/actions/runs/39040959423/job/117420341364
Change
Wait for the answer to appear and generation to settle before requiring a unique closing paragraph. The test still requires exactly one settled assistant bubble, two correctly ordered images, matching persisted history, the same order after reload, one chat.send, and one primary provider request. There is no product change, timeout increase, or weaker settled assertion.
Validation
The original diagnostic replay observed two matching paragraphs before retirement and one after settlement. The original repaired scenario passed locally and in PR CI. The original full CI also failed unrelated theme-background and model-api-keys cases; neither case fails in scheduled main run 39154686674.
Refreshed with main at 1446ecc; PR head is 1dace16. The merge was conflict-free and the PR remains one test file, +3/-1. Fresh independent P2 review, scoped lint, formatting, and UI E2E chat types passed. The fresh local replay passed the live image/order checks and then failed at the unchanged persisted-image assertion. The retained Gateway log reports “webchat media finalization failed: Error: Chat media run is no longer current.” This matches the scheduled-main regression. Fresh exact-head CI failed only the two real-Gateway shards, with the same four cases as scheduled main; the old mock E2E failure cleared:
https://github.com/openclaw/openclaw/actions/runs/39159470248
Scheduled main run 39154686674 has a different failure in this same scenario: persisted history has no image blocks at line 550, after the live image and order checks pass. That does not match the duplicate preterminal paragraph race fixed here. The same main run fails speech replay, the Stop fixture's active-history qualification, and PowerPoint delivery. The Stop case is a separate fixture protocol defect tracked in #176361. Speech and PowerPoint both reproduced on current main with the same Gateway media-finalization error as managed images. The Gateway admission, dispatch-currentness, and finalization-guard files are byte-identical between the scheduled baseline and this PR head. No inherited-failure exception is claimed for the old PR CI run.
Inherited CI exception
The latest completed scheduled main run, 39158806323 (head c8e786c), also fails exactly these four cases: managed-image persisted blocks, speech replay after reload, Stop active-history qualification, and PowerPoint delivery. Both sets of failed job logs were fetched once and compared by exact file and case. The tested PR merge was 8e8985cae82b68dee7c9626217f9b18788fc1338, with main parent 1446ecc and PR parent 1dace16.
The Stop fixture repair landed separately as #176361 (af7c0d2) with green CI. The three media failures share the unchanged Gateway source-lifetime defect and remain assigned to the Gateway/session-controller owner. Native admin landing is requested only for these demonstrated inherited failures; this PR does not claim a green full scenario or fix the persistence regression.