Repository navigation
fix(ui): large attachment batches fail before active-run steering - #133052
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 5:10 AM ET / 09:10 UTC. ClawSweeper reviewWhat this changesThis branch makes the Control UI retain large queued attachment payloads in browser storage and coalesce concurrent payload preparation only when their captured queue, tab, recovery, and Gateway ownership match. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessThe refreshed coalescer repair addresses the prior payload-reference concern on source and regression-test evidence; keep the protected PR open pending exact-head integration/CI completion and maintainer review of the browser-persistence upgrade. Priority: P1 Review scores
Verification
How this fits togetherThe Control UI admits messages and attachments into a browser outbox before sending them through the Gateway. Payload preparation retrieves retained attachment bytes only after validating the queue item’s captured recovery and browser-owner identity, then the delivery path sends the resulting message. flowchart LR
A[User queues message with attachments] --> B[Control UI outbox]
B --> C[Payload preparation]
C --> D{Captured owner valid?}
D -->|Yes| E[Browser payload storage]
E --> F[Gateway message delivery]
D -->|No| G[Retain or recover safely]
Decision needed
Why: The PR changes persisted outbox state and overlaps related open recovery migration work, so maintainers must choose the integration sequencing despite the refreshed coalescer source evidence. Before merge
Agent review detailsSecurityNone. PR surfaceSource +1126, Tests +2189, Docs +24. Total +3339 across 47 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land only after exact-head integration validation is green and the browser-state owner confirms this persistence upgrade composes safely with the related queued-message recovery migration. Do we have a high-confidence way to reproduce the issue? Yes for a source-backed browser harness scenario: the regression tests exercise concurrent payload preparation with mismatched and matching captured owners, although this read-only review did not execute them. Is this the best way to solve the issue? Yes: binding immutable binary references to their actual captured owner and coalescing only after per-caller eligibility checks fixes the prior alias-reclassification failure without weakening outbox ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3483c892e22e. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What 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 (7 earlier review cycles)
|
|
Verified head: The original native Chromium reproduction rejected two valid 2,404,765-byte PNGs before Real isolated Gateway proof passed on both Main and a normally created session, using a local synthetic provider. The driver waited for the seed's actual streaming model request, submitted both images through the active-run control, verified the exact outbound byte lengths and SHA-256 hashes, reloaded while browser custody remained, observed both decoded previews before model release, and completed with both images in the conversation. The provider recorded two image parts of 2,404,765 bytes each. Reload never repeated the attachment send. No operator Gateway, credentials, or private conversation data were used; all owned test services are stopped. Local validation is green: 639 unit/browser tests, 15 native Chromium E2E tests, complete changed-file checks, full build, and fresh P0-scoped Codex autoreview. The PR body contains the exact validation commands, ownership/retention limits, and the separately recorded pre-existing Main recovery-routing issue. Visual evidence publication is blocked in this session. Before/reload/completion screenshots and a sanitized video were captured and inspected, but the GitHub CLI guard rejects both the attachment command and authenticated REST upload with |
|
Addressed the cleanup-ownership finding in The new native Chromium regression first failed at the exact missing-source-Blob assertion: the source still held its native lock and original queue metadata, while the duplicate removed its row before its denied lock callback was released. The sole payload deleter now awaits the lock-confirmed document identity and filters references there; the metadata collector no longer trusts the copied session-storage marker. The same test passes, reconnects the source with its original idempotency key and complete bytes, and verifies zero duplicate sends. Existing after-adoption source/copy retirement also passes. CI exposed a second, distinct repair: explicit ACK-lost retry compared a live Full local proof: 11,926 Control UI tests pass (86 existing skips), 39 native browser tests pass, complete changed-file checks pass, and the full build passes at 346,325 B startup gzip under the unchanged 346,761 B limit. Fresh isolated Codex autoreview is scoped-clean at P0; an independent source review plus the native red/green regression separately verified the P1 repair. Both final isolated real-Gateway flows (Main and a normally created new session) again retained both exact 2,404,765-byte PNGs through reload and delivered them once to the local synthetic provider. All owned test services are stopped. The review's ownership-race, compactness, and upgrade-proof items are addressed: the two follow-up production fixes each add four net lines; legacy inline queues, blocked upgrades, old draft records, and failure-preserving migration remain covered. Whole-PR growth implements the explicitly approved browser binary-storage boundary, as explained in the PR body. No SQLite, protocol, product configuration, dependency, budget, or baseline change. The inspected synthetic screenshots and final video remain local: this session's GitHub CLI guard rejects the attachment command and authenticated upload endpoint. No bypass, alternate credential, release, or repository proof asset was used. The PR body records this publication gap and the separate pre-existing Main history-routing follow-up. Exact-head CI is pending; this comment does not claim merge readiness. @clawsweeper re-review — the canonical retry repair is an additional behavior change beyond the original cleanup finding. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
9761cb1 to
a15723d
Compare
Store immutable browser outbox payloads as Blobs before admission, preserve complete bytes through terminal and reconnect handoff, and keep uncertain retries on their original submission identity. Preserve existing drafts and inline queues during upgrade; fail visibly without partial sends or a new volatile fallback. Fixes #132833.
a15723d to
8023d67
Compare
|
Final locally verified head: The final built candidate passed the real isolated-Gateway flow on both Main and a normally created new session, using only a local synthetic provider. Both valid PNGs are exactly 2,404,765 bytes; outbound SHA-256 values match the originals, reload retains both decoded previews while browser custody remains, and the provider receives two complete image parts with only one attachment send. The committed source fingerprint matches the live-tested files. All owned test services are stopped. Local validation: 12,001 Control UI tests pass (86 existing skips), 44 native Chromium tests pass, and all 15 Code Mode recovery tests pass. Full build passes at 345,615 B startup gzip under the unchanged 346,761 B limit. Fresh full-candidate isolated Codex review is scoped-clean at P0 (0.94); the earlier P1 duplicate-cleanup race is separately covered by native red/green and independent source inspection. Exact commands and the persistence boundaries are in the PR body. The last conflict preserved main's selected-session ownership and quota fixture repair and dropped our redundant fixture copy. One inherited typecheck error was corrected by importing the existing tool-owner metadata helper from its canonical leaf, preserving its policy and avoiding a heavy re-export; the exact failing typecheck and 15 owner tests now pass. That import repair is also present on the latest inspected main. Exact-head CI run 33300196928 is still pending; this is local proof, not a hosted-green or merged claim. The later Main/global identity migration remains separate and its owner has been notified to integrate with the Blob contract rather than overwrite it. The before/reload/completion captures and video were inspected and contain synthetic data only; no operator Gateway, credentials, private conversations, or private model identifiers were used. Media publication gap: a fresh attempt through the documented |
Bind immutable attachment bytes to the queued input rather than mutable session aliases. Validate each caller before coalescing equivalent payload reads. Preserve gateway, authenticated recovery, reference, queue, and lock-confirmed tab ownership. Reproduced alias reclassification and nine concurrent validation failures before repair; 403 focused tests, 12,013 UI tests, 44 native Chromium tests, changed gates, full build, fresh isolated review, and real Gateway two-image steering/reload proof pass. Production follow-up is net -10 lines. Refs #133052, #132833.
|
Addressed the latest payload-scope finding in Immutable attachment bytes now belong to the generated queued-input ID plus exact opaque reference, Gateway, authenticated recovery owner, and source tab. Mutable routing remains in the queue metadata, including strict route/attempt/reference CAS. Physical deletion still requires the document's held Web Lock. Only queued-payload Red → green: on the previous head, a real prepared/admitted PNG+PDF queue for The investigation also found a concurrent-preparation validation gap. Nine callers correctly rejected alone but incorrectly joined a valid pending read: wrong queue ID, reference source tab/recovery scope, Incognito, never-observed client, and mismatched attachment count/MIME/name/size. Each caller now passes eligibility before sharing work, and the coalescer key includes all retained validation inputs. All nine reds are green; matching-owner and remembered-offline controls remain ready and prove one shared read. Handoff stays allocation-free and async owner fences remain intact. Final candidate proof: 403 focused owner tests; 12,013 full UI tests (86 existing skips); 44 native Chromium tests across eight complete suites; all 47-path changed checks; full build at 345,628 B startup gzip under the unchanged 346,761 B limit; fresh isolated Codex autoreview scoped-clean at P0 (0.94), with the known P1 independently verified by source and red/green proof. Exact commands are in the updated PR body. The inherited import correction is now also canonical on main through the metadata-leaf import fix. Refreshed live proof: the final built source passes Main and normally created new-session flows against an isolated real Gateway with a local synthetic provider. Each of the two PNGs is exactly 2,404,765 bytes; outbound SHA-256 values match, both decoded previews survive reload while browser custody remains, the provider receives both complete image parts, and only one attachment send occurs. The final video repeats the new-session flow. All refreshed captures and the video contact sheet were inspected; served asset bytes and committed source fingerprint match. Both owned services are stopped. No operator Gateway, credentials, or private conversations were used. Rank-up/merge coordination: this repairs the scope-stability move without retaining a mutable Blob routing identity. The two synthetic unresolved cold-start variants were deliberately not added for the producer reason above. Per the recommended serialized order, this attachment contract lands first; the owner of the separate Main/global identity migration has been notified to hold its merge, rebase onto the landed Blob contract, and prove its combined upgrade/recovery flow there. No unmerged recovery implementation was imported here. Publication gap: the documented GitHub media upload remains blocked by the active CLI guard ( The new exact-head CI is still required before native prepare/merge; the earlier green run is not used as proof for this follow-up. No prepare/merge intent has been created. @clawsweeper re-review — the coalescer repair adds behavior beyond the previous scope finding, so please refresh the exact-head review. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Land-ready at The refreshed ClawSweeper review has no actionable code findings. Its remaining exact-head and provenance gaps are resolved: the raw The approved persistence decision remains the bounded binary owner with complete-before-admission/transport guarantees, distinct draft retention, strict credential/reference/queue custody, and lock-confirmed deletion. The later Main/global recovery migration is still open and deliberately sequenced afterward; its owner must integrate and re-prove its browser-state upgrade against the landed contract. No unmerged migration was imported, and compatibility with that branch as currently written is not claimed. Final proof remains 12,013 UI tests, 44 native Chromium tests, 403 focused owner tests, changed gates, full build, fresh isolated P0 review, and refreshed real-Gateway Main/new/video flows. Two exact 2,404,765-byte images survive reload and reach the local synthetic provider in one attachment send. Commands, red/green details, production/test deltas, and the concrete media-upload guard gap are in the PR body and full proof response. All owned test services are stopped; no operator Gateway or credentials were accessed. Proceeding through the native merge wrapper, without an admin bypass. |
|
Merged via squash.
|
…enclaw#133052) * fix(ui): retain large attachment batches in the reconnect outbox Store immutable browser outbox payloads as Blobs before admission, preserve complete bytes through terminal and reconnect handoff, and keep uncertain retries on their original submission identity. Preserve existing drafts and inline queues during upgrade; fail visibly without partial sends or a new volatile fallback. Fixes openclaw#132833. * fix(ui): preserve event ownership during outbox custody handoffs * fix(ui): fence outbox cleanup and canonicalize retry checks * test(ui): settle mixed-attachment responsive layout * fix(agents): use canonical tool metadata in recovery * fix(ui): keep queued payload identity independent of routing Bind immutable attachment bytes to the queued input rather than mutable session aliases. Validate each caller before coalescing equivalent payload reads. Preserve gateway, authenticated recovery, reference, queue, and lock-confirmed tab ownership. Reproduced alias reclassification and nine concurrent validation failures before repair; 403 focused tests, 12,013 UI tests, 44 native Chromium tests, changed gates, full build, fresh isolated review, and real Gateway two-image steering/reload proof pass. Production follow-up is net -10 lines. Refs openclaw#133052, openclaw#132833.
Closes #132833
Landing coordination: this bounded attachment repair is proceeding first after renewed maintainer direction. The canonical Main/global session identity repair remains unmerged; its owner has been notified to rebase that later migration onto this Blob-storage contract. Both branches independently introduced a
v3browser metadata format and must not be merged without owner-level integration. Native preparation and merge completed at the verified head, landing asbaef6e0ed070853d1a25b35bf7b57841c3a0b294, without an admin bypass.Published head:
c2d2fc21b4703da17a95fafb177cca6e5c860b83. Local, native-browser, build, review, and real-Gateway proof below apply to this candidate. Exact-head CI run 33302931394 and the requiredopenclaw/ci-gateare green; nativeOPENCLAW_TESTBOX=1 scripts/pr prepare-runcompleted without changing the head. The final rebase preserved main's stronger selected-session/quota ownership repair and dropped our redundant ten-line quota fixture; all original auth assertions remain. The six-line responsive correction waits for normal visibility and settled geometry without changing CSS, bounds, or timeouts; its pre-fix failure was CI-only, not reproduced locally.An inherited main typecheck error required one additional, net-zero caller-import repair in Code Mode recovery: use the existing
plugins/tool-metadatahelper rather than its retiredplugins/toolsexport. The exact failing typecheck now passes, as do all 15 existing recovery tests. No replay or ownership policy changed; the same correction is now canonically merged through the metadata-leaf import repair.What Problem This Solves
Fixes an issue where users steering an active Control UI turn with two valid 2,404,765-byte PNGs would hit the reconnect-storage error before any
chat.send. Both files fit the separate 25 MiB composer-draft limit, but their data URLs alone consume 12,825,512 bytes under Chromium's UTF-16 session-storage accounting, exceeding its 10,485,760-byte quota before JSON overhead. One large PNG and a large-plus-small batch already worked.Why This Change Was Made
Store immutable outbox-owned attachment Blobs in the existing browser IndexedDB database and keep delivery metadata/references in tab session storage. Commit the entire binary batch before admission, hydrate all bytes before transport, and transfer complete attachments into the local transcript/cache before retiring their outbox storage. This repairs the persistence owner instead of weakening active-run durability or borrowing editable, expiring draft records.
The explicitly approved browser schema upgrade preserves existing draft records and readable inline queues. Shared database opening, draft retirement, Blob conversion, and terminal/reconnect handoff reuse or replace existing paths rather than adding parallel implementations. Async operations retain exact credential, queue-attempt, and payload-reference ownership. Uncertain retries preserve their original idempotency key; failed inline migration preserves its original bytes. Credential transitions publish their new owner before synchronous pane notifications, and passive recovery respects the caller's frame-coalesced rendering. The event entrypoint keeps its existing void API.
The final review repair removes mutable conversation scope from the immutable Blob owner: bytes belong to the generated queued-input ID, exact opaque reference, Gateway, authenticated recovery owner, and source tab. Queue metadata still owns routing and strict attempt/reference CAS; physical deletion still requires the document's held Web Lock. Alias reclassification no longer strands readable bytes. Each preparation caller must establish recovery/Incognito eligibility before sharing work, and coalescing requires matching queue/reference identities and ordered attachment MIME/name/size metadata. Previously observed offline owners remain valid, and handoff never allocates a duplicate copy. This follow-up removes ten production lines and adds no schema version, migration, configuration, or fallback.
Independent of the merged stored-image steering repair. No provider-behavior, Gateway protocol, SQLite, product configuration, dependency, or performance-budget changes; the sole non-UI production edit is the inherited caller-import repair described above. The original history-image report was a capture-timing false alarm: this adds only the complete-byte handoff required by the new outbox backing store, not a general history repair. Current main's cloud pending-input custody is preserved and covered by a Blob-backed custody-transfer regression.
User Impact
Active-run attachment batches that fit the storage and Gateway limits can be sent without expanding binary data into session storage. The reproduced two-image batch now uses 2,156 bytes of queue metadata, plus a 130-byte tab marker. Storage failures retain input or a visible recovery row; no partial attachment send or new volatile fallback is allowed. Lost acknowledgements do not trigger automatic replay.
Binary outbox storage requires IndexedDB and Web Locks over HTTPS or localhost. Retention is bounded at 25 MiB per message, 250 MiB and 1,000 bundles per browser origin, with no age-based eviction of queued input. Delivery/discard retires owned bundles. Closed tabs or interrupted copies/cleanup can leave bounded unadopted bundles; the documented recovery is to preserve needed drafts before clearing site data, which also clears browser drafts and sign-in state. Incognito stays on its tab-only inline storage path. Duplicated tabs preserve submission IDs, copy their bytes, and require explicit delivery review; a late duplicate whose source already retired reports missing attachments. Independent tabs remain independent.
Documentation: https://docs.openclaw.ai/web/control-ui#chat-behavior
Evidence
chat.send; the smaller control batches passed. Fixtures are generated CRC-valid PNGs, not committed binary assets. Native quota probing accepted 10,485,760 bytes and rejected 10,485,762.mainversus stored-globalcomparison consuming manual retry admission. The unchanged ACK-lost E2E failed before and passed after canonical stored-row reconciliation, retaining the original idempotency key and transport route. Current-format storage readbacks, authenticated same-owner fixtures, unconditional teardown, and a one-shot FileReader fault were corrected without weakening production ownership, byte checks, or timeouts. One queue-reorder sleep was replaced by its asserted storage-error outcome.agent:work:workspace, clears the warm byte registry, then changes configuredmainKeyfrommaintoworkspace. Actual metadata normalization preserves queue/run/reference identity but old hydration returnsmissingwhile the original owner still reads both exact files. It now hydrates and sends both files once with the original run ID. Nine caller variants reject alone but were wrongly accepted concurrently: queue ID, reference tab/recovery owner, Incognito, never-observed client, attachment count, MIME, filename, and size. All now reject; matching and remembered-offline controls stay ready and share one read. All 403 focused owner tests pass. The review's ordinary before-first-hello unresolved-Blob producer was not established: defaults publish before recovery readiness and cold clients cannot prepare these bytes. No fabricated cold-start admission test was added; existing bare-main/raw-global metadata tests remain green. Routing policy itself is unchanged.pnpm buildpasses; startup JS is 345,628 B gzip, below the existing 346,761 B enforcement limit. No budget or baseline edits in this PR.gh pr comment --attachand the authenticated REST upload to GitHub's user-attachments endpoint withstring rewrite protection blocked unsupported or unsafe input. No guard bypass or alternate credentials were used. The proof comment records the verified flow and this publication gap; CI artifact links will be added if emitted.Size/ownership: production +1,613/-569 (net +1,044, 28 files); tests/test support +2,674/-403 (net +2,271, 18 files); docs +24. The cleanup-authority and canonical-retry follow-ups each add only four net production lines. Raw churn includes moves/extractions. The production growth implements the approved immutable binary-persistence boundary, tab/credential ownership, complete-before-send admission, and complete-byte handoff; reusing mutable seven-day draft records or allowing volatile sends would not preserve the queued-input contract.
Known separate follow-up: Main-session outbox recovery stores a
globalconversation identity while foreground sends useagent:main:main, so recovery can query the wrong history and retain an already-delivered text row as unconfirmed. Source and isolated runtime evidence show this predates the repair; it is owned by the separate Main/global identity issue and canonical repair. Both live attachment flows pass without changing that routing policy. Browser queued-followup receipt timing also remains unchanged; a startup ACK alone is not proof that a model is ready for direct injection.Related scope: Credential-replacement queue isolation remains separate: this repair fences binary references and live ownership but does not introduce a general credential-identity policy for unreferenced text rows. Recorded-idle queue wake-up and its draft repair concern a different publication owner and are not claimed fixed here. The disconnected steering-state report is already closed via its merged queue-state repair. Live states and pinned-main source were verified; no duplicate closure is warranted.
AI-assisted implementation and review. No agent transcripts included.
Exact local validation commands