Repository navigation
fix(chat): isolate prompt send and Stop from stream pressure - #5074
Conversation
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
Signed-off-by: Guillaume Loret <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Passed · 12/12 tests · 18/18 assertions · 8 images Commit |
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 (162753 ms), confidentiality-review (209108 ms), spec-provenance-review (306344 ms), desktop-den-sync-review (346375 ms), design-spec-review (410802 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 (3d8d4b3dd12fb2a59cdfa6405c9fa88979583c64). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Detailed local assertion evidence at 3d8d4b3Commit This lane could not publish a hosted report because its private review Blob token was absent. This is the explicitly authorized all-assertion fallback, supplementing—not replacing—the separate exact-head hosted report already present on this PR. No upload was retried. All three legacy Selected run index
All screenshot artifacts below are reference captures without visual expectations: no pending visual claims. Their UNVALIDATED labels and the raw screenshot summary are retained honestly; they do not change the passing test-body/assertion outcomes. The PR body already embeds public before/after screenshots. Local fixture workspace paths are redacted only in this public rendering; receipts are unchanged. Historical negative control — not selected passing evidenceThe Run 1/3 — 1 recorded assertion, all passedRun ID: Spec: Test evidence — scoped send preflight and Stop retain ownership, interruption and environment contracts — passedSHA 3d8d4b3 · engine v1 passed · 1 expectations passed · 0 failed · 0 pending
verdict passed · 0 user observations · 0 probes · steps 0/0 ASSERTION — 1. Only opted-in preflight and complete Stop reads use main transport; ordinary reads, ownership and no-replay behavior remain intactpnpm --dir apps/app exec bun test --isolate tests/session-stop-refresh.test.ts tests/session-send-isolation.test.ts tests/env-context.test.ts tests/session-ownership.test.ts tests/opencode-session-native.test.ts tests/safe-edit-resend.test.ts tests/session-history.test.tsx tests/session-scroll.test.tsx tests/session-stop-refresh.test.ts: When testing, code that causes React state updates should be wrapped into act(...): act(() => { This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act When testing, code that causes React state updates should be wrapped into act(...): act(() => { This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act When testing, code that causes React state updates should be wrapped into act(...): act(() => { This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act When testing, code that causes React state updates should be wrapped into act(...): act(() => { This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act tests/session-history.test.tsx: When testing, code that causes React state updates should be wrapped into act(...): act(() => { This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act When testing, code that causes React state updates should be wrapped into act(...): act(() => { This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act 200 pass
tests/session-stop-refresh.test.ts: When testing, code that causes React state updates should be wrapped into act(...): act(() => { This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act When testing, code that causes React state updates should be wrapped into act(...): act(() => { This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act When testing, code that causes React state updates should be wrapped into act(...): act(() => { This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act When testing, code that causes React state updates should be wrapped into act(...): act(() => { This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act tests/session-history.test.tsx: When testing, code that causes React state updates should be wrapped into act(...): act(() => { This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act When testing, code that causes React state updates should be wrapped into act(...): act(() => { This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act 200 pass Test run created 2026-09-16T23:13:38.803Z · Source: No screenshot or JSON sidecar artifacts in this run. Run 2/3 — 2 recorded assertions, all passedRun ID: Spec: Test evidence — fixed: ordinary prompt and Stop under sustained renderer SSE pressure — passedSHA 3d8d4b3 · engine v1 0/3 screenshots passed · 2 assertions · 2 expectations passed · 0 failed · 0 pending
[world] desktop(local) · [seed:raw] evalIn() · mock(mcp) · workspace([isolated session fixture workspace]) · [seed:raw] evalIn() ×24 ASSERTION — 1. Ordinary send bypasses sustained SSE pressure exactly once without restoring the submitted draftStarting=9.199999928474426ms; user bubble=9.199999928474426ms; prompt POST=32ms. Exactly one native user admission and provider request; witness completed while streams stayed held and the newer draft survived.
ASSERTION — 2. Normal Stop completes abort, ownership, transcript, idle, approval reads and final refresh while renderer GETs still time outStop settled in 645.0172080000011ms. Neighbor sessions remained idle, unarchived and empty; newer composer draft remained unchanged. Two deliberate prompts total, no replay.
UNVALIDATED — 3. fixed: ordinary prompt and Stop under sustained renderer SSE pressure artifact 3
UNVALIDATED — 4. fixed: ordinary prompt and Stop under sustained renderer SSE pressure artifact 6
UNVALIDATED — 5. fixed: ordinary prompt and Stop under sustained renderer SSE pressure artifact 9
Test run created 2026-09-16T23:13:42.410Z · Source: Reference artifact source paths (local receipts, not hosted links):
Run 3/3 — 1 recorded assertion, all passedRun ID: Spec: Test evidence — terminal provider rejection before assistant text has an attributable visible outcome — passedSHA 3d8d4b3 · engine v1 0/1 screenshots passed · 1 assertion · 1 expectations passed · 0 failed · 0 pending
[world] desktop(local) · workspace([isolated provider fixture workspace]) · [seed:raw] evalIn() ×3 · sessions(1) ASSERTION — 1. Terminal provider rejection is visible, with one admission and no assistant text or silent bounce{"visibleError":true,"silentBounce":false,"draft":"","status":[],"actions":["Run task"],"admissions":1,"providerMarkerRequests":1}
UNVALIDATED — 2. terminal provider rejection before assistant text has an attributable visible outcome artifact 3
Test run created 2026-09-16T23:14:15.820Z · Source: Reference artifact source paths (local receipts, not hosted links):
|
Summary
Ordinary desktop prompt sends and normal Stop now use the existing isolated finite HTTP transport for their required reads and writes. Under sustained renderer SSE pressure, a prompt reaches the engine once without returning to the composer, and Stop finishes its ownership, idle, approval and history verification. Newer composer text remains intact. Paged-history refreshes preserve the current window, owner cancellation and terminal tool reconciliation.
This does not implement offline waiting/retry UI, automatic replay, durable server admission, server-reload deduplication, or gateway reliability. Those remain the connection-interruption/composer work owned by Jalil; #5030 provides retained diagnostics, #5065 covers queue recovery, #4950 owns honest headless create receipts, and #4945 owns gateway terminal observability. It does not claim to explain the originally reported silent bounce: our pressure baseline produces a visible timeout. Sessionless creation, uploads, shell/command/edit-resend and v2 send transport remain outside this change.
Context and scope
The #5063 archive fix established that IPC alone is insufficient: finite loopback HTTP needs isolation from Chromium's occupied SSE pool. This change opts scoped prompt and Stop clients into that existing API, without editing the shared transport implementation from #5070. Background subscriptions remain unchanged. Jalil's #5069 paged-history behavior is retained: send preflight and explicit Stop refresh select main transport without replacing cursor, window, ordering or ownership rules.
The baseline displays Starting immediately, then returns the draft after about 10 seconds with
Request timed out.; no prompt is admitted. This is a preflight starvation reproduction, not proof that a dispatched prompt was silently dropped. A separate real-engine/provider witness verifies that an HTTP 400 before any assistant text produces a visible error and does not bounce the draft.Verification
Local source-built isolated Electron, pnpm 11.4.0 / Bun 1.4.0 / Node 24.20.0. No installed-user app, credentials, transcripts or engine database inspected.
Exact head:
3d8d4b3dd12fb2a59cdfa6405c9fa88979583c64.pnpm evals:pr specs/session-send-isolation.test.ts— Passed; 200 tests across eight underlying files, 2128 expect() calls, zero failed/skipped; wrapper outcome passed with 1 recorded assertion.pnpm evals:e2e session-send-pressure --local --engine v1 --surface electron— Passed, 1/1, zero skipped. Starting/user bubble 9.2 ms; prompt POST 32 ms; Stop with verification/refresh 645 ms. One initial native admission/provider request, no replay, newer draft preserved, neighbor sessions unchanged. Real HTTP/1.1 streams remain held and a renderer canary still times out.pnpm evals:e2e session-provider-attribution --local --engine v1 --surface electron— Passed, 1/1, zero skipped. One admission, one terminal provider HTTP 400, zero assistant text, visible error, empty composer.pnpm typecheckandpnpm --dir evals typecheck— exit 0 (473 evals files).Head-matching test evidence is published in the evidence comment. Starting is measured by a DOM observer; the screenshot below honestly captures the subsequent Working state, not a fabricated transient frame.
Supplemental detailed assertion evidence
This lane could not publish a hosted report because its private Blob token was absent. The explicitly authorized all-assertion fallback detail is published as a non-sticky supplemental comment. A separate exact-head hosted report is also present and preserved; the limitation applies only to this lane, not hosted publication globally. No uploads were retried and no comments were deleted or overwritten by this supplemental publication.
3/3 selected local runs passed; 4/4 recorded assertions passed; 0 failed or pending assertions. The supplement includes every recorded assertion, full evidence text, reproduction command and workspace-relative source path. The scoped wrapper covers 200 passing underlying tests across eight files and 2128 expect() calls.
evals/results/test-runs/2026-09-16T23-13-38-802Z-scoped-send-preflight-and-stop-retain-ownership-interruption-and-environment-con2026-09-16T23-13-42-409Z-fixed-ordinary-prompt-and-stop-under-sustained-renderer-sse-pressure2026-09-16T23-14-15-819Z-terminal-provider-rejection-before-assistant-text-has-an-attributable-visible-ouThe historical
2026-09-16T23-12-58-233Z-fixed-ordinary-prompt-and-stop-under-sustained-renderer-sse-pressurerun intentionally used a dirty tree at the same recorded SHA with transport opt-ins removed; it failed after 12 seconds with zero admissions. It is not selected fixed passing evidence and remains historical, not replaced. The three selected passing receipts followed restoration. Screenshots are reference captures with no pending visual claims; existing public screenshot embeds below are preserved.Broader checks and limits
A clean separately installed dev control at
74f1b2833194238ae6b6710026d4ba5cb54259careproduces identical existing failures:pnpm --dir evals lint:layers(54 diagnostics),pnpm --dir evals typecheck:spec-layer(14 diagnostics), and the composer-continuity suite (6 pass / 1 fail, expected 8 sends versus 9). These do not waive required CI checks. An optional full v2 suite additionally exposed a model-catalog null-effort expectation mismatch; not classified pre-existing without its own clean control. The targeted v2 pagination tests pass (10 selected tests; unrelated cases filtered, not claimed as full-suite proof).Engine-restart-between-admission attribution remains untested. No claim is made about every gateway failure, secondary-pane pressure or live delegated-child pressure.
Screenshots
Before — isolated conversation under held stream pressure: timeout is visible and the original prompt has returned to the composer (historical baseline
c4356f0a2).After — isolated conversation, same pressure still held: admitted prompt is Working and newer draft remains unsent (final head).
After Stop — isolated conversation, pressure still held: Stop has settled including verification and refresh; newer draft is preserved (final head).
Reference captures are authentic and unmodified. Existing sidebar contrast limitations are visible; this PR changes no visual styling. Screenshots illustrate machine-checked behavior and are not separate visual pass/fail claims.