Skip to content

fix(chat): render progress attachments inline - #148795

Merged
steipete merged 2 commits into
mainfrom
codex/fix-inline-commentary-images
Sep 15, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/fix-inline-commentary-images

Conversation

@steipete

@steipete steipete commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: screenshots appear as generic FILE cards when an assistant includes an extensionless image URL in a progress message.

User Impact

New progress attachments render inline while work continues and survive final delivery and history reloads. Previously saved raw links are not backfilled; reattach those files to materialize their previews. No configuration or schema migration is required.

Why This Change Was Made

Progress messages bypassed managed media preparation, leaving the UI to guess file types from URLs. The webchat delivery owner now prepares authored commentary media through the existing MIME-detecting media pipeline. It preserves the original model text and keeps progress attachments separate from final attachments, including when both phases share a message. Preparation joins transcript teardown, cancels unfinished downloads when the run stops, and revalidates the current run and exact active row before persistence. Plain unkeyed commentary stays hidden unless its own group contains prepared media.

Evidence

  • 553 focused Gateway and media-store tests passed, including both previously failing CI suites. Coverage includes mixed phases, PDFs, hook-added references, cancellation, teardown, concurrent rewrites, group-local commentary visibility, and caption limits. The unfinished-response cancellation regression failed before the repair, then verified closed I/O, settled dispatch, and no stale display rewrite, file, or attachment record.
  • node scripts/check-changed.mjs, pnpm build, and git diff --check passed.
  • Independent Codex review is scoped-clean through P2.
  • Synthetic browser proof renders actual prepared history through mocked Gateway transport under the production image policy: one decoded 640×360 image, no FILE card, and the run remains active. The problem was also reproduced in the signed-in Control UI.
  • Exact-head CI passed on bffd3d48ea0. An unchanged Windows checkout-supervisor fixture failed once; its targeted same-head rerun passed all 19 Windows test groups. No source or assertions were changed for the rerun; the original failure remains recorded for CI-owner follow-up.

Before

Before: an extensionless image appears as a FILE card

After

After: the same image renders inline

Process authored commentary attachments through managed media and preserve them during finalization and history projection. Keep raw model content intact and revalidate the current run and exact transcript row through asynchronous media preparation. Cover mixed phases, teardown, cancellation, concurrent rewrites, documents, and caption limits.
@clawsweeper

clawsweeper Bot commented Sep 15, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Sep 15, 2026
@steipete
steipete marked this pull request as ready for review September 15, 2026 05:20
@steipete steipete self-assigned this Sep 15, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 15, 2026
@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 2:08 AM ET / 06:08 UTC (Revision 2).

ClawSweeper review

What this changes

The Gateway prepares assistant progress attachments for inline display, preserves them through final replies and history reloads, and cancels unfinished downloads when the run stops.

Merge readiness

✅ Ready for maintainer review

This remains a useful fix absent from the inspected main implementation. The previous cancellation blocker is resolved, and this review found no new blocking defect.

Priority: P2
Reviewed head: bffd3d48ea0a85bc0dca5dcbd1d42c59add0eb8b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, coherent repair with inspected visual evidence and targeted lifecycle coverage; the previous blocker is resolved.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots show prepared progress history changing from a FILE card to an inline image in Control UI. The reported real-HTTP cancellation regression exercises the production dispatcher and ingestion path, observes response closure and cleanup, and addresses the prior proof request; source inspection confirms its assertions and signal propagation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after screenshots show prepared progress history changing from a FILE card to an inline image in Control UI. The reported real-HTTP cancellation regression exercises the production dispatcher and ingestion path, observes response closure and cleanup, and addresses the prior proof request; source inspection confirms its assertions and signal propagation.
Evidence reviewed 9 items Current main still lacks progress-media preparation: The inspected main dispatcher prepares transcript metadata and finalizes delivered reply media, but does not install the new commentary-media observer.
Latest release comparison: The v2026.9.4 dispatcher likewise contains final-media finalization without the commentary observer. The release file was read through GitHub after its local blob was unavailable.
Previous cancellation finding addressed: The current head passes the active run signal through managed media into remote ingestion. The added aborted-response scenario keeps the second HTTP response unfinished, aborts the run, and asserts response closure, settled cleanup, no display rewrite, and no remaining attachment files or records. The author reports that this regression failed before the repair and passed afterward; this review did not execute tests.
Findings None None.
Security None None.

How this fits together

The Gateway turns assistant transcript events into messages displayed in Control UI chat. Its managed-media pipeline validates attachments, stores them, and supplies authenticated previews while preserving the original model text.

flowchart TD
  A[Assistant progress message] --> B[Authored attachment references]
  B --> C[Current run and session checks]
  C --> D[Managed media preparation]
  D --> E[Guarded transcript display update]
  E --> F[Inline preview and history reload]
  G[Run cancellation] --> D
  D --> H[Cleanup unfinished attachments]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +434, Tests +682, Docs +2, Other 0. Total +1118 across 17 files.

View PR surface stats
Area Files Added Removed Net
Source 11 557 123 +434
Tests 4 684 2 +682
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 17 1244 126 +1118

Review metrics

Metric Value Why it matters
Production versus test growth Production net +434 lines; tests net +682 lines Production growth implements lifecycle-owned progress preparation and display preservation; regression coverage exercises cancellation, mixed phases, visibility, and concurrent rewrites.

Technical review

Best possible solution:

