Repository navigation
fix(ui): show new-session sends immediately under load - #136069
Conversation
Render the submitted prompt and attachments from the draft owner's frozen snapshot before session admission finishes. Keep Gateway acceptance, retries, and recoverable draft state unchanged, then hand the confirmed key to Chat without an extra reference lookup or stale-client navigation. Share canonical text and JSON rendering without pulling the full transcript and tool graph into New Session. Cover delayed creation, image recovery, reconnect ownership, and uncached navigation; verify a real image-bearing send while an isolated Gateway is stalled for eight seconds.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 4:33 AM ET / 08:33 UTC. ClawSweeper reviewWhat this changesThe PR immediately shows a submitted New Session prompt and attachments with a Starting indicator while the Gateway creates the session, then hands the confirmed session to Chat without an extra lookup. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep this maintainer-owned PR open for the final current-main merge validation. The pending preview and handoff implementation are coherent, and the supplied exact-head real-Gateway evidence plus focused browser coverage support the repair; the remaining required check is the canonical build and route-budget result for the exact rebased merge. Priority: P1 Review scores
Verification
How this fits togetherThe Control UI’s New Session page collects a draft, asks the Gateway to create or adopt a session, and then opens Chat. This change inserts a local, recoverable pending-message view during Gateway admission while retaining server-side acceptance as the source of truth. flowchart LR
A[New Session draft] --> B[Foreground submit]
B --> C[Pending message preview]
C --> D[Gateway session creation]
D --> E[Validated navigation handoff]
E --> F[Session chat]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +182, Tests +243, Docs +2, Other 0. Total +427 across 18 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase once onto current main, retain the frozen draft-owned preview and connection-validated handoff, then record the canonical Control UI build and exact merged New Session route-budget result before merge. Do we have a high-confidence way to reproduce the issue? Yes. The focused browser test defers sessions.create and observes the pending message before resolution, and the supplied exact-head isolated Gateway run reports the same stalled-admission behavior with an uploaded image. Is this the best way to solve the issue? Yes. Keeping the snapshot in the draft-submission owner makes the unacknowledged state visible without claiming Gateway acceptance, while the existing route handoff avoids the redundant lookup and revalidates connection ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 771ffac8619c. LabelsLabel changes:
Label 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 (6 earlier review cycles)
|
Keep submission errors in the shared New Session body so late cloud cleanup failures stay visible while a replacement task is starting. Preserve the replacement recovery identity and its existing dispatch/send flow. Retain route-animation observations from the browser render loop rather than polling after an RPC, which can miss the completed 180ms animation. Extend the existing cloud recovery case to prove that the alert, pending prompt, and Starting indicator remain visible together.
Use canonical passive Markdown defaults until Chat mounts its workspace, session, table, and inline-image interaction owners. Preserve normal web links and the separately wired uploaded-image lightbox while admission waits. Extend the existing delayed image-submit regression to cover rich text, raw reference retention, pending attachment opening, and interactive table controls after the accepted-session handoff.
Use one page-owned image selection callback for both New Session surfaces and their lightbox close path. This preserves behavior while keeping the combined page within its existing size gate after the startup work on main.
Merge the current main snapshot to incorporate the landed startup graph split, then regenerate the canonical boot manifest. Shared preview modules must not pull New Session-only code into Chat; the measured regeneration removes that extra route load without relaxing asset budgets. Also repair the existing SDK declaration-cache relocation fixture exposed by main's combined packaging changes. Seed historical shared-root chunks from both production and QA selections while retaining exact restored-tree and byte equality. No declaration writer or cache ownership changes.
Merge the current main snapshot and resolve the concurrent fixture change in favor of main. The duplicate SDK test repair is no longer part of this PR; all eighteen UI, documentation, and generated-metadata files retain the exact bytes already exercised by the browser and unit tests.
|
Merged via squash.
|
|
Landed through the native workflow as fae30c7106b6. The tested source head 8fed10916a77 passed CI run 33608588519: 153 successful jobs, 12 skipped, no failures. The canonical UI build at the exact landed commit passes all unchanged limits: 8 startup JS requests / 345,652 gzip bytes against 18 / 349,244; largest CSS 54,783 / 54,784 bytes; all ordinary JS, startup CSS and deferred Mermaid limits pass. All 792 precompression sidecars verify. Canonical generation reproduces the committed boot manifest byte-for-byte, and all 36,606 tracked source blobs and modes match landed tree A fresh synthetic route check at the same landed commit loaded 34 JS assets / 953,557 gzip bytes on The real-provider image test remains correctly labeled |
Keep Chat-only Markdown options at their sole call site, remove repetitive parsing comments, and use the image locator callback type directly without changing image assertions. Maintainer-requested cleanup following #136069. Preserve immediate pending text and image previews, accepted-session interactions, and all retry and reconnect behavior.
Keep Chat-only Markdown options at their sole call site, remove repetitive parsing comments, and use the image locator callback type directly without changing image assertions. Maintainer-requested cleanup following #136069. Preserve immediate pending text and image previews, accepted-session interactions, and all retry and reconnect behavior.
* fix(ui): show new-session sends immediately under load Render the submitted prompt and attachments from the draft owner's frozen snapshot before session admission finishes. Keep Gateway acceptance, retries, and recoverable draft state unchanged, then hand the confirmed key to Chat without an extra reference lookup or stale-client navigation. Share canonical text and JSON rendering without pulling the full transcript and tool graph into New Session. Cover delayed creation, image recovery, reconnect ownership, and uncached navigation; verify a real image-bearing send while an isolated Gateway is stalled for eight seconds. * fix(ui): preserve startup errors during pending sends Keep submission errors in the shared New Session body so late cloud cleanup failures stay visible while a replacement task is starting. Preserve the replacement recovery identity and its existing dispatch/send flow. Retain route-animation observations from the browser render loop rather than polling after an RPC, which can miss the completed 180ms animation. Extend the existing cloud recovery case to prove that the alert, pending prompt, and Starting indicator remain visible together. * fix(ui): avoid inactive controls in pending prompts Use canonical passive Markdown defaults until Chat mounts its workspace, session, table, and inline-image interaction owners. Preserve normal web links and the separately wired uploaded-image lightbox while admission waits. Extend the existing delayed image-submit regression to cover rich text, raw reference retention, pending attachment opening, and interactive table controls after the accepted-session handoff. * refactor(ui): share pending and draft image viewer callbacks Use one page-owned image selection callback for both New Session surfaces and their lightbox close path. This preserves behavior while keeping the combined page within its existing size gate after the startup work on main.
Keep Chat-only Markdown options at their sole call site, remove repetitive parsing comments, and use the image locator callback type directly without changing image assertions. Maintainer-requested cleanup following openclaw#136069. Preserve immediate pending text and image previews, accepted-session interactions, and all retry and reconnect behavior.
What Problem This Solves
Fixes an issue where sending the first prompt in the Control UI left users on an inert New Session form for seconds when the Gateway was busy. Even after creation succeeded, an uncached session could wait for another reference lookup before opening.
Why This Change Was Made
The draft-submission owner now captures and renders the submitted message, including images, synchronously. It keeps the existing admission request, idempotency identity, recoverable draft, and Gateway-owned acceptance boundary; a rejection restores the draft instead of inventing a successful session. A confirmed canonical key goes through the existing navigation handoff, with client/handshake ownership rechecked after asynchronous preparation.
Text/JSON rendering is extracted into one shared leaf so the pending preview and Chat share formatting without importing the full transcript/action/tool graph. Pending Markdown uses the canonical passive defaults until Chat mounts its interaction owners; ordinary web links and the separately wired uploaded-image lightbox remain usable. Background starts and the existing project/create/dispatch access order remain unchanged. No Gateway protocol, schema, configuration, dependency, or persistent-outbox changes.
User Impact
Send immediately shows the submitted text and image with a Starting indicator while the server is busy. The message remains visible through admission and navigation, same-scope reconnects retain the pending display, and failed creation keeps the text and attachments available to retry. Late cloud-cleanup errors remain visible beside the pending message. Pending means locally submitted, not server-accepted.
Evidence
Exact landed verification
Merged as fae30c7106b6. Its canonical UI build and regenerated manifest pass unchanged budgets: 8 startup requests / 345,652 gzip bytes, 792 verified sidecars, and all 36,606 tracked blobs/modes matching the landed tree. Fresh synthetic
/newand/chatchecks also pass; the real-provider image test below remains explicitly bound to8fed. The final emitted metadata/service-worker identities and cleanup are verified. Exact-landed build and route proof.Real Gateway and image test
Tested head:
8fed10916a779e5d7c472ee134240acb55385bf2. Both the Gateway and served Control UI were built from that exact source; the final live run used build2026.8.1-8fed10916a77-2026-09-02T07-57-11.457Z. Used an isolated loopback Gateway, normal Control UI token login, a fresh synthetic workspace, and the realanthropic/claude-haiku-4-5provider. Uploaded the repository's actual 180×180 PNG through the file input, together with a formatted prompt containing a table, file/session references, and an ordinary web link.Paused only the isolated Gateway process for eight seconds immediately before Send. Starting appeared 18.5 ms after the browser click event, and the decoded image appeared after 18.6 ms, before any server acknowledgement. The single
sessions.createrequest carried one attachment; its acknowledgement arrived 7,899 ms after the click. There was no extra reference lookup in the create-to-chat handoff and no duplicate create orchat.send.The table and ordinary web link remained readable; the pending Markdown had zero inactive Chat-only controls. The uploaded image opened in its lightbox while creation was still pending. After resuming, the real model described the image; the accepted image decoded at 180×180, survived a full page reload, and opened again in the viewer. This is a controlled server-stall observation, not a production-throughput claim or a statistical latency benchmark.
Before: original production UI with creation held by the mocked-Gateway harness; the form stays inert.
After: the live-tested candidate against the real paused Gateway, before acknowledgement; the formatted prompt and image are already visible.
After reload: real provider response and persisted image.
All captures were inspected and contain only synthetic test data. The final live source manifest matches all 18 PR blobs of
8fed10916a779e5d7c472ee134240acb55385bf2; 417 runtime files and all 28 served entry/boot/New Session assets plus the index were reverified after the live run. Retained live-proof SHA-256:97be5d954ec95f3a1c3e47fb6c94763b243c404cc173fe3d55ef47203a990db2; served-build proof SHA-256:fba77912d3b5a3391dcfbbd93101782481348f787cc69132335b7bfcf44c0582. The live run is isolated; no production service is changed.Regression and sibling coverage
sessions.createwas deferred. The uncached confirmed-session case reproduced the unnecessary reference wait, and three deferred-preparation cases caught stale navigation ownership.8fed10916a77, including decoded image pending → rejection → restored draft → retry, duplicate-click/keyboard suppression, rich Markdown interaction ownership, same-scope and changed-Gateway reconnects, uncached navigation with delayed roster/reference/startup, background starts, device placement, catalog starts, and GitHub workspace preparation.dceb4340677: 73 tests / 5 suites passed. Current assets still serve directly, and the configured live-test root bypasses retained assets. This supplements the8fedlive proof; it does not relabel that run as a later merge.The first hosted CI run found a real late-cloud-cleanup error-display regression and a route-animation observation race. The display is now owned outside the draft/pending switch; the animation test retains the real animation observation inside its existing frame sampler instead of checking after the animation has finished. Both reproduced locally, were repaired without weakening the behavior assertions, and the next revision's full CI passed. The later run 33602884792 exposed the integration and unrelated test issues described below. Final exact-head CI run 33608588519 passed for
8fed10916a779e5d7c472ee134240acb55385bf2: 153 successful jobs, 12 skipped, zero failures, including all UI shards and lint gates. GitHub had kept the PR pointer on the preceding commit after accepting the push; a single guarded close/reopen recovered the PR lifecycle and launched this run without changing source or bypassing any gate. The final run needed no retry.Startup-cost cross-check and review decision
Related startup work #136021 has now landed on main. Before the final error-display and passive-Markdown refinements, this patch was applied cleanly to that PR's exact head (
321d74e6ed4bd113d394ec996af00190f1bb2b80) in isolated scratch copies, with canonical boot manifests regenerated and both variants built. Three cold/newcontexts produced identical requested/parsed source sets.The full Chat page/pane, message group/bubble, tool cards, and widgets stayed out of
/new. The formatted preview added shared Markdown/highlighting/sanitization and media code: +1 JS request and +125,348 gzip bytes (+15.3%) versus #136021 alone. That measurement belongs to the earlier candidate, not an assertion of the final candidate's exact byte delta. Both comparison builds passed their budgets, as did the final candidate's canonical build.The integrated source now regenerates the manifest through its canonical generator, with byte-identical independent captures. On main
9e6912ca0d2plus the preview, this removes an unintended New Session-only chunk from Chat: 44 → 43 JS requests and −39,830 gzip bytes;/newstill excludes the full Chat renderer/tool/widget graph. Both grouped builds pass existing budgets.The exact
8fed10916a77canonical build passes unchanged limits: startup JS 8 requests / 345,591 gzip bytes (limits 18 / 349,244); largest ordinary JS chunk 214,851 / 220,160 bytes; startup CSS 1 request / 44.8 KiB (limits 1 / 45.0 KiB); largest CSS 54,783 / 54,784 bytes. All 792 precompression sidecars verify. CSS has only one byte of remaining headroom, so the exact merged-commit rebuild is particularly important.The newer main revision
c35350c92d8609d28dfcf190197ec22583e62ea3changes three shared-menu modules. A genuine pinned merge with8fed10916a779e5d7c472ee134240acb55385bf2is clean (treece11478daa83324bfe08d4bca42b052477bd5c80), and its canonical generator reproduces the committed manifest byte-for-byte. The canonical UI build passes all existing budgets and 792 sidecars, with 8 startup JS requests / 345,592 gzip bytes. This is prospective composition proof, not a claimed live or landed commit. Three fresh/newcontexts each requested and parsed 34 JS assets / 953,478 gzip bytes, with no full Chat renderer, tool-card or widget modules./chatused 43 JS assets / 1,224,738 gzip bytes without the New Session boot group. There were no browser errors or failed/external requests. All 36,606 tracked source blobs and modes matched the pinned merged tree after generation and build.An earlier ClawSweeper review was bound to the preceding
dcb8revision while GitHub held a stale PR head. That declaration-cache concern is resolved by retaining upstream unchanged in8fedand running the focused current-version regression. The newer review of8fedverifies the live behavior, reports no code/security findings, and retains the final merged-budget check. Further rebasing solely for main advancing is intentionally skipped; the pinned merged tree and hosted CI provide integration evidence, and the exact landed build is verified above.The final pre-merge pin also verifies main
501788b8fcc8249ddcc85f2867005e7175a91b52plus8fed10916a779e5d7c472ee134240acb55385bf2: clean tree55c03b181538b4cc570b00c84d8f4bdb81145cf4, unchanged canonical manifest, all 36,606 tracked blobs/modes exact, and a passing canonical UI build with 792 verified sidecars and 8 startup requests / 345,591 gzip bytes. The intervening UI changes only affect approval-card requester labels and preserve existing module membership; CSS and all other budgets still pass.The rich-preview cost is explicitly accepted for this user-visible capability; there is no zero-growth claim. The ClawSweeper Rank-up budget check is completed in the exact-landed verification above. No budget limits are relaxed.
The review's stored-data-model heuristic does not describe a persistence change: existing JSON parsing was moved with the collapsed message-display renderer. It does not read or write a store, change serialized state, or touch SQLite/schema/migration/protocol code.
Integration fixes found by CI
The CI merge tree exposed the combined page exceeding its size gate by one line; sharing its existing image-viewer callbacks repairs that without raising the limit. A declaration-cache fixture failure was reproduced on unmodified main and repaired independently upstream while this PR was being prepared. The upstream version is retained unchanged; that duplicate test repair is not part of this PR. A dependency-download connection reset occurred before one lint stripe could start. The unrelated dashboard-reload case passed unchanged both alone and in the original local shard; the original CI failure remains unreproduced, not claimed fixed or hidden by a speculative patch. The local shard hit a different pre-existing click timeout, so it is not reported as an entirely green shard.
Scope and follow-ups
Production delta is +180 lines, tests +243, generated boot-manifest data +2, docs +2, and the assertion-baseline change is net zero. Pure renderer/access-policy moves are not new behavior. The growth provides the immediate readable pending surface and lifecycle-bound handoff; the old submission boolean, duplicate reference wait, and former text-rendering location are removed rather than retained as parallel flows.
Named adjacent follow-ups, not claimed fixed here: profile the full session-index load/clone during Gateway creation before attributing throughput cost; investigate dynamic-route preloading's exact-route matcher; reproduce the existing background-start choice recovery edge across reconnect before changing that contract. These do not weaken the live-tested foreground send repair.