Skip to content

fix(ui): release losing fallback payloads on composer adoption - #124391

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-fallback-payload-release
Aug 16, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-fallback-payload-release

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Global-scope composer fallback adoption (resolveChatComposerMemoryFallback) coalesces sibling candidates — bare-global, default-main alias, qualified-main — into one winner and deletes the losers from chatComposerFallbackByScope. Unlike every clearChatComposerMemoryFallback caller, it never released the losers' attachment payload-store entries, so their data URLs and object URLs (up to 5 MiB each) leaked for the pane's lifetime.

Why This Change Was Made

The payload store is ref-by-id with explicit release; every other drop point (clear, pane handoff, queue drain, editor replace) releases what it drops. Adoption was the one owner that didn't. The fix releases dropped candidates' payloads at the adoption site with the same retention rule the pane-handoff owner already uses (ids still referenced by the live composer or any surviving fallback stay retained) — and that shared rule is now one helper, releaseDisplacedChatAttachmentPayloads, used by both owners instead of two hand-rolled retained-id set builders.

User Impact

Long-lived Control UI panes that flip between global agent targets with attachment drafts no longer accumulate leaked attachment payloads and un-revoked object URLs.

Evidence

  • New regression releases losing sibling fallback payloads when adoption drops them fails pre-fix (stash proof) and passes post-fix; companion test proves ids shared with the live composer survive a sibling drop.
  • node scripts/run-vitest.mjs run ui/src/pages/chat/chat-composer-memory-fallback.test.ts ui/src/pages/chat/chat-pane-attachment-handoff.test.ts ui/src/pages/chat/chat-send.test.ts ui/src/pages/chat/chat-pane-retained-presentation.test.ts — all green.
  • tsgo:ui clean; oxfmt/oxlint clean.
  • Autoreview (Codex, gpt-5.6-sol high): clean, 0.98.
  • Prod LOC: +30 −8 (net +22: the release call, the shared helper, and the handoff-site consolidation); tests +105.

Global-scope composer fallback adoption coalesces sibling candidates
(bare-global, default-main, qualified-main) into one winner and deletes
the losers from chatComposerFallbackByScope — but never released their
attachment payload-store entries, unlike every clearChatComposerMemory-
Fallback caller. The dropped data URLs and object URLs leaked for the
pane's lifetime.

Release dropped candidates' payloads at the adoption site, retaining ids
still referenced by the live composer or any surviving fallback (the
same retention rule the pane-handoff owner uses).
@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 16, 2026
@steipete
steipete marked this pull request as ready for review August 16, 2026 03:40
@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 Aug 16, 2026
@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 11:46 PM ET / August 16, 2026, 03:46 UTC.

ClawSweeper review

What this changes

The PR releases payload-store entries for composer-fallback drafts discarded during global-scope adoption while retaining attachments still referenced by the active composer or surviving fallback drafts.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. Current main deletes coalesced fallback drafts without releasing their attachment payloads; this branch repairs that owner boundary with the same retained-ID rule already used for pane handoff. The maintainer label also requires explicit maintainer handling rather than automated cleanup.

Priority: P2
Reviewed head: 17ac9aa5339e0ec91bbf6a4004967ad50e4152be

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a coherent owner-boundary repair with focused regression coverage; exact-head CI completion remains the normal merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored internal UI-state repair with focused regression evidence; the external-contributor real-behavior-proof gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored internal UI-state repair with focused regression evidence; the external-contributor real-behavior-proof gate does not apply.
Evidence reviewed 5 items Current-main defect: Current main deletes every coalesced candidate and stores only the adopted fallback, but does not release payload-store entries for the deleted candidates.
Owner-boundary repair: The branch releases candidate attachments after constructing the retained fallback map, retaining IDs present in the live composer or any surviving fallback.
Shared invariant: Pane handoff already drops overridden fallback attachments only after retaining IDs owned by mounted composer state and surviving fallbacks; the PR centralizes that rule in the payload-store owner.
Findings None None.
Security None None.

