Skip to content

fix(ui): keep uploaded images visible during worktree startup - #139323

Merged
steipete merged 1 commit into
mainfrom
codex/keep-uploaded-images-visible
Sep 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/keep-uploaded-images-visible

Conversation

@steipete

@steipete steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users uploading an image into a new chat would see the already-loaded preview replaced by a loading card when the session's worktree details arrived.

Why This Change Was Made

Workspace and permission metadata was part of the entire image gallery's identity, so hydrating the session recreated its image elements. Preserve mounted inline and inbound uploads across those updates while retaining policy-triggered metadata revalidation. Filesystem previews still reset on policy changes, and explicit access denial or changed credentials/session identity still clears retained images.

The production change adds ten net lines to separate gallery identity from per-image workspace invalidation. Regression coverage extends the existing new-session browser flow and checks inline, pending-metadata, and fully loaded uploads.

User Impact

Uploaded images stay visible through worktree startup and canonical history loading, without flashing a loading placeholder or losing their layout.

Evidence

  • Reproduced before the fix: all three focused workspace-hydration cases failed, and the new-session browser flow displayed the loading card shown below.
  • 59 focused tests passed across the transcript media-handoff and invalidation suites, including access denial, credential rotation, source replacement, and filesystem permission changes.
  • Both new-session and ordinary chat image handoff E2E scenarios passed. Assertions preserve the original image node, source/pixels, and absence of a loading card.
  • Verified the current renderer in Chrome with a synthetic upload and delayed metadata, including removal after explicit access denial.
  • Required check:changed gates passed in an isolated checkout with an owned dependency install; all four edited files were verified byte-identical to this patch.
  • Independent review found no actionable P0–P2 findings. Inspected synthetic screenshots and recordings.

Before

Uploaded image replaced by a loading card after worktree hydration

After

Uploaded image remains visible after worktree hydration

@steipete steipete self-assigned this Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 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 app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Sep 5, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 3:41 PM ET / 19:41 UTC.

ClawSweeper review

What this changes

Preserves uploaded chat image previews during workspace startup while retaining access revalidation, with regression coverage and documentation.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix: current main still invalidates uploaded-image presentation when workspace metadata arrives. No actionable correctness or security defect was found in the introduced patch.

Priority: P2
Reviewed head: 1a7ac95f9395340d3c490cf180c21e3a1c67731e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful lifecycle coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied MEMBER association exempts this PR from the external-contributor gate, and no material authority change triggers an exception. The body reports Chrome verification of upload retention through delayed workspace metadata and removal after denial; linked screenshots were unavailable to this reviewer.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied MEMBER association exempts this PR from the external-contributor gate, and no material authority change triggers an exception. The body reports Chrome verification of upload retention through delayed workspace metadata and removal after denial; linked screenshots were unavailable to this reviewer.
Evidence reviewed 8 items Current main still contains the reported trigger: The inspected main revision includes policyKey in the gallery scope; changing workspace policy therefore makes continuing false and allocates replacement image-slot keys.
Introduced change preserves the existing ownership boundary: Only inline and canonical inbound images preserve their slot across policy changes. Connection, credentials, base path, session, agent, and canonical message identity still govern continuation. The verified test merge retains this same production change against its pinned main parent.
Access revalidation remains independent of presentation: The attachment cache still includes policyKey. Resource subscription replacement detaches obsolete requests, and the image renderer clears retained presentation on definitive unavailability. The patch does not change ticket issuance, credential transmission, or server authorization.
Findings None None.
Security None None.

How this fits together

The Control UI renders uploaded images from local previews and canonical transcript media references. Session metadata updates affect image presentation and trigger authenticated media availability checks.

flowchart TD
  A[Uploaded image] --> C[Chat image renderer]
  B[Session workspace update] --> C
  C --> D[Keep mounted upload preview]
  C --> E[Recheck media access]
  E --> F[Refresh authorized image]
  E --> G[Remove denied image]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +10, Tests +75, Docs +2. Total +87 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 12 2 +10
