Repository navigation
fix(composer): keep the prompt box editable when the session snapshot fails - #4392
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 4 Skipped Deployments
|
… fails The Lexical editor was disabled whenever the session render model was not idle (e.g. a background snapshot refetch failing) or the model was unavailable. Lexical renders a disabled editor identically to an empty one, and the failure UI only shows when no transcript is cached, so users saw a normal-looking prompt box that swallowed keystrokes. The editor is now always editable; `disabled` only gates Enter-submit and the send button, which handleSend already guards independently. Adds a dev-only `eval.session_snapshot.fail` control action, a bun unit test that fails without the fix, and an e2e spec + world for the snapshot-error scenario.
5b86e98 to
0693680
Compare
Test evidence — the-composer-stays-editable-while-the-session-snapshot-query-is-in-error — ✅ passed✅ passed · 0 expectations passed · 0 failed · 0 pending [world] desktop(daytona) · workspace(/tmp/openwork-composer-snapshot-failure-1788542765796) · session("Composer snapshot failure proof") · [seed:raw] evalIn() ×2 Test run created 2026-09-04T17:24:24.401Z · Source: |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (174bf5e8c6ee8760da430661f3a0d3df596c873b). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Problem
Reported in #bug: "Under certain circumstances, the OpenWork prompt box does not allow me to type into it." Screenshot showed an empty composer with placeholder, a wide selection-style caret, "Jump to latest", idle session, no error.
Root cause:
session-surface.tsxpasseddisabled={model.transitionState !== "idle" || sessionModelUnavailable}to the Lexical editor.transitionStatebecomes"failed"on anysnapshotQuery.isError(or localerrorstate — including a failed clipboard copy). Two things made it invisible:contenteditable="false"<p><br></p>draws exactly the wide highlight in the screenshot.refetchOnWindowFocus) locked the composer with nothing on screen.The gate was inherited wholesale from the Solid→React port (#1470) with no rationale; #4108 already removed it for the
isFetchingbranch for exactly this reason.Change
editor.tsx/composer.tsx: the editor is always editable.disabledis renamedsubmitDisabledon the editor and only gates Enter-submit. The send button andhandleSendguards are unchanged.session-surface.tsx: dev-onlyeval.session_snapshot.failcontrol action (same pattern as the othereval.*hooks) that forces the snapshot query into error state and returns{ ok, isError }.retrynow reads the eval flag at fetch time; default behaviour (3 retries) is preserved.new-task-composer.tsxneeds no change: itsdisablednow only blocks send, as intended.Verification
Unit (bun) —
apps/app/tests/composer-editable-on-snapshot-error.test.tsxrenders the realSessionSurface, fails the snapshot refetch, and asserts the editor stayscontenteditable="true", typed text lands, the send button stays disabled,onSendDraftis never called, and the cached transcript is preserved; also covers the model-unavailable case.Confirmed red without the fix: with
editor.tsx/composer.tsxstashed the new test fails (0 pass, 1 fail).E2E (testkit) —
evals/specs/composer-editable-during-snapshot-error.e2e.test.tswith worldsnapshotFailureinevals/worlds/chat.ts(seeds a transcript, executeseval.session_snapshot.fail, throws unlessisError: true). Claims: composer editable + typed text lands; negative: text is not in the transcript (no send) and the seeded transcript literal is still visible. Channel ratchet: 0 raw escapes;pnpm --dir evals typecheck:spec-layerexit 0.Verdict: Passed on Daytona against the PR head (see the test-evidence comment). The earlier red runs were the engine-bootstrap hang diagnosed in #4423; #4397 pre-seeds the engine cache in eval sandboxes, which is why this now runs.
Pre-existing unrelated bun failures on
origin/dev(not touched here):connect-capability-inventory,app-inspector,cloud-workspace-overlay,session-provider-auth-server-sync.Follow-ups (out of scope)
error, which still disables send until dismissed; theSessionErrorCardrenders at the top of the transcript where it can be off-screen.