How this fits together

Control UI chat panes retain unsent drafts and attachment payloads while users switch sessions or global agent targets. Fallback adoption coalesces equivalent drafts, and the payload store owns revoking data and object URLs once no live draft references them.

flowchart LR
A[Pane or agent target change] --> B[Composer fallback drafts]
B --> C[Fallback adoption]
C --> D[Retained composer state]
C --> E[Discarded fallback drafts]
D --> F[Attachment payload store]
E --> F
F --> G[Released data and object URLs]
Loading

Before merge

  • Resolve merge risk (P1) - Production code grows by 22 lines for a bug fix; that remains warranted only while the payload-store helper is the single shared retained-ID rule for both displacement owners.
  • Resolve merge risk (P1) - The supplied check state still has an exact-head UI E2E job in progress, so merge validation is not yet complete.
Agent review details

Security

None.

PR surface

Source +22, Tests +105. Total +127 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 3 30 8 +22
Tests 1 105 0 +105
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 135 8 +127

Review metrics

Metric Value Why it matters
Production versus regression-test LOC production +22, tests +105 The new helper replaces duplicated pane-handoff retention logic while adding the missing adoption release and targeted regression coverage.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land one shared retained-ID release rule in the payload-store owner after exact-head CI completes, so fallback adoption and pane handoff cannot drift into different attachment-lifetime policies.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land one shared retained-ID release rule in the payload-store owner after exact-head CI completes, so fallback adoption and pane handoff cannot drift into different attachment-lifetime policies.

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

Yes—current main's adoption path deletes fallback records at ui/src/pages/chat/chat-composer-memory-fallback.ts:104 without releasing their payload IDs; the added test constructs that exact losing-sibling state. This read-only review did not execute tests.

Is this the best way to solve the issue?

Yes. Adoption is the deletion owner, and reusing the pane-handoff retained-ID invariant in the payload store is safer than maintaining two hand-built retention sets.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 148229b6dd21.

Labels

Label changes:

  • add P2: The PR fixes bounded but user-visible Control UI attachment payload retention in long-lived chat panes.
  • 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: This is a maintainer-authored internal UI-state repair with focused regression evidence; the external-contributor real-behavior-proof gate does not apply.

Label justifications:

  • P2: The PR fixes bounded but user-visible Control UI attachment payload retention in long-lived chat panes.
  • 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: This is a maintainer-authored internal UI-state repair with focused regression evidence; the external-contributor real-behavior-proof gate does not apply.

Evidence

What I checked:

Likely related people:

  • Vyctor H. Brzezowski: Introduced the current fallback-adoption module and the deletion block implicated by this repair. (role: feature introducer; confidence: high; commits: 38e0ae6ec851; files: ui/src/pages/chat/chat-composer-memory-fallback.ts)
  • steipete: Has substantial history in the central chat attachment and fallback files and authored the focused owner-boundary repair. (role: recent area contributor; confidence: medium; commits: 17ac9aa5339e; files: ui/src/pages/chat/attachment-payload-store.ts, ui/src/pages/chat/chat-pane-attachment-handoff.ts)

Rank-up moves

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

  • Wait for the in-progress exact-head UI E2E check to complete successfully.

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 9a3f3b7 into main Aug 16, 2026
222 checks passed
@steipete
steipete deleted the codex/autoqa-fallback-payload-release branch August 16, 2026 03:54
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
…law#124391)

Global-scope composer fallback adoption coalesces sibling candidates
(bare-global, default-main, qualified-main) into one winner and deletes
the losers from chatComposerFallbackByScope — but never released their
attachment payload-store entries, unlike every clearChatComposerMemory-
Fallback caller. The dropped data URLs and object URLs leaked for the
pane's lifetime.

Release dropped candidates' payloads at the adoption site, retaining ids
still referenced by the live composer or any surviving fallback (the
same retention rule the pane-handoff owner uses).
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 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