Repository navigation
Conversation
… message without waiting for the page to load (#2158) A new chat's first message waited on `await startTransition(...)` in submit.ts. Solid resolves that promise only when the transition settles, i.e. when every resource the new session page reads has loaded, and it keeps one global transition, so concurrent new chats were all released at the same instant. On a busy engine (event-loop lag ~4 s) that was 10-30 s with the composer still showing the text. - transition-started.ts: run the navigation in the transition but resume once its callback has run; the settle is handed back separately. - submit.ts: send the first message as soon as the route is promoted; the new-chat gate is held until the navigation settles. - new-session-gate.ts: the in-flight set is a signal, exposed as isNewSessionStarting(newSessionKey(...)). - new-session-starting.tsx: a 'Starting session…' status under the new-chat composer from the moment Enter is pressed until the session page shows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
3 tasks
jacktrnr
marked this pull request as ready for review
November 23, 2026 22:13
Contributor
Author
|
Verified hands-on in the combined 0.4.1-beta test build ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2158. Follows #2159 (#2157, the duplicate-session gate), which changed the same new-chat submit path.
Problem
A new chat's first message went out 10–30 s after the session was created on a busy engine. During that time the composer still showed the text and nothing on screen changed.
Root cause
After
session.create,submit.tsranawait startTransition(...), which promotes the draft tab to the session and navigates, and only then sent the prompt. In Solid (1.9.10,dist/solid.js), the promise fromstartTransitionresolves only when the transition settles, meaning every resource the new session page reads inside it has loaded. Solid also keeps one global transition:t = Transition || (Transition = {...}), so every transition started while one is pending joins it.On the busy engine (
SSE-TICK lag_ms3921–4152), each of the session page's reads took seconds, so the send waited for all of them. The shared transition explains the evidence in the issue: five "testing" sessions created over 21 s (15:08:49–15:09:10) all sent their first message at 15:09:14.0. Every one of them was waiting on the same settle.The send never needed the settle. It only needs the transition callback to have run, so that the route is promoted and the prompt is retargeted.
Fix
transition-started.ts(new):whenTransitionStarted(fn)runsfninside a Solid transition. It resolves as soon asfnhas run and returns{ settled }separately. Iffnthrows, it rejects, so a failure surfaces instead of hanging.submit.ts: a new chat now sends its first message as soon as the route is promoted, without waiting for the session page to load. The new-chat gate from New chat creates duplicate sessions with the same first message when Enter is pressed again while it starts #2157 is still held until the navigation settles, so the duplicate-session protection behaves as before.new-session-gate.ts: the in-flight set is now a Solid signal. It is exposed asisNewSessionStarting(key), withnewSessionKey(scope, directory, draftId)as the single key builder for both the submit and the view.new-session-starting.tsx(new) +new-session-view.tsx: a "Starting session…" status with a spinner under the new-chat composer. It appears on the same tick as Enter and stays until the session page replaces the view.text-v2-text-text-muted,text-v2-icon-icon-muted) and no accent, per the design system.aria-live="polite"role="status"region that is always mounted. It usesdisplay: contents, so it takes no space until it shows.en.ts: addsprompt.newSession.starting. Other locales fall back to English.Out of scope: moving engine-side session-start work off the event loop (the issue's item 3; no engine re-architecture for the beta). The Concise toggle code (#1650) is untouched.
Verification
Tests ran from the materialized tree with
bun test --conditions=solid --preload ./happydom.ts.new-session-gate.test.ts: 11 pass. The new tests check:solid-jsto its server build here and effects do not run);newSessionKeybuilds the right key.transition-started.test.ts(new): 5 pass. The tests check:startTransitionwhose settle is held open, the helper resumes once the callback has run and does not wait for the settle;settledstill reports the settle;submit.tsno longer containsawait startTransition(, and the gate is held until navigation settles.new-session-view.test.ts: 7 pass. Three new pins check that the notice renders under the composer, reads the gate with the submit's key, and is anaria-livestatus with a spinner and an i18n key.toaster,base64Decode) insubmit.test.ts,submit-concise.test.ts,harness*.test.ts;window.getSelectionmissing in happy-dom foreditor-dom.test.ts;overlay_typecheck_gate.sh: clean across 7 packages.tsgo -binpackages/appis clean.refresh_manifestthendrift_gate: PASS (1085 overlay files)../.notturno/gates(drift, typecheck): GREEN.Not tested by hand in a live window, because that needs a rebuilt engine binary and VSIX. Issue AC 3 (first send within 1 s of create on an idle engine) follows from the send no longer waiting on the page load, but it has not been measured live.
🤖 Generated with Claude Code