Repository navigation
fix(app): stop persisting hero keystrokes to the new-task draft slot once a send is in flight - #4861
Conversation
…okes into the next composer
…once a send is in flight
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
Warden review summary — ClearNative findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (20298 ms), confidentiality-review (17946 ms), desktop-den-sync-review (17742 ms). Blockers
Advisories
Needs recheck
Observed review-thread metrics
Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority. |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (69c17c52431cfd8016f5159c5f2c52fd7f18490b). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
|
Passed · 12/12 tests · 18/18 assertions · 8 images Commit |
Root cause
Regression from #4796 (
e925c7c99), flagged by the E2E risk gate as a new class (c) product regression ondev(workspace-new-task-hit-target— "Keep new tasks and sends instantly responsive" — red vs the last 3 nightlies at2fcbae60eand3f783066f, run 34519630856; gate table:/Users/guillaume/OpenWork Chat/reports/e2e-gate-baseline-2026-09-10.md).#4796 made
SessionEmptyHeropersist everyonDraftChangeinto the per-workspace__new-task__draft slot so an unsent prompt survives opening another session.NewTaskComposer.handleRunTaskclears the draft (onDraftChange(""), which empties the slot) and thenawaits session creation while the composer stays live. Anything typed during that pending window flows through the sameonDraftChange→ herosetPrompt→ persisted into__new-task__, even though that text is already carried into the created session as the continuation. The next New task hero hydrates from the slot and comes up pre-filled.Gate signature (run 34519630856 at
3f783066f): sample 2insertFocusedText→Error: Focused composer did not retain native insertTextatworkspace-new-task-hit-target.e2e.test.ts:336— the hero already containedINSTANT-PENDING-DRAFT-B-…from sample 1, so the caret sat before it.What changed
apps/app/src/react-app/domains/session/chat/session-empty-hero.tsx(+20/−3):sendInFlightRef). While set,setPromptstill updates local state but no longer persists to the__new-task__slot — those keystrokes belong to the created session (continuation), not to the next new task.The brief's step (2) — an explicit clear when the created session's route lands — turned out to be redundant: the composer already empties the slot synchronously at send time (
onDraftChange("")) and, with (1), nothing writes it afterwards while the send is pending. I left it out to keep the diff minimal; happy to add it as belt-and-braces if preferred.apps/app/tests/new-task-draft-send-in-flight.test.tsx(new): realSessionEmptyHero+ realNewTaskComposerwith only the Lexical editor stubbed by a textarea. Type → Run task (creation pending) → type while pending → resolve, route lands (hero unmounts) → reopen New task → composer and slot must be empty; then a failing send must re-persist the typed text.Proof
Unit / types
Expected: "" / Received: "and also check the rollback plan"(red, commit5f2d534d7); green with the fix (69c17c524).bun test --isolate tests/new-task-draft-send-in-flight.test.tsx tests/new-task-draft-state.test.tsx→ 3 pass (fix(app): keep an unsent new-task prompt reachable after opening another session #4796's own tests stay green).pnpm --filter @openwork/app test:core→ 225 pass, 0 fail.pnpm --filter @openwork/app typecheck→ clean.pnpm --filter @openwork/app test(fullbun test --isolate tests/) did not complete: the runner stalls aftertests/opencode-session-native.test.tswith no child process (reproduced twice, log silent >10 min) — unrelated to this diff, but I could not obtain a full-suite verdict.tests/composer-focus-continuity.test.tsxis red identically on unmodified code (SyntaxError: Export named 'deleteNativeSession' not foundin bun's isolate loader) — pre-existing.E2E —
workspace-new-task-hit-targetThis spec is a local-placement contract:
workspaceNewTaskthrowsSkipErrorunlessplace.kind === "local", sopnpm evals:e2e workspace-new-task-hit-target --daytonaskips by design (skipped: 1,cli-run-1789074523605). The gate runs it via the "Product journeys" workflow (daytona-e2e.yml,--localon a Linux runner), so I dispatched that workflow — the exact gate environment:fix/new-task-draft-slot-leak(this PR, onorigin/dev@9a60a4b59)69c17c524:379—Timed out waiting for prompt request is held … held: 0(auto-send of the first lazy send never fires; screenshot shows the created session with aCancelledErroralert)proof/new-task-draft-slot-leak-on-3f78306= gate sha3f783066f+ these two commits (cherry-picked, signed)c29f789cfc29f789cfThe
:379failure on this branch is not caused by this change: a clean control on my machine with source identical toorigin/dev(9a60a4b59, fix reverted) fails identically at:379, and so does the fixed branch. Bisecting3f783066f..9a60a4b59with the same workflow (all failing at:336= the leak only, i.e. auto-send still fine, unless noted):7f8008d58(fix(app): interrupt delegated work before immediate follow-ups #4837) and its parent →:336dd7fae8dd(fix(apps): isolate embedded MCP App documents #4829) →:3364462762b4(perf(chat): prioritize visible thread history and preserve scroll #4838perf(chat): prioritize visible thread history and preserve scroll) →:379← first bad; the only commit in between (e4e316d41) is den-api docs0d0b835ac,bf722d514(fix(app): preserve the v2 sessionless first prompt #4777) →:379505583fb7(fix(app): recover Connect after transient startup failures #4782) →:455(reload-transcript timeout, seen once — possibly flaky; not investigated)So
devcurrently carries a second, independent regression from #4838 that breaks the first lazy send's auto-send and masks this spec before it reaches the point this PR fixes. This PR fixes the #4796 leak (proven at the gate sha); the gate spec will stay red ondevuntil #4838's regression is addressed.Local macOS runs of the spec (
--local, both fixed and control) also fail at:379; evidence underevals/results/test-runs/2026-09-10T21-11-34-087Z-…(fixed),…T21-22-08-292Z-…(fixed, quiet machine) and…T21-26-35-317Z-…(control, unmodified source) (renderer diagnostic + screenshot with theCancelledError).E2E — #4796's behaviour (
evals/specs/new-task-draft-return.e2e.test.ts, appWeb)OPENWORK_EVAL_REF=69c17c524 pnpm evals:e2e new-task-draft-return --daytona→ 2 passed, 0 skipped (both sandboxes auto-deleted).Noticed but not touched
CancelledErrorin the session surface); breaksworkspace-new-task-hit-targetondevindependently of this PR. Likely interacts with fix(app): interrupt delegated work before immediate follow-ups #4837's newsubmitImmediateSessionTurn(..., snapshot?.messages, …)insendDraft.bun test --isolate tests/stalls afteropencode-session-native.test.tson macOS (parent process idles with no child).composer-focus-continuity.test.tsxpre-existing red under bun isolate (deleteNativeSessionexport cycle).proof/new-task-draft-slot-leak-on-3f78306is kept only as the referent of the two green runs; delete after review. Bisect branches were deleted.