Keep progress and final attachments on the existing managed-media pipeline, with cancellable preparation, guarded display updates, and unchanged model transcript bytes.

Do we have a high-confidence way to reproduce the issue?

Yes, source inspection identifies the path: an extensionless image reference in assistant commentary bypasses managed preparation on main. The supplied before image corroborates the symptom; this read-only review did not execute a reproduction.

Is this the best way to solve the issue?

Yes. Extending the existing media and transcript owners avoids filename guessing in clients and preserves the established attachment policy and storage format.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against acd9c2702d71.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after screenshots show prepared progress history changing from a FILE card to an inline image in Control UI. The reported real-HTTP cancellation regression exercises the production dispatcher and ingestion path, observes response closure and cleanup, and addresses the prior proof request; source inspection confirms its assertions and signal propagation.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 availability: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Repairs a bounded chat attachment-rendering defect without evidence of an urgent core outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after screenshots show prepared progress history changing from a FILE card to an inline image in Control UI. The reported real-HTTP cancellation regression exercises the production dispatcher and ingestion path, observes response closure and cleanup, and addresses the prior proof request; source inspection confirms its assertions and signal propagation.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after screenshots show prepared progress history changing from a FILE card to an inline image in Control UI. The reported real-HTTP cancellation regression exercises the production dispatcher and ingestion path, observes response closure and cleanup, and addresses the prior proof request; source inspection confirms its assertions and signal propagation.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after screenshots show prepared progress history changing from a FILE card to an inline image in Control UI. The reported real-HTTP cancellation regression exercises the production dispatcher and ingestion path, observes response closure and cleanup, and addresses the prior proof request; source inspection confirms its assertions and signal propagation.

Evidence

What I checked:

  • Current main still lacks progress-media preparation: The inspected main dispatcher prepares transcript metadata and finalizes delivered reply media, but does not install the new commentary-media observer. (src/gateway/server-methods/chat-send-reply-dispatch.ts:487, acd9c2702d71)
  • Latest release comparison: The v2026.9.4 dispatcher likewise contains final-media finalization without the commentary observer. The release file was read through GitHub after its local blob was unavailable. (src/gateway/server-methods/chat-send-reply-dispatch.ts:471, 3a9d69db306c)
  • Previous cancellation finding addressed: The current head passes the active run signal through managed media into remote ingestion. The added aborted-response scenario keeps the second HTTP response unfinished, aborts the run, and asserts response closure, settled cleanup, no display rewrite, and no remaining attachment files or records. The author reports that this regression failed before the repair and passed afterward; this review did not execute tests. (src/gateway/server-methods/chat-send-commentary-media.test.ts:473, bffd3d48ea0a)
  • Authority and transcript preservation: Preparation captures the original writer assertion, checks run and session lifecycle after awaited work, and rechecks the exact row and original content inside the rewrite callback. Failed attachment preparation removes unused managed media; successful preparation changes the existing display field while retaining model content. (src/gateway/server-methods/chat-send-commentary-media.ts:108, bffd3d48ea0a)
  • Inspected visual proof: Inspected both locally prepared PR images. The before image shows an extensionless attachment as a FILE card; the after image shows the synthetic image inline between the same captions and above the tool activity. The captured PR body identifies this as actual prepared history rendered through mocked Gateway transport and reports a decoded 640×360 image while the run remains active. These images establish visible rendering, not independent authentication or network-policy proof. (bffd3d48ea0a)
  • Adjacent commentary work: fix(chat): keep inter-tool commentary visible once across live stream and reload #141143 remains open and addresses client reconciliation of commentary segments sharing a transcript identity; it does not replace attachment ingestion and MIME detection.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • NianJiuZst: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-15T05:30:24.240Z sha eaf1e99 :: blocked before merge. :: [P2] Propagate cancellation into pending progress-media downloads

Cancel unfinished progress downloads with the active run and await artifact cleanup. Keep plain unkeyed commentary hidden unless its own group contains media, and preserve transcript-event readers in the directive test fixture.
@steipete

Copy link
Copy Markdown
Contributor Author

Fixed the cancellation finding in bffd3d4. The active run's abort signal now reaches the existing remote-ingestion owner and interrupts the response body; teardown still awaits cleanup. The regression leaves the second HTTP response open, aborts the run, and verifies that the response closes, dispatch settles, and no display rewrite, file, or attachment record remains. It failed before the fix and passes afterward.

The same commit restores suppression of plain unkeyed commentary, keeps media visibility scoped to its own group, and repairs the incomplete transcript-events mock found by CI. All 553 selected tests, the full build, and changed-file checks passed. Independent Codex review is clean through P2. Inspected screenshots and proof remain in the PR body; fresh exact-head CI is pending.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 15, 2026
@steipete
steipete merged commit 1be9b80 into main Sep 15, 2026
345 of 348 checks passed
@steipete
steipete deleted the codex/fix-inline-commentary-images branch September 15, 2026 06:56
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 16, 2026
* fix(chat): render progress attachments inline

Process authored commentary attachments through managed media and preserve them during finalization and history projection. Keep raw model content intact and revalidate the current run and exact transcript row through asynchronous media preparation. Cover mixed phases, teardown, cancellation, concurrent rewrites, documents, and caption limits.

* fix(chat): preserve progress media lifecycle and visibility

Cancel unfinished progress downloads with the active run and await artifact cleanup. Keep plain unkeyed commentary hidden unless its own group contains media, and preserve transcript-event readers in the directive test fixture.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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