Skip to content

fix: managed media E2E races streaming retirement - #175638

Merged
steipete merged 2 commits into
mainfrom
solid2/hf-media-order-390409
Oct 18, 2026
Merged

steipete merged 2 commits into
mainfrom
solid2/hf-media-order-390409

Conversation

@steipete

@steipete steipete commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

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.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T19:37:53.260989Z 1dace16 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete enabled auto-merge (squash) October 17, 2026 15:25
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 17, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.”

  • Before: The strict paragraph locator fails before streaming retirement completes.
  • After: The test waits for generation to settle, then requires one paragraph, one assistant bubble, and two correctly ordered images.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is narrow and source-supported; harness results support it, but intermittent failure reproduction remains limited.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only PR is outside the contributor proof gate; reported real-Gateway runs exercise the changed test, while the inspected screenshots cover a different repair.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: The managed-media regression test can fail during an allowed overlap between a durable reply and its live copy.
Reason: The maintainer-authored change repairs test synchronization while preserving the original product contract and adding no runtime machinery.

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
Reviewed head: 29570a721b8a544c4b22f25ae2d05a10aaed7189

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The original failure is recorded in CI, but both reported local baseline and repaired runs passed, so deterministic before/after reproduction is not established.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Managed-media E2E paragraph uniqueness keeps the original intent (8c3cd75: The original media-order repair added browser, history, and reload assertions to keep images beside their authored headings.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 514fe3d adds ui/src/e2e/chat-managed-media-order.real-gateway.e2e.test.ts:177 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 514fe3d17f03; files: ui/src/e2e/chat-managed-media-order.real-gateway.e2e.test.ts)

PR surface

Tests +2. Total +2 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 3 1 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 3 1 +2

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a focused E2E reliability repair with no production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 17, 2026, 11:48 AM ET / 15:48 UTC.

@steipete
steipete disabled auto-merge October 18, 2026 19:33
@steipete
steipete merged commit d0dcce3 into main Oct 18, 2026
98 of 105 checks passed
@steipete
steipete deleted the solid2/hf-media-order-390409 branch October 18, 2026 19:56
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant