Skip to content

fix(ui): keep loaded chat images visible during gateway outages - #136446

Merged
steipete merged 1 commit into
mainfrom
codex/fix-image-renewal-continuity
Sep 2, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-image-renewal-continuity

Conversation

@steipete

@steipete steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Related: #136072

What Problem This Solves

Fixes an issue where users viewing uploaded or local chat images would see an already-loaded image replaced by “Attachment unavailable” when the Gateway stayed offline or media-ticket renewal failed. The initial send/history continuity repair did not cover this later lifecycle: a longer live test reproduced the reported unavailable cards on current main.

Why This Change Was Made

The metadata owner treated an unconfirmed renewal failure like an explicit missing/denied result, and the image renderer discarded its loaded element. Media tickets authorize future reads; their renewal is not a lease on pixels already decoded by that mounted image.

Record unconfirmed outcomes at the metadata owner and let the existing image presenter retain only its own loaded element. Explicit missing/denied responses, source/auth/access-scope changes, and decode failures still clear it; expired tickets remain unavailable to fresh reads. Ignore late load events from removed images so Retry cannot resurrect a denied preview. Preserve subscriptions when the parent callback changes instead of dropping the resource.

Parsed local raster attachments now use that same presenter, retaining their Retry action. This removes duplicate availability publishing and image classification paths. SVG, audio/video/documents, and explicit managed-artifact transport keep their existing owners. No dependency, configuration, persistence, protocol, or ticket-lifetime change.

User Impact

Already-loaded images remain visible through temporary metadata/network failures and ticket expiry within the same mounted access scope. Duplicate attachments remain distinct and recover normally after reconnect/reload. The existing access-scope reset on disconnect can still briefly remount images; this is not a claim of zero flicker across connection or authorization changes.

Evidence

  • Unmodified main (ad3268ecccbc7758878662b31adcd72475343d3e) reproduced the failure in real Chrome with an isolated, normally authenticated Gateway and a real image prompt/reply. It also failed canonical/inline-handoff and parsed-local-raster regressions. A strengthened late-load-only denial test failed before the removed-element guard.
  • Final focused/sibling suite: 334 passed across 5 files; check:changed passed, including UI/core-test types, formatting, lint, i18n, and dead exports. Independent Codex review: no actionable P0–P2 findings. A test fixture type error was corrected to use native Responses, then the final suite and checks were rerun successfully.
  • Stress: 10 × 334 unit executions plus 2 × 3 browser executions = 3,346 passing executions. These are repeated runs, not 3,346 distinct tests. The stress runs preceded that test-only fixture correction; production bytes were unchanged.
  • After-build live proof: four synthetic images, including duplicate uploads, and a real three-image reply. Verified all 400 served JS/CSS assets against the candidate build. After the initial connection-scope remount, 48,668 consecutive frame samples over 423.315 seconds retained the same four decoded images with unchanged positive geometry. All four image regions were also pixel-identical in online/offline endpoint captures. Reconnection, persisted media history, and full reload passed.
  • Measurement limits: two early after-run samples showed checking cards during the existing scope reset; frame sampling is not continuous paint proof. The before recording had a 20.447-second recorder gap, followed by 101.162 seconds of consecutive missing-image samples. Neither gap is hidden in the comparison.
Before: prolonged outage After: prolonged outage, four images
Before: loaded image replaced by an unavailable card After: four already-loaded synthetic images remain visible offline

Production delta: +116/−98, net +18; tests +193/−77, net +116; docs +2. The growth preserves the explicit unconfirmed-vs-denied state, mounted-element fencing, and existing Retry behavior while consolidating the raster path. Combined with the original repair’s −24 production lines, this request remains net −6 production lines.

Named follow-up: consolidate the explicit managed-raster attachment path only after proving full-ticket/error/Retry parity. Standard generated images already use the blob-gallery owner; this PR does not claim to repair every managed-artifact lifecycle. The earlier short-duration live proof was valid for send/handoff/reload but insufficient for a prolonged renewal outage.

Separate unconfirmed metadata failures from explicit missing or denied media. Let the mounted image retain its decoded pixels without extending read authorization, and route parsed raster attachments through the same image owner.

Preserve retry, source/auth/epoch fences, and ignore load events from removed images. Related to #136072; adds prolonged-outage, late-load, and sibling attachment regressions.
@steipete steipete self-assigned this Sep 2, 2026
@steipete
steipete marked this pull request as ready for review September 2, 2026 16:52
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. labels Sep 2, 2026
@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 2:11 PM ET / 18:11 UTC.

ClawSweeper review

What this changes

The PR preserves already decoded Control UI chat images through temporary media-metadata failures while clearing previews for definitive denial or source-scope changes.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: fetched main still converts an expired or failed local-media renewal into an unavailable card, while this PR adds the missing temporary-failure distinction and keeps only the mounted image visible. Direct review found no blocking patch defect; exact-head CI must complete successfully before merge.

Priority: P2
Reviewed head: 4253e815ed956d5a24c60863bc3fcfc78a9ffc1a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has coherent owner-boundary handling and focused regression coverage; only the normal exact-head CI landing gate remains.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored PR is exempt from the external-contributor proof gate; the supplied real Control UI before/after evidence remains supporting context, while direct media retrieval was unavailable in this reviewer environment.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored PR is exempt from the external-contributor proof gate; the supplied real Control UI before/after evidence remains supporting context, while direct media retrieval was unavailable in this reviewer environment.
Evidence reviewed 6 items Current-main gap: Fetched main marks an expired media ticket unavailable without an unconfirmed state, which is the state this PR distinguishes for retention.
Branch owner boundary: The metadata owner classifies transport, malformed metadata, and server-unavailable results as unconfirmed, while preserving explicit available:false responses as definitive availability results.
Mounted-image fence: The canonical image directive retains the current element only for checking or unconfirmed states; definitive unavailable results clear it and may expose the existing retry path.
Findings None None.
Security None None.

How this fits together

Control UI obtains short-lived, source-scoped media tickets from the Gateway before native browser images load them in the chat transcript. The change lets a mounted image retain already decoded pixels during an unconfirmed renewal failure without granting another media read.

flowchart LR
  A[Chat attachment] --> B[Metadata availability]
  B --> C{Renewal result}
  C -->|Available| D[Ticketed image URL]
  C -->|Temporary failure| E[Retain mounted pixels]
  C -->|Denied or missing| F[Unavailable card]
  D --> G[Chat transcript]
  E --> G
Loading

Before merge

  • Resolve merge risk (P1) - Production code is net +18 lines; the explicit unconfirmed state, mounted-element fence, and shared raster presenter are the documented rationale, but the exact-head CI gate remains unresolved.
  • Complete next step (P2) - Obtain a successful exact-head required-CI aggregate before merge.
Agent review details

Security

None.

PR surface

Source +18, Tests +116, Docs +2. Total +136 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 116 98 +18
Tests 2 193 77 +116
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 311 175 +136

Review metrics

Metric Value Why it matters
Production vs test LOC production +116/-98 (net +18); tests +193/-77 (net +116); docs +2 The positive production delta is localized to explicit uncertainty state and renderer fencing; the accompanying tests cover the retained, denied, retry, and late-event boundaries.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the owner-boundary distinction after a successful exact-head CI run, retaining decoded pixels only for unconfirmed renewal failures and preserving definitive denial, retry, source, auth, and connection-scope fences.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the owner-boundary distinction after a successful exact-head CI run, retaining decoded pixels only for unconfirmed renewal failures and preserving definitive denial, retry, source, auth, and connection-scope fences.

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

Yes, from source: fetched main turns an expired ticket into unavailable and the renderer replaces nonavailable media with a status card; this branch preserves a loaded element only for unconfirmed renewal states.

Is this the best way to solve the issue?

Yes: recording uncertainty at the metadata owner and consuming it in the existing canonical image presenter avoids duplicate render paths and does not extend ticket authorization or add a compatibility surface.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1212f991db46.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦞 diamond lobster.
  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is not_applicable.

Label justifications:

  • P2: This repairs a bounded Control UI image-continuity regression without changing configuration, persistence, or Gateway protocol.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored PR is exempt from the external-contributor proof gate; the supplied real Control UI before/after evidence remains supporting context, while direct media retrieval was unavailable in this reviewer environment.

Evidence

What I checked:

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Obtain a successful exact-head required-CI aggregate before merge.

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 (2 earlier review cycles)
  • reviewed 2026-09-02T17:01:19.903Z sha 4253e81 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T17:37:12.734Z sha 4253e81 :: needs maintainer review before merge. :: none

@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Addressing both pre-merge points in the latest ClawSweeper review:

Production +18: accepted with the owner-boundary rationale. The absorbing refactor is included: parsed rasters share the canonical image presenter, metadata results publish once, and duplicate classification plus an unreachable refresh branch are removed. The remaining growth records unconfirmed versus definitive outcomes, fences removed-element load events, and preserves the existing Retry action when consolidating callers. Removing those distinctions breaks the reproduced retention/denial/Retry contracts. No simpler net-neutral refactor was found that preserves these behaviors. This follow-up is explicitly +18; the related original repair was −24, not a reason to hide this PR's delta.

Screenshot retrieval: verified from the maintainer environment. Both published image URLs returned HTTP 200 at 2026-09-02 17:09 UTC and match the original inspected captures byte-for-byte. SHA-256:

  • Before: 999dfe8ceaba90f1020db3a22e87cd1031776fe7adab515197d860022c4fcace
  • After: 9b943a82f320391464535054ad675ae7f56715ddd7999ea88bd32641be501aa3

The full synthetic before/after captures were inspected, along with reconnect/reload captures and raw frame/test records. The review environment's DNS failure is an independent-fetch limitation, not missing or replaced proof. The reported brief disconnect remount and sampling limits still apply.

No code changed after the reviewed head 4253e815ed956d5a24c60863bc3fcfc78a9ffc1a. Exact-head hosted CI remains a required landing gate and is currently waiting for a GitHub-hosted runner.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Sep 2, 2026
@steipete

steipete commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor Author

CI resolved: normal PR run 33663432654, attempt 2 completed successfully on the unchanged reviewed head 4253e815ed956d5a24c60863bc3fcfc78a9ffc1a. All five selected replays passed on assigned GitHub-hosted runners: security, docs, bundled-protocol, guards, and Control UI browser shard 5/14. The required openclaw/ci-gate passed at 19:05:34 UTC. No selected replay or required work step was waived or skipped. GitHub now reports the PR as clean and mergeable.

The fresh 18:11 UTC ClawSweeper review has no patch or security findings. Its remaining exact-head CI requirement is now satisfied; the previously recorded +18 production-line ownership rationale and independently verified before/after media evidence are unchanged. The source commit, local regression/stress results, and live outage proof have not changed.

Three attempt-1 failures were public Git-fetch failures, not test assertions: bundled-protocol passed all 210 bundled tests, then failed fetching its baseline; guards failed its later baseline fetch; docs exhausted the existing five ClawHub checkout attempts. All reported an HTTPS username/ref-listing error. Clean anonymous local probes of the public repositories succeeded, but that does not prove runner recovery or establish the precise cause. Checkout credentials intentionally end before test execution. Named CI follow-up: prepare required baseline history through the existing checkout owner before credentials end, retaining the full downstream checks; do not persist or lend those credentials to unrelated checkouts.

The fourth attempt-1 failure was the scroll-disclosure browser case: one wheel-interruption assertion observed scrollTop=64 instead of zero. Its fixture is text-only and fails before the held recovered text is delivered, not in the changed image renderer. At diagnosis, the test, scrolling owner, virtualizer host, and CSS were unchanged between the patch base, reviewed head, and then-fetched main. The exact CI artifact was inspected: connected mock Gateway, no page errors, but no scroll-write timeline. One unchanged full-file replay passed all eight cases in 33.33s, including zero interruption offset and correct recovered geometry. The earlier same-head run also passed this shard. Named follow-up: transcript wheel takeover can leave a nonzero offset during smooth-scroll cancellation. No assertion was loosened; the unchanged exact-head CI replay now passes this shard.

A selective failed-jobs retry was initially rejected with This workflow is already running. Once no jobs were executing and only security had remained queued beyond 21 minutes, that idle attempt was cancelled and confirmed terminal. Standard failed-jobs replay was then accepted at 18:11:56 UTC; root verified that security and all four failed jobs are included and the 100 successes retained. The required aggregate subsequently passed at 19:05:34 UTC. At diagnosis, main 1212f991db46ad4ffe8c11198c175a5736392a15 had the same CI workflow and pre-fix image-owner blobs, so a rebase was not a repair for those failures. No source, shared runner setting, coverage, or merge requirement has been changed for these CI operations.

CI refresh chronology
  • Run 33657557616 passed preflight/security after a long hosted-runner wait, then left its remaining jobs queued.
  • After the repository backend independently changed to hybrid, a normal draft/ready refresh produced run 33661405521. All three UI shards, all 14 browser shards, the real-Gateway lane, and build passed. Security-fast failed while initializing a public pre-commit hook, before the private-key hook ran; 27 generic hosted jobs remained queued.
  • The repository backend independently changed again to Blacksmith at 17:45 UTC. Refreshing normal PR CI on the same head lets the configured workflow evaluate that route. Security-fast and the final aggregate still use GitHub-hosted runners; no check is waived.
  • Run 33663275531 was cancelled before creating jobs while the overlapping draft event completed later. This is consistent with shared-concurrency event ordering, not a proven cancellation actor or a test failure. The next refresh waited for draft run 33663393209 to complete before marking ready, producing current run 33663432654.
  • The repository backend independently changed to GitHub at 18:09 UTC; the selective replay follows the current configured route. This task did not change that setting.
  • Separate CI follow-up from the earlier security failure: pre-commit constructs all configured hook repositories before filtering the requested hook, so the security-only invocation fetches unrelated public hook metadata.

@steipete
steipete marked this pull request as draft September 2, 2026 17:29
@steipete
steipete marked this pull request as ready for review September 2, 2026 17:29
@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 2, 2026
@steipete
steipete marked this pull request as draft September 2, 2026 17:47
@steipete
steipete marked this pull request as ready for review September 2, 2026 17:47
@steipete
steipete marked this pull request as draft September 2, 2026 17:48
@steipete
steipete marked this pull request as ready for review September 2, 2026 17:49
@steipete
steipete merged commit 4eef4e0 into main Sep 2, 2026
540 of 787 checks passed
@steipete
steipete deleted the codex/fix-image-renewal-continuity branch September 2, 2026 19:43
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
…w#136446)

Separate unconfirmed metadata failures from explicit missing or denied media. Let the mounted image retain its decoded pixels without extending read authorization, and route parsed raster attachments through the same image owner.

Preserve retry, source/auth/epoch fences, and ignore load events from removed images. Related to openclaw#136072; adds prolonged-outage, late-load, and sibling attachment regressions.
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 docs Improvements or additions to documentation 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: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: M 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