Commit Graph
79 Commits
Author SHA1 Message Date
Brennan Benson 0b6417bbb4 Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen
# Conflicts:
#	config/reliability-gates.jsonc
#	src/main/runtime/orca-runtime.ts
2026-07-13 20:06:10 -07:00
Jinjingandbbingz 1d2aaf1bf5 Fix recipe serve desktop promotion (#8646)
* fix(runtime): preserve terminals during headless desktop activation

* rm design doc

* Fix desktop activation launch ordering and blocked-window status resolut

- Check desktopWindowStatus before spawning the Orca app so a blocked
  runtime no longer launches a doomed second instance.
- Reuse resolveDesktopWindowStatus for remote runtime status so it
  honors the same authoritativeWindowId fallback as local status.
- Re-check the authoritative window at spawn time instead of trusting
  a possibly-stale snapshot, since it can be destroyed mid-await.
- Harden the e2e activation spec against silent spawn failures.

---------

Co-authored-by: bbingz <zzb@gxsmjx.com>
2026-07-13 19:41:24 -07:00
Jinjing 2801c6b03b P2 live log undo memory (#8644)
* fix(editor): avoid undo history for read-only live tails

* Add reliability-gate evidence for read-only live-tail undo-history fix

- Records the passing vitest run that verifies live-tail appends leave
  canUndo false while ordinary external updates stay undoable, backing
  the recent editor undo-history fix.
2026-07-13 19:13:19 -07:00
Brennan Benson c509aeceed fix(terminal): serialize daemon session admission 2026-07-13 13:14:40 -07:00
Brennan Benson aa50c6d988 fix(terminal): reject exited daemon admissions 2026-07-13 12:47:49 -07:00
Brennan Benson 5024b4d8d4 fix(terminal): fence synchronous daemon exits 2026-07-13 12:21:01 -07:00
Brennan Benson 4dacb08ec5 fix(terminal): publish daemon sessions before output 2026-07-13 12:00:21 -07:00
Brennan Benson 2384370d25 fix: fence teardown from replacement sessions 2026-07-13 11:43:21 -07:00
Brennan Benson 971b1d9b0c fix: retain terminal shutdown ownership until exit proof 2026-07-13 11:10:20 -07:00
Brennan Benson 7ba4ff0c7e fix: preserve terminal shutdown ownership under concurrency 2026-07-13 10:22:58 -07:00
Brennan Benson 79b6036a7b fix terminal teardown admission and retry races 2026-07-13 09:51:47 -07:00
Brennan Benson 173300196a fix retained terminal shutdown ownership gaps 2026-07-13 09:09:15 -07:00
Brennan Benson 498b3ea3a8 fix terminal exit proof generation races 2026-07-13 08:21:55 -07:00
Brennan Benson 5d607ddbbb Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen
# Conflicts:
#	config/reliability-gates.jsonc
#	src/main/ipc/pty.ts
2026-07-13 07:13:52 -07:00
Brennan Benson 73709e16f2 fix: preserve teardown ownership across fallback paths 2026-07-13 06:31:52 -07:00
Brennan Benson e70046a757 fix: drain terminal owners before process shutdown 2026-07-13 05:46:23 -07:00
Jinjing 6eda9cdb27 fix(ssh): bound healthy relay watcher processes (#8556) 2026-07-13 05:32:31 -07:00
Brennan Benson 0839a48b93 fix: retain daemon and relay shutdown owners 2026-07-13 05:09:54 -07:00
Brennan Benson bfd28680a3 fix: preserve terminal teardown ownership until exit 2026-07-13 04:37:41 -07:00
Brennan Benson a18b7fda26 fix: close terminal removal races 2026-07-13 03:36:31 -07:00
Brennan Benson 9f38d7da18 fix: retain shutdown proof ownership 2026-07-13 03:02:15 -07:00
Brennan Benson d9d04aeeae fix: fence terminal teardown ownership 2026-07-13 02:34:37 -07:00
Brennan Benson 42312ee328 chore: format reliability gate merge 2026-07-12 23:57:23 -07:00
Brennan Benson 106c680000 Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen 2026-07-12 23:55:11 -07:00
Brennan Benson 2ab7a9b46e fix: make teardown journal appends constant size 2026-07-12 23:54:56 -07:00
db9421dd3c Prevent index churn from refreshing worktrees (#8431)
* Prevent index churn from refreshing worktrees

* Cover IPC contract in worktree reliability gate

* Refresh background worktree heads without re-entering structural fanout

External commits, amends, and soft resets in non-active worktrees now reach
store rows through spawn-free Git metadata reads diffed in the watcher's
existing debounce, emitted only on real head moves. HEAD reflog appends become
status-only triggers, config.worktree becomes structural for sparse-flag
freshness, and the non-darwin poller gains a periodic ungated index re-stat
so in-place rewrites on coarse-mtime filesystems cannot be missed forever.

* Reject unsafe symref paths and validate object ids in the head reader

Ref content comes from repo files an attacker can craft. Backslash segments
traverse on Windows where join treats them as separators, and colons are
forbidden in Git ref names; both now fail isSafeRefName before any path is
built. Resolved values are additionally emitted only when they match a hex
SHA-1/SHA-256 object id, so no file content can leak through the identity
event even in principle.

---------

Co-authored-by: Brennan Benson <brennanbenson@Brennans-MacBook-Pro.local>
Co-authored-by: Brennan Benson <>
2026-07-12 23:43:33 -07:00
Brennan Benson afd1b73643 fix: recover torn teardown intent journals 2026-07-12 23:34:46 -07:00
Brennan Benson 57a8b4195d fix: bound durable terminal teardown persistence 2026-07-12 23:20:18 -07:00
Brennan Benson 317a8a52f7 Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen 2026-07-12 22:48:08 -07:00
Jinjing 220811cbad fix(e2e): repair release e2e suite (parking regression tests, stale/flaky specs, profile switcher gate) (#8486)
* fix(e2e): repair release e2e suite — parking regression tests, stale/flaky specs, profile switcher gate

Diagnosed 20 failing tests across the release e2e shards. Most are test debt,
plus two genuine product-side issues.

Product fixes:
- OrcaProfileSwitcher: the PROD gate hid the "Switch profile" button in the
  e2e build (electron-vite build bakes NODE_ENV=production). Exempt
  MODE==='e2e' so the specs render it while packaged prod builds stay hidden.

Parking cluster (8 tests): #8262 intentionally keeps the most-recently-hidden
tab warm (exempt from cold-park). The specs hid exactly one tab — always the
exempt one — so it never parked. Open a throwaway decoy tab that absorbs the
last-active exemption so the target parks. (terminal-hidden-view-parking,
terminal-pane-close-layout-consistency)

Stale tests updated to match intended product behavior:
- rich-markdown-link-bubble: match Edit link by aria-label (title dropped in #8307)
- terminal-codex-hidden-startup-background: drop the dead hiddenRendererSkipCount
  poll (Phase-4 main-side delivery gate #7214 bypasses that renderer path)

Brittle threshold/geometry/timing hardening (no product regression):
- agent-session-log-tail-stability: assert full-model length instead of a
  machine-specific word-wrap pixel baseline
- artificial-opencode revisit: dedicated under-backpressure latency bound
- terminal-history-size-typing-latency: gate p90 not max (tolerate one
  checkpoint-in-window spike; median stays strict)
- combined-diff-scroll-restore: assert viewport barely moved vs exact anchor key
- terminal-shortcuts: idempotent kitty-flag reset instead of a racing stack pop
- agent-session-live-force-exit-resume: drive the product quit-capture path
- renderer-crash-recovery-terminal-input: poll the transport probe over the
  recovery budget (still flags a permanently frozen pane)

terminal-push-delivery-loss-recovery left unchanged (no safe test-only
improvement; recovery is wall-clock bounded with ample slack).

* Extract shared parking helpers into terminal-hidden-parking.ts for e2e s

- Deduplicate waitForTabParked/parkHiddenTabBehindDecoy, previously
  copy-pasted across the parking and layout-consistency specs
- Parameterize parkDelayMs so the helper no longer depends on a
  file-local PARKING_DELAY_MS constant
2026-07-12 22:40:57 -07:00
Brennan Benson 25b6b968b0 merge latest main for PR 8279 validation
# Conflicts:
#	config/scripts/build-relay.mjs
2026-07-12 22:08:09 -07:00
Brennan Benson b2a1411af1 fix: retain terminal teardown ownership 2026-07-12 21:59:20 -07:00
Jinjing e3c47eff17 Fix ssh watcher isolation (#8463)
* fix(ssh): isolate relay filesystem watchers

* Fix relay watcher fault-harness pid file and in-process fallback isolati

- Use exclusive ('wx') creation for the fault-harness pid file so a leaked
  ORCA_WATCHER_CHILD_PID_FILE env var can't clobber an existing file, and
  have the harness remove the file after reading a replacement pid.
- Force useInProcessVitestFallback to false in the relay watcher pool so a
  leaked VITEST env var can never load the native watcher addon in-process
  on the relay; fail closed instead when the isolated child is missing.
- Thread an injectable RelayWatcherProcessPool into FsHandler/
  RelayFilesystemWatchRegistry for tests, and add coverage for both fixes.
2026-07-12 21:34:59 -07:00
Brennan Benson 28444bd984 route first teardown through retained owner 2026-07-12 21:09:57 -07:00
Brennan Benson 94b1ffee99 await provider proof for remote terminal close 2026-07-12 21:03:31 -07:00
Brennan Benson c426bc3f74 retain teardown owner across stale rejection 2026-07-12 20:49:22 -07:00
Brennan Benson cb9b17af6e scope liveness cache mutation by provider 2026-07-12 20:45:22 -07:00
Brennan Benson b8cf8a095a fence teardown replay by provider owner 2026-07-12 20:37:11 -07:00
Brennan Benson 11cf303afc contain remote teardown retry rejection 2026-07-12 20:15:35 -07:00
Brennan Benson 325c71d809 persist terminal teardown ownership across restarts 2026-07-12 19:55:49 -07:00
Brennan Benson 1cfc036840 retain cleanup intent across host lifecycle 2026-07-12 19:03:04 -07:00
Brennan Benson c8a74072a3 record host-scoped teardown evidence 2026-07-12 18:43:20 -07:00
Brennan Benson 19fce22584 Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen
# Conflicts:
#	config/reliability-gates.jsonc
2026-07-12 18:41:01 -07:00
Brennan Benson 8cf31f2298 scope teardown admissions by execution host 2026-07-12 18:39:05 -07:00
Jinjing 433df4be3c fix(runtime): prevent file watcher SIGSEGV from crashing orca serve (#8370)
* Fix crash-isolated file watcher process pool for orca-serve SIGSEGV afte

Replace the worker-thread runtime file watcher with a forked, crash-isolated
@parcel/watcher child process pool so a native FSEvents fault can no longer
take down the main/serve process, and add bounded event batching, delivery
backpressure, and quarantine-based recovery for faulty watch roots.

* Fix crash-isolated file watcher teardown and shutdown leaks

- Fault harness could throw before mkdtemp/realpath completed, skipping
  cleanup; now tracks each temp path independently and races an async
  watcher-callback error so it can't escape the try/finally unhandled.
- In-process fallback swallowed unsubscribe failures via a bare rejection
  handler that could still throw; use .catch() instead.
- Watcher process entry's cancel-subscribe handler now reuses the async
  unsubscribe path when a crawl already finished, releasing the native
  handle instead of leaking it (blocks worktree unlock on Windows).
- Runtime watcher process pool exposed no real dispose(); shutdown now
  kills pooled children so they don't outlive the main process.

* Fix disposeSlot double-iteration bug in file watcher pool teardown

Remove the unnecessary array snapshot in dispose(): disposeSlot mutates
allSlots by deleting the slot being visited, and deleting the
in-progress element during Set iteration is well-defined, so the spread
copy was dead weight left over from prior debugging.

* Fix pending file watcher installs not aborting on unsubscribe

- Local/WSL watcher installs and SSH fs.watch setup now honor the
  in-flight AbortSignal, so the last unwatch cancels a slow native
  subscribe or remote setup instead of waiting for it to finish.
- Thread signal through IFilesystemProvider.watch and SSH-backed
  file explorer watches for the same early-cancel behavior.

* Fix crash-resubscribe hangs and SSH watch teardown races in file watcher

- Add a bounded deadline for post-crash resubscription crawls so one
  stuck root quarantines instead of pinning its whole shard forever.
- Report FSEvents overflow as recoverable so delivery continues after
  a dropped-events error instead of surfacing as terminal.
- Make WSL watcher abort errors real DOMException instances so
  AbortSignal-based cancellation checks recognize them.
- Rework SSH watch registration so ownership of the shared setup
  request (not just the first caller) decides teardown, preventing
  one caller's abort from cancelling another's shared watch and
  guaranteeing exactly one fs.unwatch per registration.
- Reformat reliability-gates.jsonc arrays and refresh WSL/SSH coverage
  entries and evidence runs to match the above.

* Add CI gate to run the file-watcher SIGSEGV fault harness under Electron

- The reliability gate and release workflows (mac, Linux) previously only
  exercised the crash-isolation harness under vanilla Node, which doesn't
  catch runtime differences in the actual Electron binary that ships to
  users.
- Adds an `ELECTRON_RUN_AS_NODE=1 pnpm exec electron ...` run of the same
  harness alongside the existing Node run, so #8212's SIGSEGV-survival
  contract is proven against both runtimes before packaging.

* Add CI gate blocking Linux/macOS release packaging on watcher fault reco

Adds a contract test asserting release-cut.yml and release-mac-build.yml
run the runtime-file-watcher-fault-harness after building and before
publishing artifacts, so a regression in watcher process fault recovery
fails release packaging instead of shipping silently.

* Fix use-after-clear crash in failAllWatcherSubscriptions

Snapshot the records map before iterating, since onTerminalError
hooks can dispose the supervisor and clear `records` mid-loop,
causing a crash. Also update the matching test to assert against
the shared buildParcelWatcherIgnoreOptions helper instead of a
loose arrayContaining match.

* Fix use-after-clear crash in failAllWatcherSubscriptions

Snapshot watcher records with Array.from instead of spread, since
spread syntax over an iterator that's mutated mid-loop by
onTerminalError hooks can produce inconsistent results.
2026-07-12 18:15:15 -07:00
Brennan Benson 42d08c32c0 Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen 2026-07-12 18:00:18 -07:00
Brennan Benson 00b9e097ee test: record retained shutdown retry evidence 2026-07-12 18:00:18 -07:00
Brennan BensonandBrennan Benson fcd60a03f8 Keep long live session logs stable while they update (#8432)
* Keep long live session logs stable while updating

* fix(editor): normalize content before append sync

* chore(editor): export e2e probe type and link gate motivator

Post-review cleanup: env.d.ts referenced the probe's method shape as an
inline literal, so a probe rename would only surface in the e2e spec;
the new reliability gate's motivatingLinks pointed at the repo root.

---------

Co-authored-by: Brennan Benson <brennanbenson@Brennans-MacBook-Pro.local>
2026-07-12 17:56:49 -07:00
Brennan Benson 814b4353f4 test: cover offline teardown ownership 2026-07-12 17:35:31 -07:00
Brennan Benson ed14b32f70 test: record latest teardown gate evidence 2026-07-12 17:12:07 -07:00