Repository navigation
fix(ui): keep sent images visible during history handoff - #136072
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 5:33 AM ET / 09:33 UTC. ClawSweeper reviewWhat this changesThe PR preserves a sent Control UI image while its message moves from local submission through accepted-input custody to canonical history media. Merge readinessKeep this maintainer-labeled PR open: no blocking correctness or security defect was found, but the final exact-head check set is still incomplete. Priority: P2 Review scores
Verification
How this fits togetherControl UI chat first renders an uploaded image locally, then reconciles it with Gateway custody and the canonical transcript. The image renderer must retain visible pixels until authorized canonical media replaces them without overriding authoritative text or removals. flowchart LR
A[User uploads image] --> B[Local preview]
B --> C[Accepted input custody]
C --> D[Canonical transcript row]
D --> E[Media metadata]
E --> F[Authorized image bytes]
F --> G[Continuous image display]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -24, Tests +379, Docs +2. Total +357 across 15 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain renderer-local slot continuity and canonical transcript authority, then merge only after the final exact-head required checks pass. Do we have a high-confidence way to reproduce the issue? Yes. The added deterministic Chromium scenario drives an ordinary image send through paused custody, metadata, and byte-loading stages; this read-only review did not execute it. Is this the best way to solve the issue? Yes. Keeping presentation state in the image renderer while allowing the canonical transcript row to own text and media avoids the former content overwrite and a competing history cache. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d413210bc742. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
Preserve the row and image-slot identity from a local preview through accepted input custody and canonical transcript media loading. Keep the loaded image in its existing element while its authorized replacement loads. Remove the detached decode preloader and initial-prompt content overwrite; canonical text, media, replacements, and removals remain authoritative. Bind complete receipts by persisted attachment positions, including duplicate images and mixed inline/offloaded display order. Reject imported ownership changes and incomplete receipts instead of borrowing unrelated pixels. Verified with 593 focused and neighboring unit tests, 14 Chromium end-to-end tests, exact-pixel delayed-loading assertions, targeted lint/type/style gates, and a fresh Codex review. Production LOC is reduced by 24 lines.
Replace snapshot content-overwrite expectations with canonical text/media, sender attribution, and same-image continuity across memory and stored remounts, custody, and promotion. Use the current Gateway image-slot receipt in project creation browser tests and synchronize on media metadata loading instead of the retired custody row key. Validation: 7 snapshot tests, 19 Chromium E2E cases, changed-file checks, and fresh scoped Codex review passed. Production code is unchanged.
Keep the CLI PATH fixture on cwd's drive under the existing .artifacts scratch boundary. Use the canonical temp helper and retain every PATH and executable-owner assertion. Concurrent declaration snapshots no longer descend into a directory removed by this test's cleanup. The real snapshot walker reproduces the old ENOENT ordering and keeps identical signatures after the move. All 56 portable tests pass, with seven Windows-only cases left to hosted CI. Fresh P0-scoped Codex review passes. No production code or cache policy changes.
cfdb880 to
37fcb2e
Compare
Reuse the existing decoded-thumbnail helper for fixed-width image handoff checks after integrating the submitted-preview coverage from main. Preserve exact image width, DOM identity, pixels, and all existing preview assertions while removing 11 test lines. Verified 27 Chromium E2E cases, refreshed E2E type checking, every remaining changed-file lint and style gate, formatting, and fresh whole-candidate P0-scoped Codex review. Production code is unchanged.
|
Final verification is complete for 1e6e2dede0b6. The repair gives local submission, accepted custody, and canonical history one presentation flow. The loaded image stays mounted while authorized metadata and bytes arrive, without overriding canonical text or removals. The detached decoder and initial-only content rewrite are removed: production -24 lines, tests +379, docs +2. Exact-head CI attempt 2 and the required merge gate are successful. One unchanged failed-job retry cleared the extension selected-tab and dashboard-reload failures; their original observations and diagnostic gaps remain documented in the body, not represented as fixed. No assertion, timeout, or required gate was weakened. The candidate passed 600 owner/neighbor tests and 27 Chromium image/project/disclosure cases. Additional integration with main Native |
|
Merged via squash.
|
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.
…6072) * fix(ui): keep sent images visible during history handoff Preserve the row and image-slot identity from a local preview through accepted input custody and canonical transcript media loading. Keep the loaded image in its existing element while its authorized replacement loads. Remove the detached decode preloader and initial-prompt content overwrite; canonical text, media, replacements, and removals remain authoritative. Bind complete receipts by persisted attachment positions, including duplicate images and mixed inline/offloaded display order. Reject imported ownership changes and incomplete receipts instead of borrowing unrelated pixels. Verified with 593 focused and neighboring unit tests, 14 Chromium end-to-end tests, exact-pixel delayed-loading assertions, targeted lint/type/style gates, and a fresh Codex review. Production LOC is reduced by 24 lines. * test(ui): verify image handoff at the rendered boundary Replace snapshot content-overwrite expectations with canonical text/media, sender attribution, and same-image continuity across memory and stored remounts, custody, and promotion. Use the current Gateway image-slot receipt in project creation browser tests and synchronize on media metadata loading instead of the retired custody row key. Validation: 7 snapshot tests, 19 Chromium E2E cases, changed-file checks, and fresh scoped Codex review passed. Production code is unchanged. * test(ci): isolate same-drive Windows PATH fixtures Keep the CLI PATH fixture on cwd's drive under the existing .artifacts scratch boundary. Use the canonical temp helper and retain every PATH and executable-owner assertion. Concurrent declaration snapshots no longer descend into a directory removed by this test's cleanup. The real snapshot walker reproduces the old ENOENT ordering and keeps identical signatures after the move. All 56 portable tests pass, with seven Windows-only cases left to hosted CI. Fresh P0-scoped Codex review passes. No production code or cache policy changes. * test(ui): reuse decoded thumbnail readiness checks Reuse the existing decoded-thumbnail helper for fixed-width image handoff checks after integrating the submitted-preview coverage from main. Preserve exact image width, DOM identity, pixels, and all existing preview assertions while removing 11 test lines. Verified 27 Chromium E2E cases, refreshed E2E type checking, every remaining changed-file lint and style gate, formatting, and fresh whole-candidate P0-scoped Codex review. Production code is unchanged.
…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.
Related: #134310 (hard-refresh image hydration) and #124839 (sent-image history handoff).
Additional instructions
This branch is in the main repository and is editable by maintainers.
Current Landing Status
Final head
1e6e2dede0b6bd051acf90593894b9a031d3e8c1, based on inspected main3e94877fec4a, includes the conflict rebase and an 11-line test-helper simplification. The actual SDK conflict is resolved by dropping our superseded test commit and keeping main’s stronger repair; the message-bubble and initial-prompt auto-merges were inspected and tested. ClawSweeper’s latest review inspected this exact head at 09:33 UTC, found no actionable correctness or security issue, and requested final green exact-head CI. That gate is now satisfied, with no product, schema, or protocol expansion.Fresh local proof: 600 unit/boundary tests and 27 Chromium E2E cases pass on the rebased candidate; the unchanged native-wheel case and main’s pending-submit preview are included. Fresh whole-branch Codex review is P0 scoped-clean, not an all-priority audit. The broad structural/type/dead-export checks and final lint/style/format gates pass. Normal exact-head CI 33613603298 and its required merge gate are successful after one unchanged failed-job retry. Native
OPENCLAW_TESTBOX=1 scripts/pr prepare-run 136072passed on the same head and skipped an unnecessary push. Merged through the native wrapper at 10:06 UTC as 34fcc9cf3055. The canonical main checkout was fast-forwarded and verified clean with that commit present.New main compaction/history and lazy-stylesheet changes were separately inspected and tested without restarting PR CI. Combining main
40a01c9744c2with the exact PR head produced conflict-free merge treef070220c1354ec667c4f5868c09e661e844476e0. That isolated combined checkout passed 603 owner/neighbor tests, 23 isolated transcript-render tests, and 28 Chromium cases, including both image handoffs, initial-submit failure/retry, scrolling, cold sidebar loading, and dashboard selection after reload. The tested index exactly matches the merge-tree result. This is additional local integration proof, not a new PR commit or a new real-Gateway cache-upgrade claim.What Problem This Solves
Fixes an issue where users sending an image in the Control UI would see their image, then a loading placeholder or empty space, then the image again as the submission moved through accepted input custody and saved history. Initial prompts and ordinary conversation sends used different presentation paths.
Why This Change Was Made
Keep presentation ownership in the existing transcript and image renderer. Custody uses the same submission-derived row key without inventing transcript identity; the gallery adopts exact image slots when a complete canonical receipt arrives. It binds local attachment order to persisted fact positions, including duplicate uploads and mixed inline/offloaded blocks whose display order can differ.
The same loaded image element remains mounted while metadata and authorized image bytes load. Native image load/error events and the existing bounded deadline replace the detached decode preloader. Initial prompts now keep authoritative text and media instead of overwriting them with local attachment content. Imported identity changes, partial/ambiguous receipts, removals, replacements, denial, and connection/auth changes cannot borrow unrelated previews.
Production LOC: +137/-161 (net -24). Tests: +640/-261 (net +379). Docs: +4/-2. No dependency, configuration, protocol, database, or provider changes.
User Impact
An image that has already appeared stays visible and keeps its space while the send is accepted and history catches up. Unavailable or denied media still has a visible failure outcome. No operator action or new setting is needed.
Evidence
The original ordinary-send browser reproduction failed on the unmodified baseline when custody replaced the uploaded image with a loading card. The fixed built Control UI passes separately paused custody, metadata-loading, and image-byte-loading stages, preserving the original image element, its geometry, and pixel-identical screenshots. A request-animation-frame sampler also checks image continuity and absence of a replacement loading card.
Before: the already visible upload becomes a loading placeholder during custody.
After: the same image remains visible while canonical image bytes are still loading.
Both complete captures were inspected and contain only synthetic task data. This is real Chromium running the built UI with a mocked Gateway, not a live external-provider claim. The earlier work in #134310 rejected a same-node-only implementation, so this repair is checked against rendered pixels rather than DOM identity or
naturalWidthalone; a browser can paint its current decoded request while a pending replacement reports zero intrinsic dimensions.The existing-cache hard-refresh boundary also passed against an isolated real Gateway. A local mock provider was the only external-service substitute. Baseline
58af1daa457naturally wrote a canonical inline-image cache through the normal initial-image UI; candidate09ee4adbdccthen hard-reloaded on the same origin and browser storage. A 164 ms delay of the actual, unmodified startup response let that cached image paint before authoritative history arrived. Real metadata and raw-image responses were then held and forwarded unchanged. The same image element and 180×180 geometry persisted through all stages, with pixel-identical stage screenshots, 33 sampled animation frames, zero continuity violations or page errors, then successful native canonical load. The follow-up commits change tests only. The six-file image repair remains unchanged after the conflict rebase onto main; this earlier capture proves the original image repair, while the combined rebased UI has fresh unit and browser proof below.All five full-page captures from that run were inspected and contain only synthetic data; the pictured pending-byte stage was independently inspected before upload. The owned Gateway and browser stopped cleanly. An earlier ungated attempt let history win before the cache painted and is explicitly not counted as continuity proof or a product failure.
600 focused and neighboring unit tests passed again on rebased head
37fcb2ecde26, including canonical history hydration, ordinary/initial sends, duplicate uploads, partial receipts, mixed inline/offloaded ordering, imported queue identity boundaries, reverse completion, ticket renewal, denial, timeouts, and cleanup:27 Chromium E2E cases passed across four specs on final candidate
1e6e2dede0b6(37.82 s), covering ordinary sends, initial-prompt attachments, GitHub project/worktree creation, and transcript disclosure/scroll interruption. This includes main’s new submitted-preview/failure/retry scenario and the native-wheel case that failed in the older normal CI run:The added ordinary-send/initial handoff, duplicate-attachment, imported queue, and mixed-receipt regressions were demonstrated failing before their respective repairs. The rebased full changed-file check passed all core-test/UI typechecks, graph, i18n, coercion, dependency, ratchet, format, and dead-export checks, then found the combined initial-prompt specification five lines over its 1,000-line lint limit. The final test-only cleanup reuses the existing decoded-thumbnail helper for both exact-180-pixel handoff assertions, removing 11 lines without suppressions or lost assertions. The E2E type graph, all four remaining selected Oxlint/Stylelint batches, formatting,
git diff --check, all 27 browser cases, and a fresh whole-candidate P0-scoped review pass after that cleanup. The earlier37fcb2ecde26CI run was automatically cancelled when this final head was pushed.Fresh whole-patch Codex autoreview is scoped-clean at the repository's P0 threshold; this is not represented as an all-priority audit. The actual merge conflict was confined to the SDK relocation fixture. Rebase onto inspected main
3e94877fec4akept main’s stronger dedicated prior-output inventory and cache-output exclusions, dropping our now-redundant SDK commit entirely. No SDK file remains in this PR’s diff. Both the upstream submitted-preview browser scenario and this PR’s image handoff scenario survived the automatic merge and pass. Main’s reasoning-only empty-bubble guard remains orthogonal because image-bearing rows are excluded; source inspection also confirms its settled-input/history lifecycle changes preserve submission custody until canonical consumption. A fresh whole-branch Codex review of the rebased candidate is P0 scoped-clean; this is not an all-priority audit. Introducing commit/release is unknown; related earlier image repairs are context, not attribution of this remaining bug.The first hosted run failed only on two stale handoff test surfaces (one duplicated across UI and core shards): snapshot assertions expected the removed history overwrite, and project-creation E2E waited for the retired custody row key and omitted current image-slot metadata. The test-only follow-up preserves sender checks and asserts same-image continuity plus canonical authority. Its seven snapshot tests, all 19 browser cases, complete changed-file checks, and fresh scoped review pass.
ClawSweeper found no correctness or security finding. Earlier reviews requested current-main conflict resolution and fresh focused/browser plus exact-head validation; its latest exact-head review retained only the final CI gate. Conflict resolution, focused/browser proof, additional current-main integration, and exact-head CI are now complete. The maintainer explicitly requested this landing. Its stored-data heuristic is not a schema change: image identity is ephemeral renderer state, and history reconciliation now retains the existing authoritative message shape; no storage writer, schema, migration, persistent-store retention, or format changed. The real-Gateway cache replay above covers the upgrade boundary.
Run 33601860739 passed all formerly failing image checks. Its SDK declaration cache-relocation fixture exposed a deterministic setup defect after a main-branch test consolidation: historical root chunks were seeded from the initial production build, omitting an intermediate QA build. The test-only correction captures the last pre-change QA inventory without prepopulating the changed outputs under test. All 11 declaration tests pass on the exact failed CI merge snapshot with that correction, as do the changed-file type/lint/structural checks and fresh P0-scoped Codex review. That temporary one-line test repair is no longer in this PR: main’s stronger equivalent superseded it during the conflict rebase.
That run also failed two auth-alias assertions and one browser-relay tab-navigation case outside this change. The auth suite passed alone (28 cases) and after runtime-plugin tests in a one-worker ordered pair (71 cases total); that bounded diagnostic does not recreate the original two-reusable-worker CI lifecycle. Browser source was byte-identical across its passing and failing runs; the diagnostic record shows the real Chrome tab remained open while its Playwright page retired. Neither observation justifies a speculative production fix. Named follow-ups if they recur: auth-profile alias expectations in a shared agents-support worker, and browser-relay initial navigation retiring the Playwright page while Chrome stays open.
Run 33603749918 cleared those SDK, auth, and browser failures, then exposed one Windows-only fixture collision: the CLI PATH test deleted a checkout-root temporary directory while the declaration snapshot traversed the checkout through installed workspace links. The fixture now uses the existing
.artifactsscratch boundary on the same drive, via the canonical temp-directory helper. All Windows PATH/native-owner assertions remain unchanged, and no compiler catch, retry, namespace narrowing, or production behavior was added.A deterministic real-filesystem ordering probe reproduced the original
ENOENT/scandirafter directory enumeration, then passed with an identical before/during/after snapshot signature when the fixture lived under.artifacts. This probe ran on macOS and is not a Windows PATH claim. The existing cache, temp-helper, and CLI suites passed 56 portable tests locally, with seven Windows-only cases skipped on macOS. Both hosted Windows jobs subsequently passed on pre-rebase headcfdb880f4adbin run 33606518366, including the Windows-only PATH cases.While normal PR CI was not yet visible, the repository’s native
scripts/pr ci-dispatch 136072recovery accepted headcfdb880f4adbdf23df42991c0230f586bd989ca8and started manual CI run 33606518366. Normal PR CI did attach later; the final preflight caught it, so no close/reopen recovery was performed. This is CI validation, not publication or a merge-gate bypass. Its normal hosted Windows lane runs the unchanged PATH cases with serial project execution; the original scan/delete interleaving is covered by the separate deterministic ordering probe. All changed-file gates and fresh P0-scoped review passed. Native landing results will be recorded before merge.That run's first attempt also exposed two unrelated test failures; neither test or owner is changed by this PR. UI shard 3 reached no observed hide animation-start event in the dropdown test, before its pointer-dismissal action (4,586 other tests passed). Both complete dropdown suites passed unchanged locally, 49/49. The short default animation and the event/class observation window explain what the test depends on, but the log does not identify why that window was missed. Named follow-up: dropdown animation-start observation can miss the hide phase under the full UI shard.
Gateway-methods failed with
ENOTEMPTYwhile removing the abort-registry fixture's state directory, not a cancellation assertion (4,309 other tests passed). The complete six-case incarnation suite passed unchanged locally in its original case order; that does not reproduce the original two-worker shard lifecycle. Existing teardown already drains registry/session/reconcile/file-lock owners and closes databases, including the current-main cleanup repair. No surviving writer is identified by this log. Named follow-up: abort registry fixture: identify state-file recreation after teardown drain. Both the UI shard and Gateway-methods shard passed unchanged in the single accepted failed-job retry. No timing limit, assertion, isolation, or cleanup retry has been weakened; passing the retry is not a claim that those test-lifecycle issues are fixed.The first attempt also reported Android build-play as cancelled, rather than failed. Its check annotation confirms the 20-minute job deadline. Both phone variants assembled and passed lint before the deadline interrupted benchmark APK compilation. This job intentionally covers both phone variants, benchmark, and Wear-shared tasks in three separate Gradle processes to release memory on hosted runners. Setup took about 2m24; the first two build phases took 10m45 and 6m37. The Gradle cache was cold and read-only, so the first attempt did not publish a warmed cache. Named follow-up: hosted Android build-play exceeds its 20-minute cold-cache job budget. Android code and CI configuration are unchanged by this PR; its existing task coverage, memory separation, and deadline remain intact. The same cancelled job hit its 20-minute deadline again on the one accepted failed-job retry. No further retry, timeout increase, task removal, or Android/workflow change was made.
Normal PR CI run 33606652598 attached later to pre-rebase head
cfdb880f4adb. Its sole failed test was the native-wheel/no-reduced-motion transcript recovery case: scrolling stopped 112 px above the requested top before the held recovery response was released. The fixture contains only canonical text messages and no send, custody, or attachment transition; the scroll test, owner, and helper are unchanged between that head and the inspected main. All eight cases in the unchanged disclosure suite pass alongside the 19 image/project cases on the rebased candidate. This is a bounded local diagnostic, not reproduction of the original full Linux shard. Named follow-up: native wheel interruption leaves the transcript 112 px from the top before recovery; event/frame evidence is needed before classifying it as input observation or a cancellation/measurement defect. The conflicted pre-rebase head is superseded; final native landing remains gated on fresh exact-head CI.Final-head CI attempt 1 completed with 152 successful jobs, 11 skipped jobs, and two substantive browser failures plus the aggregate gate. Browser-extension bootstrap passed pairing, transport recovery, injected detach recovery and all-tab creation, then rejected selected-tab creation with
Page.navigate: access was revoked. Native navigation reached the destination; the route’s owned-page cleanup explains the subsequent empty tab inventory. The extension subtree is unchanged between this head and inspected main719cac4f964d; the earlier stale-group replay repair is already present. The detailed diagnostic ended before this creation phase, so it cannot identify the event that revoked authority. The exactpnpm test:e2e:browser-extensionpackage command passes locally with its complete ordered lifecycle, both access modes, pinned Chromium, and successful relay/MCP/HTTP cleanup. This macOS result is not a Linux reproduction. Named follow-up: selected-tab creation: identify access-epoch revocation after native navigation; do not weaken access checks or retry the product command without identifying that owner failure.Control UI E2E shard 12 passed 116 cases and timed out restoring the dashboard’s selected side-panel tab after reload. Its initial Terminal selection and Board chat activation succeeded, then the Board chat tab was absent after reload. That test sends no prompts or images; the sidebar selection/persistence owner and fixture are unchanged, and the existing restoration repair is present. The complete one-case specification passes unchanged locally in 10.85 seconds. Named follow-up: dashboard reload: capture board readiness and side-panel projection when the selected chat tab is absent. Neither local pass proves the full Linux shard’s original ordering. The single unchanged failed-job retry passed both browser extension bootstrap and Control UI shard 12, and the full run and required gate are successful. No extra delay, timeout, assertion relaxation, production workaround, or CI-scope change was added. Passing the retry does not establish that the recorded lifecycle observations are fixed.