Repository navigation
fix(app): isolate permission replies from renderer stream pressure - #5070
Conversation
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.
|
Test evidence — fixed: external-directory Allow once under real SSE pressure preserves unrelated approval and recovers independently of inference — ✅ passedSHA 9124552 · engine v1 ✅ 0/2 screenshots passed · 3 assertions · 3 expectations passed · 0 failed · 0 pending [world] mock(mcp) · desktop(local) · workspace(/tmp/openwork-permission-pressure-1789598153098/workspace) · [seed:raw] evalIn() ×3 ℹ️ ASSERTION — 1. Permission acknowledgement does not need final inferenceThe real pending request disappeared, exactly one reply succeeded and the read output contains the fixture marker while the mock final response remains held and final text is absent; the unrelated request and transcript are unchanged.
ℹ️ ASSERTION — 2. Native Stop cleans up its pending external-directory requestAfter pressure release and the approved target's final reply, a trusted user Stop click removes the remaining native request through exactly one successful main-process reject reply scoped to it, with no once/always grant, duplicate, or renderer reply. Its read remains in error with no output and no final inference; the completed target transcript and earlier approval replies are unchanged. This verifies existing native Stop behavior, not an isolation improvement.
ℹ️ ASSERTION — 3. Fresh work after native StopA fresh composer turn completes exactly once without reload, new pending permissions, additional replies or grants for the stopped request, final inference for the stopped turn, or changes to its interrupted read and the approved target transcript. The stopped request retains exactly one scoped main-process reject reply and no renderer reply.
⚪ UNVALIDATED — 4. fixed: external-directory Allow once under real SSE pressure preserves unrelated approval and recovers independently of inference artifact 2
⚪ UNVALIDATED — 5. fixed: external-directory Allow once under real SSE pressure preserves unrelated approval and recovers independently of inference artifact 8
Test run created 2026-09-16T22:35:53.057Z · Source: |
Test evidence — finite archive and permission IPC preserve scoped requests, cancellation, no retries and external trust boundaries — 0/0 screenshots passed · 2 assertionsSHA 9124552 · engine v1 ✅ 0/0 screenshots passed · 2 assertions · 2 expectations passed · 0 failed · 0 pending verdict unknown · 0 user observations · 0 probes · steps 0/0 ℹ️ ASSERTION — 1. Archive and permission transport retain safety and external networking policynode --test --test-concurrency=1 apps/desktop/electron/finite-http-fetch.test.mjs apps/desktop/electron/no-bare-external-fetch.test.mjs
ℹ️ ASSERTION — 2. Archive and permission transport retain safety and external networking policybun test --isolate tests/opencode-archive-transport.test.ts tests/opencode-stream-timeout.test.ts 50 pass
50 pass Test run created 2026-09-16T22:38:05.301Z · Source: |
Test evidence — regression: sidebar archive succeeds while real same-origin HTTP/1.1 SSE pressure remains held — ✅ passedSHA 9124552 · engine v1 ✅ passed · 2 expectations passed · 0 failed · 0 pending [world] desktop(local) · [seed:raw] evalIn() · mock(mcp) · workspace(/tmp/openwork-session-archive-1789598362658-48880-a) · [seed:raw] evalIn() ×24 ℹ️ ASSERTION — 1. Network pressure is real rather than a blocked JavaScript promise4 injected SSE streams delivered bytes on distinct HTTP/1.1 connections; excess streams and the two-second GET had no headers. Renderer timers/frames advanced and runner-side engine reads succeeded.
ℹ️ ASSERTION — 2. Fixed-mode UI archive succeeds under sustained real connection pressureThe target was archived by the trusted sidebar click while the same 4 injected SSE connections stayed open; a subsequent raw renderer GET still queued. All neighbors remained unarchived and idle.
Test run created 2026-09-16T22:39:02.360Z · Source: |
|
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 (224288 ms), confidentiality-review (79477 ms), spec-provenance-review (128219 ms), desktop-den-sync-review (231586 ms), design-spec-review (202556 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 (9124552c473cf94ca0349c27af81edd884b9b828). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
|
Merge gate verified at head 9124552: openwork-tests-required SUCCESS; both warden check runs SUCCESS; all CodeQL analyses/aggregate SUCCESS; exact-head diff-warden APPROVED; zero unresolved review threads (no pagination); mergeStateStatus CLEAN. All three commits have verified signatures and matching DCO; no policy files changed. Head permission/native-Stop/fresh-work, transport and archive-pressure evidence is published above. No stacked PR targets this branch. Proceeding with explicitly authorized squash merge; retaining branch/worktree. |


Summary
Permission buttons now send their finite replies through the existing isolated desktop loopback transport, so Allow once / Allow for session / Deny do not queue behind renderer event-stream sockets. In local isolated Electron, Allow once acknowledges in 54.6 ms while pressure remains held, versus a 10,032 ms timeout with zero wire replies on baseline. The target read proceeds while final inference is deliberately held. Deadlines, scoped cancellation, no replay, and native Stop withdrawal are preserved.
This does not fix the SSE-per-workspace connection-budget root cause or isolate all engine operations: ordinary prompt send and full Stop verification are owned by the coordinated
fix/prompt-send-isolated-pathlane; question replies, ordinary session metadata writes, and unrelated reads remain follow-ups owned by the transport audit/coordinator. #5063 owns the existing archive isolation precedent; #5014 bounds archive verification. The separate engine-reload/rollover setup defect described below is also left to the audit follow-up, not hidden with a fixture retry. No composer/retry UI, policy, provider-inference transport, or stream ownership changes.The cause reproduced here is Chromium per-origin HTTP/1.1 pool starvation. Permission acknowledgment is a local renderer → server → engine operation that settles a pending deferred; it does not wait for resumed inference. The installed incident was not instrumented, so this proves the same failure mechanism, not definitive attribution of that particular incident. Full analysis/options/source chains:
reports/rca-permission-reply-timeout-2026-09-16.md.Implementation
desktopFetchViaMain; the existing explicitcreateClient(..., {desktopTransport: "main"})API stays unchanged.Before / after — isolated testkit Electron only
Before — permission card after Allow once under held SSE pressure, baseline
c4356f0a2: Request timed out; no reply reached the engine.After — same permission action on head
9124552c4: card dismissed, read completed; SSE pressure and final-inference hold still active.These are authentic, manually inspected reference captures, not testkit vision certifications. Raw source-Electron sidebar transparency is not a claimed visual fix. No layout/copy change; behavior changes visibly, so both captures are included.
Verification — local lane explicitly requested
Head
9124552c473cf94ca0349c27af81edd884b9b828; mise Node 24.20.0 / Bun 1.4.0 / pnpm 11.4.0. No installed-app CDP or engine database access.OPENWORK_DEV_SHARED_STATE=0 OPENWORK_PERMISSION_PRESSURE_MODE=fixed pnpm evals:e2e permission-pressure --local --engine v1 --surface electronpnpm evals:pr specs/session-archive-transport.test.tsOPENWORK_DEV_SHARED_STATE=0 OPENWORK_ARCHIVE_PRESSURE_MODE=fixed pnpm evals:e2e session-archive-pressure --local --engine v1 --surface electronpnpm typecheckpnpm --filter @openwork/desktop typecheck:electronRevert-fails: restore the three production transport files from
b99617f10, keep the same fixed-mode pressure test: exit 1, 0 passed / 1 failed / 0 skipped, timeout 10,032.1 ms, zero wire/main replies. Restore fixed files immediately. This historical dirty-baseline receipt is explicitly not head-pass evidence.Other checks retained, not misreported green: selected existing parent/child approval case passed (three other cases filtered). Existing Stop fixture fails before assertions at
worlds/chat.ts:179, engine reload 503; the exact same command on a new cleanorigin/devcontrolc4356f0a2reproduces the same error (each 0 passed / 1 failed / 3 filtered). Root cause is an endpoint copy stale across provider rollover. The new pressure fixture independently proves native Stop cleanup and fresh work without changing that failing fixture. Supplemental evals layer lint exits 54 on off-scope layer imports; no clean-control attribution or broad lint repair claimed.All three commits are signed and DCO-signed-off. No policy files changed. Head evidence is published in PR comments; CI/review gates are checked live before merge.