Commit Graph
6544 Commits
Author SHA1 Message Date
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
github-actions[bot] 4a76a1c894 release: v1.4.138-rc.4 v1.4.138-rc.4 2026-07-13 01:19:26 +00: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 BensonandBrennan Benson 00fc452c21 Split client-ui RPC schemas into client-ui-schemas.ts (#8446)
#7598 pushed client-ui.ts to 301 lines, one over the max-lines limit, which
breaks repo lint for every PR that merges current main (verify does not run
on main pushes). Follow the existing browser-schemas.ts/computer-schemas.ts
pattern: zod schemas move to a sibling module, the method registry stays.

Co-authored-by: Brennan Benson <>
2026-07-12 18:07:06 -07:00
Brennan BensonandOrca 3c87873dca Fix Command Code smart-sort bump on new prompt while working (STA-350) (#5286)
Co-authored-by: Orca <help@stably.ai>
2026-07-12 18:05:11 -07:00
Brennan Benson e0adf81712 Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen 2026-07-12 18:02:14 -07:00
OrcaWin d5627638ab fix(terminal): prevent focus prefix in startup drafts (#8433)
* fix(terminal): order startup drafts after focus input

* fix(terminal): preserve startup draft activity
2026-07-12 18:00:38 -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 3d41bfbcab Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen 2026-07-12 17:54:43 -07:00
Brennan Benson e257e1fd81 fix: retry retained terminal shutdowns 2026-07-12 17:54:43 -07:00
nikg24andnikg24 67cd462b24 Add Cursor orchestration group routing (#8436)
Co-authored-by: nikg24 <228026988+nikg24@users.noreply.github.com>
2026-07-12 17:39:18 -07:00
Brennan Benson dead0c7cd2 refactor: centralize background PTY cleanup 2026-07-12 17:38:14 -07:00
Brennan Benson 0f94771dfd Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen 2026-07-12 17:35:31 -07:00
Brennan Benson 814b4353f4 test: cover offline teardown ownership 2026-07-12 17:35:31 -07:00
Neil d452385bf7 fix(mobile): offer scoped Windows Firewall repair (#8439) 2026-07-12 17:30:22 -07:00
Brennan Benson 226e6f4465 Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen 2026-07-12 17:29:58 -07:00
Brennan Benson c786085526 fix: retain teardown ownership across offline paths 2026-07-12 17:29:58 -07:00
Brennan BensonandBrennan Benson 550c41a35c refactor(editor): consolidate diff tooltip provider (#8429)
Co-authored-by: Brennan Benson <brennanbenson@Brennans-MacBook-Pro.local>
2026-07-12 17:22:08 -07:00
Brennan Benson ed14b32f70 test: record latest teardown gate evidence 2026-07-12 17:12:07 -07:00
Neil fb15d647c6 refactor: remove state-only React effects (#8437) 2026-07-12 17:11:08 -07:00
Brennan Benson 49b66055cb Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen 2026-07-12 17:10:56 -07:00
Brennan Benson 7cf07e6008 fix: fence desktop terminal teardown admissions 2026-07-12 17:10:48 -07:00
d197c5b864 fix(terminal): route Shift+Enter by PTY host (#8065)
* fix(terminal): route Shift+Enter by PTY host

* fix(terminal): resolve SSH platform from execution host

* fix(terminal): preserve restored runtime input routing

* fix(terminal): route Shift+Enter by PTY host

* fix(terminal): resolve SSH platform from execution host

* fix(terminal): preserve active PTY host routing

Co-authored-by: Orca <help@stably.ai>

* test(terminal): remove superseded host-routing cases

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
2026-07-12 17:10:26 -07:00
Jinjing 8086f9a3f5 Rework post-batch late-settlement reconciliation to report per-candidate (#8434)
- Late child/parent settlements now report individually instead of
  being batched into a single combined result, so toasts and
  onLateResult callbacks reflect actual per-candidate outcomes.
- Post-batch reconciler retains only unresolved provisional-ancestor
  state instead of the full batch arrays, and releases it once no
  provisional ancestor remains, avoiding unbounded retention for
  long-hung IPC promises.
- Unblocked ancestors retried post-batch now go through the same
  timeout/settlement tracking as in-batch removals, including
  further late settlement if the retry itself hangs.
2026-07-12 17:07:34 -07:00
github-actions[bot] 3eb805ce4f release: v1.4.138-rc.3 v1.4.138-rc.3 2026-07-13 00:00:00 +00:00
Jinjing 88d6fdad27 Harden SSH import path handling against traversal and Windows device nam (#8435)
- Validate each remote path segment (name, symlink target, directory
  entry) via assertSafeRemotePathSegment before it reaches the remote
  filesystem, since Windows canonicalizes reserved device names and
  NTFS streams in ways POSIX checks miss.
- Extract directory pre-scan/upload logic into
  filesystem-import-ssh-directory.ts and add captureLocalUploadRoot to
  detect a selected root swapped out from under an in-progress import.
- Add path-safety tests covering traversal, reserved Windows names,
  and TOCTOU root replacement.
2026-07-12 16:53:43 -07:00
Brennan Benson 6c4571d57a Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen 2026-07-12 16:31:49 -07:00
Brennan Benson 3dd79e7433 fix(terminal): preserve teardown ownership until confirmed 2026-07-12 16:31:19 -07:00
c6029bea10 fix(terminal): handle Linux IME candidate digits without composition events (#8241)
* fix(terminal): preserve Linux IME candidate digits

* fix(terminal): preserve overlapping Linux IME keys

* docs(terminal): document Linux IME candidate state

* docs(terminal): describe IME candidate event handling

* docs(terminal): clarify Linux IME state callbacks

* fix(terminal): harden Linux IME candidate fallback

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: yuqili03 <yuqili03@deeproute.ai>
Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
2026-07-12 16:30:44 -07:00
Brennan Benson 8ea0622587 Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen
# Conflicts:
#	src/renderer/src/components/editor/EditorPanelHeader.tsx
#	src/renderer/src/components/editor/diff-navigation-context.test.tsx
#	src/renderer/src/components/editor/diff-navigation-context.tsx
#	src/renderer/src/i18n/locales/es.json
#	src/renderer/src/i18n/locales/ja.json
#	src/renderer/src/i18n/locales/ko.json
#	src/renderer/src/i18n/locales/zh.json
2026-07-12 16:17:48 -07:00
sonhyrdandBrennan Benson f8ae1a489b Add F7/Shift+F7 keyboard navigation for diff changes (#8240)
* feat(diff): add F7/Shift+F7 keyboard navigation for diff changes

Stacks on the Previous/Next change buttons (#6668) to add keyboard
navigation for single-file diffs, matching VS Code / JetBrains diff review.

- Register editor.nextChange (F7) / editor.previousChange (Shift+F7) in the
  keybinding registry (Editors group) so they show in Settings and stay
  rebindable.
- Teach the keybinding normalizer function keys (F1-F24) and make them
  first-class in the bare-key safety model (safe standalone or with Shift,
  opt-in per action) - F7 was previously unbindable.
- Install a capture-phase listener from DiffNavigationProvider so keyboard
  and the existing header buttons share one goToDiff path; works on
  read-only and editable single-file diffs.
- Translate the Previous/Next change strings for es/ja/ko/zh.

Refs #6215

* test(diff): cover change navigation shortcuts

* fix(diff): use shortcut chips in navigation tooltips

---------

Co-authored-by: Brennan Benson <brennanbenson@Brennans-MacBook-Pro.local>
2026-07-12 16:13:21 -07:00
Brennan Benson c1ac8e1f77 fix(terminal): drain renderer teardown admissions 2026-07-12 16:03:46 -07:00
Brennan Benson 7cf8b6ac52 fix(runtime): drain terminal admissions before removal 2026-07-12 15:41:28 -07:00
Brennan Benson bfbeab6204 fix(terminal): make teardown ownership generation-safe 2026-07-12 15:34:34 -07:00
gatsby74andNeil 9dc1f253ad feat(editor): add file editor word wrap preference (#8423)
Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
2026-07-12 15:17:06 -07:00
Neil 2306f82113 fix(terminal): gate Shift+Enter CSI-u on active protocol (#8427) 2026-07-12 15:09:20 -07:00
b93ec86fef Add Previous/Next change navigation buttons to the Diff View (#6668)
* feat(diff): add Previous/Next change navigation buttons to Diff View

Add up/down navigation buttons to the single-file Diff View toolbar so
users can jump between change regions (hunks) without scrolling, matching
IntelliJ/Android Studio. The buttons bridge the Monaco diff editor to the
header via an instance-scoped DiffNavigationProvider and call Monaco's
goToDiff('previous'|'next'); they disable when the file has no changes.

Closes #6215

Co-authored-by: Orca <help@stably.ai>

* test(diff): cover stale onDidUpdateDiff guard in fast-swap

Address CodeRabbit nitpick: prove that an update fired from a replaced
editor is ignored after a new editor registers (the subscription is
disposed on re-register). The fake editor's dispose now clears its
callback, matching real Monaco subscription semantics.

Co-authored-by: Orca <help@stably.ai>

* fix(diff): isolate navigation registration updates

* fix(diff): use arrows for change navigation

* fix(editor): tighten header action spacing

---------

Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Brennan Benson <brennanbenson@Brennans-MacBook-Pro.local>
2026-07-12 14:59:18 -07:00
Brennan Benson 57638dd25d Merge remote-tracking branch 'origin/main' into fix/renderer-crash-white-screen
# Conflicts:
#	src/renderer/src/store/slices/repos.ts
2026-07-12 14:50:44 -07:00
d509ee7abe perf(renderer): sweep suppressedPtyExitIds and pendingCodexPaneRestartIds on bulk worktree purge (#7656)
* perf(renderer): sweep suppressedPtyExitIds and pendingCodexPaneRestartIds on bulk worktree purge

Both are ptyId-keyed maps cleared alongside codexRestartNoticeByPtyId on the
normal pty-exit path, but buildWorktreePurgeState (remove-project / external
authoritative-scan / hydration-stale reconcile) runs no terminal teardown and
only swept codexRestartNoticeByPtyId and migrationUnsupportedByPtyId. A
suppression / pending-restart flag planted just before a doomed pty's exit
therefore stranded one entry per removed pty for the renderer session.

Add both to omitByPtyId, matching their two swept siblings; extend the
bulk-purge leak regression test to cover them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(renderer): cover dormant PTYs in bulk purge

* Fix worktree-purge PTY id leaks: proportional alias scan and stricter su

- purgeWorktreeTerminalState now short-circuits the surviving-alias scan
  once every doomed remote handle alias is matched, instead of scanning
  every surviving tab's terminals on each purge.
- Repo removal (removeRepo) no longer force-marks killed PTY ids as
  suppressed/pending-restart; those tabs are gone before async exit
  events fire, so retaining the guards just leaked entries.
- Update tests to cover raw remote-handle aliasing against surviving
  local PTY ids and to assert the tightened cleanup behavior.

* Fix environment-scoped remote PTY id handling for guards and lifecycle s

- Canonicalize legacy remote PTY ids at attach time so guard/restart/notice
  maps stay scoped per runtime environment instead of colliding on raw
  aliases shared across environments.
- Migrate suppressedPtyExitIds, pendingCodexPaneRestartIds,
  codexRestartNoticeByPtyId, and migrationUnsupportedByPtyId entries when a
  tab's PTY id transitions from a legacy alias to its scoped id.
- Narrow shutdown/purge guard sets to renderer-visible PTY ids only, since
  raw exact-stop RPC handles never emit pane exit callbacks and previously
  caused cross-environment leakage and unnecessary alias scanning.
- Prevent a late PTY exit from resurrecting a ptyIdsByTabId entry for a tab
  whose worktree/repo was already purged.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
2026-07-12 14:46:15 -07:00
Brennan Benson 8024166e6d fix(terminal): verify provider shutdown before purge 2026-07-12 14:45:25 -07:00
ff104e523e fix(i18n): use useTranslation hook in SidebarNav for reactive language switching (#7542)
* fix(i18n): use useTranslation hook in SidebarNav for reactive language switching

Replace plain translate() calls with the useTranslation() hook so the
React.memo-wrapped SidebarNav re-renders when the i18n language changes
after async catalog loading, fixing sidebar labels staying in English
on non-English locale startup.

Closes #7530

* fix(i18n): make sidebar language subscription race-safe

* refactor(i18n): use standard sidebar language subscription

---------

Co-authored-by: 文小松 <wenxiaosong@wenxiaosongdeMac-mini.local>
Co-authored-by: Brennan Benson <brennanbenson@Brennans-MacBook-Pro.local>
2026-07-12 14:10:16 -07:00
7fe6742b8b fix(pr-comments): let users mark comment authors as bots for the Humans/Bots filter (#7598)
* fix(pr-comments): let users mark comment authors as bots for the Humans/Bots filter

Some review bots post from regular user accounts that defeat both provider
bot metadata and login heuristics, so their comments were misclassified as
human. Adds a persisted prBotAuthorOverrides setting with a "Mark author as
bot" comment action, applied consistently across desktop and mobile.

Fixes #7597

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(pr-comments): address review feedback on bot-author overrides

- Cap sanitized prBotAuthorOverrides at 500 entries so malformed payloads
  can't bloat GlobalSettings or slow comment classification
- Reuse the shared normalizePRCommentAuthorLogin in isBotPRComment on
  desktop and mobile instead of duplicating the normalization inline
- Pass botAuthorOverrides from CommentRow to CommentMoreMenu instead of
  re-subscribing per menu instance
- Re-fetch mobile bot-author overrides alongside each PR refetch so they
  don't stay a stale one-shot snapshot for the whole session

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(pr-comments): harden bot author override sync

* fix(pr-comments): bound and recover override updates

* fix(pr-comments): merge overrides from canonical settings

* fix(pr-comments): make bot override updates atomic

* fix(pr-comments): surface rejected bot overrides

* fix(i18n): translate bot override warning

* fix(i18n): translate bot author actions

---------

Co-authored-by: Dzmitry Bachko <dbachko@users.noreply.github.com>
Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Brennan Benson <brennanbenson@Brennans-MacBook-Pro.local>
2026-07-12 14:09:15 -07:00
Brennan Benson d87c8fa9af fix(terminal): retain shutdown retry ownership 2026-07-12 13:32:18 -07:00
Brennan Benson 459de71dab fix(ssh): patch Windows relay node-pty shutdown 2026-07-12 13:07:36 -07:00
Brennan BensonandBrennan Benson b01df38590 Show agent CLI failure output for branch auto-naming and generation instead of parsing per-CLI error formats (#8045)
* Surface the Pi CLI's real error when branch auto-naming and commit generation fail

Pi failures (missing provider credentials, HTTP 4xx/5xx, connection errors)
previously collapsed to the generic 'Pi CLI command failed with code 1.'
because extractAgentErrorMessage only recognized Error:-prefixed lines.
Add two stderr-only extraction passes for pi's failure formats and narrow
the unix-path redactor so pi's /login remedy token survives redaction.

Fixes the OP variant of STA-1492 (#7808).

* Replace per-CLI failure parsing with sanitized raw output excerpts

Every agent CLI formats errors differently, and the parsing passes only
ever covered the vendors someone had already debugged (the pi passes
fixed pi and nothing else). Show the output itself instead: a positional
excerpt (first two non-empty lines plus the last one) of stderr, falling
back to stdout when stderr is silent, path-redacted and capped as
before. Exit-0 runs with empty stdout now stay 'returned an empty
<result>' instead of misreporting a command failure. The sanitizer also
strips Cf characters (bidi overrides) now that provider-controlled
bodies flow through verbatim, and OSC sequences are stripped alongside
CSI.

* Keep the full CLI output of failed branch-name generation for on-demand viewing

The persisted rename-failed badge carries only a sanitized excerpt (it
syncs to paired clients), so the complete diagnosis was previously
buried in the main-process log. Failed generations now capture their
full stdout/stderr (bounded to 64 KiB per stream, head and tail) into a
main-memory-only store keyed by worktree — never persisted or synced.
The rename-failed dialog fetches it on demand and shows it in place of
the excerpt, ANSI/control/bidi-stripped; after a restart or on paired
web clients it falls back to the excerpt. Renderer-bound generation
results explicitly drop the capture so IPC payload shapes are
unchanged.

* Cover the rename-failed dialog's full-output fetch and excerpt fallback

* Split the folder-workspace title rename flow into its own module

first-work-branch-rename.ts sat at the max-lines ceiling; the folder
title flow is a self-contained concept and main's concurrent additions
to this file pushed the CI merge ref over the limit.

* Harden the failure-output capture and dialog against review findings

- Flatten bounded captures so V8 sliced strings no longer retain the
  multi-megabyte parent stream in the capture map (128 MiB -> ~4 MiB in
  a 32-entry probe).
- Require an OSC terminator and stop its char class at newlines so an
  unterminated/boundary-truncated sequence can no longer swallow the
  omission marker and diagnostic tail.
- Exclude stdout from the persisted branch-name failure detail (it can
  echo the prompt into synced metadata); the full local-only capture
  still keeps it for the dialog.
- Refetch and reset the dialog's full output when the persisted error
  changes so an open dialog never shows or copies a stale run.
- Report signal-terminated generators (null exit code) as 'was
  terminated before exiting' instead of 'code null'.

* Redact JSON-escaped Windows drive paths without breaking scheme URLs

Provider JSON bodies double backslashes (C:\\Users\\name), which slipped past the drive-letter redaction into the persisted, client-synced failure excerpt. Allow repeated backslashes only — a URL's :// must stay single so remedy links survive.

* Fix branch rename failure IPC re-registration

---------

Co-authored-by: Brennan Benson <brennanbenson@Brennans-MacBook-Pro.local>
2026-07-12 13:02:29 -07:00
Brennan Benson afc606978c fix: make renderer teardown failures safe and diagnosable 2026-07-12 12:45:56 -07:00