Tests 2 76 1 +75
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 90 3 +87

Review metrics

Metric Value Why it matters
Production and regression coverage Production +12/-2 (net +10); tests +76/-1 (net +75) The production growth separates presentation identity from policy invalidation; coverage extends existing lifecycle and browser fixtures.

Technical review

Best possible solution:

Keep upload presentation stable at the gallery owner while independently renewing access and immediately clearing denied or identity-replaced media.

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

Yes, from source: render an uploaded image, leave canonical metadata pending, then hydrate workspace details; current main changes the gallery scope and replaces the loaded image. This review did not execute that scenario.

Is this the best way to solve the issue?

Yes—the gallery owns the unwanted remount, making this the narrow repair. Removing policy invalidation from the media resource instead would suppress necessary access revalidation.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: Repairs a bounded chat-preview disruption during session startup without evidence of lost uploads or a blocked core workflow.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied MEMBER association exempts this PR from the external-contributor gate, and no material authority change triggers an exception. The body reports Chrome verification of upload retention through delayed workspace metadata and removal after denial; linked screenshots were unavailable to this reviewer.

Label justifications:

  • P2: Repairs a bounded chat-preview disruption during session startup without evidence of lost uploads or a blocked core workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied MEMBER association exempts this PR from the external-contributor gate, and no material authority change triggers an exception. The body reports Chrome verification of upload retention through delayed workspace metadata and removal after denial; linked screenshots were unavailable to this reviewer.

Evidence

What I checked:

  • Current main still contains the reported trigger: The inspected main revision includes policyKey in the gallery scope; changing workspace policy therefore makes continuing false and allocates replacement image-slot keys. (ui/src/pages/chat/components/chat-message-images.ts:383, a2421a2c08c9)
  • Introduced change preserves the existing ownership boundary: Only inline and canonical inbound images preserve their slot across policy changes. Connection, credentials, base path, session, agent, and canonical message identity still govern continuation. The verified test merge retains this same production change against its pinned main parent. (ui/src/pages/chat/components/chat-message-images.ts:377, 1a7ac95f9395)
  • Access revalidation remains independent of presentation: The attachment cache still includes policyKey. Resource subscription replacement detaches obsolete requests, and the image renderer clears retained presentation on definitive unavailability. The patch does not change ticket issuance, credential transmission, or server authorization. (ui/src/pages/chat/components/chat-message-attachment-availability.ts:306, 1a7ac95f9395)
  • Regression coverage exercises the actual presentation lifecycle: The added table covers inline, pending-metadata, and loaded uploads through workspace hydration, followed by explicit denial. The browser scenario uploads an image through New Session, delivers workspace metadata, and checks the original node, source, pixels, and absence of a loading card through canonical history handoff. Existing invalidation coverage also exercises filesystem permission changes and credential rotation. Tests were inspected, not executed. (ui/src/pages/chat/components/chat-transcript-media-handoff.test.ts:268, 1a7ac95f9395)
  • Prior area history supports routing: Current-main history records Peter Steinberger across image handoff, renewal retention, rendering consolidation, and filesystem preview permissions. Earlier image presentation work also lists Vyctor H. Brzezowski. Exact source-line introduction could not be verified because required historical objects were unavailable; these are routing signals, not causal attribution. (ui/src/pages/chat/components/chat-message-images.ts, 7b1217e2e79e)
  • Captured proof and inspection limits: The supplied body at sourceRevision 8204784cf5c4e6b4b132c824c1a127b067e9ee9eb8d88768889f086fc9d73258 reports Chrome renderer verification with delayed metadata and denial, 59 focused passing tests, browser scenarios, and before/after screenshots. Both attachment fetches failed, so their pixels were not independently inspected. Release-tag source inspection also failed on an unavailable object; no shipped-fix claim is made. (1a7ac95f9395)

Likely related people:

  • steipete: 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.

@steipete
steipete merged commit de2c4b1 into main Sep 5, 2026
137 checks passed
@steipete
steipete deleted the codex/keep-uploaded-images-visible branch September 5, 2026 19:45
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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