Repository navigation
fix(ui): pasted text previews fail before sending - #157390
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 6:23 PM ET / 22:23 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch permits local Blob reads in the Gateway's Control UI content security policy, updates preview documentation and browser checks, and fixes the clock in a sidebar test fixture. Merge readiness✅ Ready for maintainer review Keep this PR open. Current main still blocks the local Blob fetch needed for unsent pasted-text previews, and the submitted browser and visual evidence supports the repair. I found no actionable patch defect. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway serves the Control UI with a browser connection policy. The chat composer creates a local URL for pasted text, and the preview reader fetches that URL to display the text before sending. flowchart LR
A[Gateway serves Control UI] --> B[Browser receives connection policy]
C[Pasted text attachment] --> D[Local Blob preview URL]
B --> E{Browser allows local fetch?}
D --> E
E -->|Yes| F[Text preview and copy]
E -->|No| G[Preview error]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +1, Tests +23, Docs 0. Total +24 across 6 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the Gateway as the single policy owner for local Blob reads and retain the browser check that fails under the former policy. Do we have a high-confidence way to reproduce the issue? Yes. The submitted controlled browser run reports a Blob fetch blocked by connect-src, and current main still has the same policy gap; I did not execute the suite in this read-only review. Is this the best way to solve the issue? Yes. The blocked fetch originates under the Gateway-served document policy, so changing that policy and exercising it in the existing browser case repairs the owning boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fdebe3495d3d. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
Merge main through 1ab1bb0 to include the owning fixture repair for the exact historical CI case. Preserve the six-file pasted-preview and sidebar delta unchanged. The previous timeout phase remains unproven.
|
Merged via squash.
|
* commit '0484d7a3ecf52589b0d3d98741e58e5f6b5bf661': (68 commits) fix(subagents): stop completion transcript retry loops (#157571) perf(sessions): remove duplicate foreground history reference scans (#157572) improve(typesafe): defer startup work until the first decision (#157380) fix(update): restore npm-pack helper typechecking (#157659) fix(packaging): avoid heap exhaustion on large bundles (#157471) refactor(infra): share process error handler registries (#157632) chore(ui): refresh control ui locales (#157573) fix(gateway): release remote Skills subscriptions when shutdown drains (#157592) perf(plugins): reuse declared tool membership during resolution (#156205) fix(ui): pasted text previews fail before sending (#157390) fix(agents): wait for database resources during deletion (#157631) improve: move operator profile database reads off the Gateway thread (#155800) fix: explain rejected settings without losing edits (#157549) fix: keep Gateway responsive while recording trajectory events (#157598) fix(auth): show SIWC email and selected model account identity (#157629) docs: explain Codex app approval precedence (#155089) refactor(wizard): share select prompt requests (#157607) fix(ui): omit empty sections from conversation Markdown exports (#157590) fix(doctor): explain update lint supervisor refusals (#156547) fix(ui): GitHub folder links lose repository context (#157619) ...
* commit '0484d7a3ecf52589b0d3d98741e58e5f6b5bf661': (68 commits) fix(subagents): stop completion transcript retry loops (#157571) perf(sessions): remove duplicate foreground history reference scans (#157572) improve(typesafe): defer startup work until the first decision (#157380) fix(update): restore npm-pack helper typechecking (#157659) fix(packaging): avoid heap exhaustion on large bundles (#157471) refactor(infra): share process error handler registries (#157632) chore(ui): refresh control ui locales (#157573) fix(gateway): release remote Skills subscriptions when shutdown drains (#157592) perf(plugins): reuse declared tool membership during resolution (#156205) fix(ui): pasted text previews fail before sending (#157390) fix(agents): wait for database resources during deletion (#157631) improve: move operator profile database reads off the Gateway thread (#155800) fix: explain rejected settings without losing edits (#157549) fix: keep Gateway responsive while recording trajectory events (#157598) fix(auth): show SIWC email and selected model account identity (#157629) docs: explain Codex app approval precedence (#155089) refactor(wizard): share select prompt requests (#157607) fix(ui): omit empty sections from conversation Markdown exports (#157590) fix(doctor): explain update lint supervisor refusals (#156547) fix(ui): GitHub folder links lose repository context (#157619) ...
* refactor(ai): share Mistral text delta appends * Merge main to incorporate the upstream update type fix * commit '0484d7a3ecf52589b0d3d98741e58e5f6b5bf661': (68 commits) fix(subagents): stop completion transcript retry loops (#157571) perf(sessions): remove duplicate foreground history reference scans (#157572) improve(typesafe): defer startup work until the first decision (#157380) fix(update): restore npm-pack helper typechecking (#157659) fix(packaging): avoid heap exhaustion on large bundles (#157471) refactor(infra): share process error handler registries (#157632) chore(ui): refresh control ui locales (#157573) fix(gateway): release remote Skills subscriptions when shutdown drains (#157592) perf(plugins): reuse declared tool membership during resolution (#156205) fix(ui): pasted text previews fail before sending (#157390) fix(agents): wait for database resources during deletion (#157631) improve: move operator profile database reads off the Gateway thread (#155800) fix: explain rejected settings without losing edits (#157549) fix: keep Gateway responsive while recording trajectory events (#157598) fix(auth): show SIWC email and selected model account identity (#157629) docs: explain Codex app approval precedence (#155089) refactor(wizard): share select prompt requests (#157607) fix(ui): omit empty sections from conversation Markdown exports (#157590) fix(doctor): explain update lint supervisor refusals (#156547) fix(ui): GitHub folder links lose repository context (#157619) ... Co-authored-by: Vincent Koc <[email protected]>
* fix(ui): restore pasted text previews before sending * test(ui): stabilize sidebar geometry elapsed time
* refactor(ai): share Mistral text delta appends * Merge main to incorporate the upstream update type fix * commit 'dda1f68bfa102cb804392c0e7cc22c0566a0944a': (68 commits) fix(subagents): stop completion transcript retry loops (openclaw#157571) perf(sessions): remove duplicate foreground history reference scans (openclaw#157572) improve(typesafe): defer startup work until the first decision (openclaw#157380) fix(update): restore npm-pack helper typechecking (openclaw#157659) fix(packaging): avoid heap exhaustion on large bundles (openclaw#157471) refactor(infra): share process error handler registries (openclaw#157632) chore(ui): refresh control ui locales (openclaw#157573) fix(gateway): release remote Skills subscriptions when shutdown drains (openclaw#157592) perf(plugins): reuse declared tool membership during resolution (openclaw#156205) fix(ui): pasted text previews fail before sending (openclaw#157390) fix(agents): wait for database resources during deletion (openclaw#157631) improve: move operator profile database reads off the Gateway thread (openclaw#155800) fix: explain rejected settings without losing edits (openclaw#157549) fix: keep Gateway responsive while recording trajectory events (openclaw#157598) fix(auth): show SIWC email and selected model account identity (openclaw#157629) docs: explain Codex app approval precedence (openclaw#155089) refactor(wizard): share select prompt requests (openclaw#157607) fix(ui): omit empty sections from conversation Markdown exports (openclaw#157590) fix(doctor): explain update lint supervisor refusals (openclaw#156547) fix(ui): GitHub folder links lose repository context (openclaw#157619) ... Co-authored-by: Vincent Koc <[email protected]>
* refactor(ui): share slash-command failure results * Merge main to incorporate the upstream update type fix * commit '0484d7a3ecf52589b0d3d98741e58e5f6b5bf661': (68 commits) fix(subagents): stop completion transcript retry loops (#157571) perf(sessions): remove duplicate foreground history reference scans (#157572) improve(typesafe): defer startup work until the first decision (#157380) fix(update): restore npm-pack helper typechecking (#157659) fix(packaging): avoid heap exhaustion on large bundles (#157471) refactor(infra): share process error handler registries (#157632) chore(ui): refresh control ui locales (#157573) fix(gateway): release remote Skills subscriptions when shutdown drains (#157592) perf(plugins): reuse declared tool membership during resolution (#156205) fix(ui): pasted text previews fail before sending (#157390) fix(agents): wait for database resources during deletion (#157631) improve: move operator profile database reads off the Gateway thread (#155800) fix: explain rejected settings without losing edits (#157549) fix: keep Gateway responsive while recording trajectory events (#157598) fix(auth): show SIWC email and selected model account identity (#157629) docs: explain Codex app approval precedence (#155089) refactor(wizard): share select prompt requests (#157607) fix(ui): omit empty sections from conversation Markdown exports (#157590) fix(doctor): explain update lint supervisor refusals (#156547) fix(ui): GitHub folder links lose repository context (#157619) ... * Merge frozen main to include the question fixture authority fix * commit '229ab8a1fe957d3d4822309a39ddf9c7ec616395': (25 commits) test(ui): capture live operator authority in guest question fixture refactor(agents): deslop runners, harness and recovery (#157294) fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131) refactor(msteams): share stored service URL validation (#157706) fix(codex): honor configured tool PATH in native commands (#157290) refactor(msteams): share approval kind labels (#157705) fix(sessions): keep session results current during cold reads (#156121) fix(testing): capture bounded upgrade integrity diagnostics (#157535) refactor(i18n): reuse native branch candidate extraction (#157636) fix(update): preserve recovery files after ownership refusal (#148890) fix(test): prevent late announcements from contaminating registry tests (#157681) fix(e2e): scan full onboarding logs for prompts (#157624) refactor(session-tools): derive contracts from schemas (#156365) refactor(channels): derive config contracts from schemas (#156367) perf(test): reuse MCP archives and batch worker fixture copies (#157689) refactor: reuse prepared fixtures in slow core tests (#157685) refactor(codex): reuse marketplace reference selection (#157621) chore(ui): refresh control ui locales (#157710) docs(gateway): show how we build OpenClaw on Team (#157675) refactor: verify IRC surrogate chunking over loopback (#157580) ... * chore: merge frozen main prerequisite repairs Co-authored-by: Vincent Koc <[email protected]>
* refactor(ui): share slash-command failure results * Merge main to incorporate the upstream update type fix * commit 'dda1f68bfa102cb804392c0e7cc22c0566a0944a': (68 commits) fix(subagents): stop completion transcript retry loops (openclaw#157571) perf(sessions): remove duplicate foreground history reference scans (openclaw#157572) improve(typesafe): defer startup work until the first decision (openclaw#157380) fix(update): restore npm-pack helper typechecking (openclaw#157659) fix(packaging): avoid heap exhaustion on large bundles (openclaw#157471) refactor(infra): share process error handler registries (openclaw#157632) chore(ui): refresh control ui locales (openclaw#157573) fix(gateway): release remote Skills subscriptions when shutdown drains (openclaw#157592) perf(plugins): reuse declared tool membership during resolution (openclaw#156205) fix(ui): pasted text previews fail before sending (openclaw#157390) fix(agents): wait for database resources during deletion (openclaw#157631) improve: move operator profile database reads off the Gateway thread (openclaw#155800) fix: explain rejected settings without losing edits (openclaw#157549) fix: keep Gateway responsive while recording trajectory events (openclaw#157598) fix(auth): show SIWC email and selected model account identity (openclaw#157629) docs: explain Codex app approval precedence (openclaw#155089) refactor(wizard): share select prompt requests (openclaw#157607) fix(ui): omit empty sections from conversation Markdown exports (openclaw#157590) fix(doctor): explain update lint supervisor refusals (openclaw#156547) fix(ui): GitHub folder links lose repository context (openclaw#157619) ... * Merge frozen main to include the question fixture authority fix * commit 'dc64cc3a3a3cf38fff1e44c1d7af42a32929d7e4': (25 commits) test(ui): capture live operator authority in guest question fixture refactor(agents): deslop runners, harness and recovery (openclaw#157294) fix(auth): preserve Copilot tenant credentials during Doctor repair (openclaw#139131) refactor(msteams): share stored service URL validation (openclaw#157706) fix(codex): honor configured tool PATH in native commands (openclaw#157290) refactor(msteams): share approval kind labels (openclaw#157705) fix(sessions): keep session results current during cold reads (openclaw#156121) fix(testing): capture bounded upgrade integrity diagnostics (openclaw#157535) refactor(i18n): reuse native branch candidate extraction (openclaw#157636) fix(update): preserve recovery files after ownership refusal (openclaw#148890) fix(test): prevent late announcements from contaminating registry tests (openclaw#157681) fix(e2e): scan full onboarding logs for prompts (openclaw#157624) refactor(session-tools): derive contracts from schemas (openclaw#156365) refactor(channels): derive config contracts from schemas (openclaw#156367) perf(test): reuse MCP archives and batch worker fixture copies (openclaw#157689) refactor: reuse prepared fixtures in slow core tests (openclaw#157685) refactor(codex): reuse marketplace reference selection (openclaw#157621) chore(ui): refresh control ui locales (openclaw#157710) docs(gateway): show how we build OpenClaw on Team (openclaw#157675) refactor: verify IRC surrogate chunking over loopback (openclaw#157580) ... * chore: merge frozen main prerequisite repairs Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Fixes pasted-text attachments showing “Could not preview this file” when opened before sending, even though their excerpts and text restoration work.
User Impact
Users can open the full text preview of a local pasted attachment, copy it, or restore it to the composer before sending. No migration or configuration change is required.
Why This Change Was Made
The preview reader fetches a browser-created Blob URL, but the Gateway's connection policy omitted
blob:. Allow that local read in the canonical CSP owner. Authentication, permitted remote origins, script policy, UTF-8 validation, and the 256 KiB preview limit stay unchanged.The existing browser case now serves the actual Gateway CSP with the page's inline-script hashes, so this regression is covered without adding a test case or app boot.
Evidence
connect-srcblocked the Blob fetch.CI Fixture Correction
The first CI run exposed a timing-sensitive existing sidebar geometry test: the narrow light-theme case failed because the running grandchild title became 5.859375 px narrower between focus snapshots. The other three geometry cases passed. A controlled reproduction advanced the real elapsed label from
9sto10sand reproduced the exact bounds change (181.046875to175.1875), with all other geometry unchanged. The historical CI label was not captured, so this demonstrates the fixture's vulnerability without claiming certainty about that run's elapsed-time transition.The fixture now gives the running session and browser clock one fixed synthetic timestamp before boot. Timers still run, and every geometry and interaction assertion remains unchanged. This adds no test case, app boot, retry, timeout, polling loop, or production change.
Historical CI Failure and Main Integration
Run 36029837027, job 107738069568 failed in the unchanged
src/agents/bash-tools.test.tscase “backgrounds after yield and can be polled”: its 5,000 ms deadline expired at 5,017 ms. The shard passed 613 of 614 tests; the log does not identify which awaited step consumed the deadline.A single diagnostic replay used the exact CI merge commit
ece4645310d1e9f6d414439f358bc3f7a884a572, the retained 28-file shard selection and order, Node 24.19.0, pnpm 12.4.2, and two workers. All 614 tests passed in 192.986 s wall (169.59 s Vitest; 5.16 GiB peak RSS). The previously failing case took 709 ms locally: Gateway policy setup accounted for about 557 ms, command/parser checks for 35 ms, the store read for 1 ms, process startup for 3 ms, and settlement for 1 ms. Temporary timing marks preserved all real calls and were removed after the replay.This replay is a non-reproduction, not a fix or evidence of the historical timeout phase. The investigation did not establish which awaited operation timed out.
Main subsequently landed #157581 as
1ab1bb09789aa46ad872178d341cf36164bdc407, repairing the exact same test and supervisor fixture. It holds mocked process completion until the yield boundary, requires a running session, and releases and joins the owned execution scope before checking completion. The old failing test file was byte-identical to that repair's parent. This branch integrates that actual owning-fixture change rather than retrying the historical head. This does not prove the historical timeout cause.The six PR files and their complete diff against the integrated main remain byte-identical to the reviewed candidate. Existing component tests and inspected before/after media remain applicable; the integration passed source, fixture-byte, ancestry, and diff checks. No redundant local 614-test replay was run. New-head CI must validate the integrated branch, and required CI and review gates remain unchanged.
The screenshots show the same synthetic pasted-text flow under the original and repaired policies.
Before: the full preview fails despite a valid 1.1 KiB text attachment.
After: the preview preserves the full text, indentation, and Unicode.