Commit Graph
55 Commits
Author SHA1 Message Date
Jinwoo HongandOrca fc578f5ea9 feat(mobile): Expo companion app [beta] (#1245)
Co-authored-by: Orca <help@stably.ai>
2026-05-04 13:08:27 -07:00
Brennan BensonandOrca fd86e1869a feat(telemetry): PR 2 — transport (client, validator, burst cap, IPC, build gate) (#1374)
Co-authored-by: Orca <help@stably.ai>
2026-05-03 16:51:31 -07:00
Jinwoo HongandOrca a638215729 fix(pty): release ptmx fd on natural exit + defuse SIGHUP-to-recycled-pid (#1327)
* fix(pty): release ptmx fd on natural exit + defuse SIGHUP-to-recycled-pid

Daemons accumulated ptmx fds over time because node-pty's UnixTerminal
only releases the master fd when destroy() runs. On the natural-exit
path (the common case — user closes a tab, shell runs `exit`) nothing
ever calls destroy(), so the fd leaks until GC. On macOS this
eventually hits kern.tty.ptmx_max=511 and all new terminals fail to
spawn.

Fix: release the fd synchronously on every teardown path (natural
exit, explicit kill, stale SSH spawn, daemon shutdown) and close the
concurrent SIGHUP-to-recycled-pid hazard inside node-pty's
UnixTerminal.destroy().

- src/main/daemon/pty-subprocess.ts: synchronous POSIX proc.kill
  neutralization inside proc.onExit; dead guards on forceKill/signal
  so they never target a reaped-and-possibly-recycled pid
- src/main/daemon/session.ts: new disposeSubprocess() for already-
  exited sessions (fd release only, no SIGKILL) — avoids sending
  SIGKILL to a recycled pid during daemon shutdown
- src/main/daemon/terminal-host.ts: dispose loop routes on isAlive —
  live sessions get forceKillAndDisposeSubprocess (SIGKILL + fd
  release), exited sessions get disposeSubprocess (fd release only)
- src/main/providers/local-pty-provider.ts: same POSIX kill
  neutralization at top of onExit for the legacy local path
- src/relay/pty-handler.ts: same neutralization in wireAndStore;
  disposed flag guards all public entry points; dispose() uses
  SIGKILL (not SIGTERM) before destroy since the relay is exiting;
  killTimer fallback + immediate-shutdown + stale-spawn cleanup all
  call disposeManagedPty + ptys.delete so wedged children (D-state,
  bad NFS) can't leak map entries against the 50-PTY cap

Windows is exempt everywhere — WindowsTerminal.destroy IS a kill()
call internally (closes the ConPTY agent), so neutralizing would
turn destroy into a no-op and leak the agent.

See docs/fix-pty-fd-leak.md for the full design.

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

* fix(pty): patch node-pty native off-by-one leaking /dev/ptmx per spawn

node-pty 1.1.0's pty_posix_spawn on macOS walks low_fds[0..2] in an
allocation loop that breaks at the first fd >= STDERR_FILENO, then
cleans up via `for (; count > 0; count--) close(low_fds[count])`. In
the typical case (break at count=0) the cleanup body never runs and
low_fds[0] — a /dev/ptmx handle — leaks per spawn. Fixed upstream in
microsoft/node-pty af053f2 (PR #882), not in any 1.1.0 release.

Backport the 3-line cleanup-loop fix as a pnpm patch. E2E validated
against a dev daemon: 200 spawn/kill cycles kept the daemon's ptmx
fd count flat at baseline; prior runs reproduced linear 1-per-spawn
growth. Also documents the native root cause as a status addendum in
docs/fix-pty-fd-leak.md — the JS-side destroy() discipline previously
landed is still load-bearing for the SIGHUP-to-recycled-pid hazard and
for synchronous fd release on daemon shutdown.

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

* fix(pty): capture stable kill spy ref in pty.test.ts

destroyPtyProcess reassigns proc.kill = () => {} on POSIX to defuse
the SIGHUP-to-recycled-pid hazard (see docs/fix-pty-fd-leak.md). After
that reassignment, proc.kill.mock is undefined and the assertions
crashed in CI. Capture a stable reference to the vi.fn() before it
gets reassigned.

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

---------

Co-authored-by: Orca <help@stably.ai>
2026-05-02 23:12:14 -07:00
NeilandOrca 4318f3bfa7 chore: reduce root-directory clutter (#1275)
Co-authored-by: Orca <help@stably.ai>
2026-04-30 00:09:46 -07:00
Jinwoo HongandOrca c9391e203f feat(orchestration): add inter-agent orchestration system (#1188)
Co-authored-by: Orca <help@stably.ai>
2026-04-28 12:21:31 -07:00
cfc444242c fix(win32): resolve EPERM on userData writes, batch-file spawn failures, and native dep rebuild (#1152)
* chore: update .gitignore to include stackdump and .serena, enhance pre-commit script

* fix(win32): resolve EPERM on userData writes and batch-file spawn failures

Three Windows-specific issues prevented Orca from running correctly on
machines where Chromium resets the userData DACL during startup:

1. **EPERM on userData writes** — Chromium's BrowserWindow constructor calls
   SetNamedSecurityInfo on the userData folder with a Protected DACL.  When
   propagated to child directories the ACEs carry the Inherit-Only flag,
   meaning they apply to children-of-children but NOT to the directories
   themselves.  Any file write inside codex-runtime-home, agent-hooks, or
   similar subdirectories fails with EPERM.

   Fix: grant an explicit Full Control ACE (OI)(CI)(F) on userData and all
   existing children before BrowserWindow is created (icacls /T /C).
   Explicit ACEs survive future DACL propagation from the parent.  Per-write
   EPERM retries in fs-utils and installer-utils serve as the backstop for
   directories created after startup.

2. **Batch-file spawn failures** — resolveCodexCommand() can return a .cmd
   or .bat path (e.g. codex.cmd installed via npm).  Node's spawn() cannot
   execute batch scripts directly without shell:true, but shell:true with an
   args array triggers DEP0190 because args are concatenated rather than
   escaped.  Both service.ts and codex-fetcher.ts were affected.

   Fix: detect .cmd/.bat paths and route through cmd.exe /c explicitly,
   which is equivalent to what shell:true does internally but avoids the
   deprecation warning and arg-escaping hazard.

3. **Native dep rebuild failure** — electron-builder install-app-deps does
   not expose the ignoreModules option.  On Windows dev machines without the
   full VC++ / Python toolchain, cpu-features (an optional dep of ssh2) fails
   to build with node-gyp, aborting the entire postinstall step.

   Fix: replace electron-builder install-app-deps with a thin wrapper script
   (scripts/rebuild-native-deps.mjs) that calls @electron/rebuild's JS API
   directly with ignoreModules: ['cpu-features'] on Windows.  ssh2 detects
   the missing native module and falls back to pure-JS automatically.

Refactoring: extract shared win32-utils.ts with getIcaclsExePath(),
getCmdExePath(), isWindowsBatchScript(), isPermissionError(), grantDirAcl(),
and getSpawnArgsForWindows() to eliminate five instances of duplicated
SystemRoot path construction and two near-identical EPERM retry blocks.
Reduce startup icacls calls from three sequential blocking /T invocations
to one, removing up to 20 s of potential startup delay.

* fix(win32): address review feedback on ACL and spawn helpers

- Fall back to SID via `whoami /user` when `USERNAME` is unset so
  `grantDirAcl` works under services, CI, and hardened envs instead of
  silently no-op'ing.
- Use a 60s timeout for recursive `icacls /T` walks; the 10s cap could
  starve on large userData trees and silently fail the startup grant.
- Pass `windowsHide: true` to `icacls` and the cmd.exe-routed Codex
  spawns so no console window flashes in the packaged GUI app.
- Add `/d` to `cmd.exe /c` invocations to disable AutoRun registry
  commands — safer default for background spawns.
- Drop unused `createRequire`/`require` from rebuild-native-deps.mjs.
- Add `@electron/rebuild` as an explicit devDependency; relying on the
  electron-builder transitive was brittle under pnpm.
- Fix two misleading "Re-enable inheritance" comments that describe
  behavior opposite to what the code actually does (explicit ACL grant).
- Add unit tests for `isWindowsBatchScript`, `getSpawnArgsForWindows`,
  and `isPermissionError` to lock in Windows batch detection + cmd.exe
  routing.

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

* fix(win32): unify PTY spawn through /d and document cmd.exe safety

- fetchViaPty now uses getCmdExePath() and /d /c, matching the rest of
  the codebase instead of hand-rolling 'cmd.exe' + ['/c', ...].
- getSpawnArgsForWindows gains a SAFETY note: when the .cmd/.bat branch
  is taken, cmd.exe re-parses the combined command line, so callers
  must only pass trusted/literal args.

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

---------

Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
Co-authored-by: Orca <help@stably.ai>
2026-04-26 22:29:58 -07:00
NeilandOrca d4399b4c92 feat(terminal): add programming-ligatures support (#1118)
Co-authored-by: Orca <help@stably.ai>
2026-04-25 22:26:33 -07:00
Yax PatelandJinwoo-H 2551758c88 feat/markdown preview (#849)
Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
2026-04-25 19:27:47 -07:00
Jinwoo Hong e1270486cd feat: add Linear integration (#1007) 2026-04-23 14:54:32 -07:00
Neil c07db38dfe fix terminal resize flicker during pane drag (#962) 2026-04-22 17:50:14 -07:00
dependabot[bot] 3f474ab278 build(deps): bump dompurify from 3.2.7 to 3.4.1 (#947)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-22 15:42:09 -07:00
Jinwoo Hong 228699d48a feat(editor): add Cmd+F find-in-page for PDF viewer (#899) 2026-04-22 15:39:36 -07:00
Ramzi d73d259105 build(deps): bump electron from 41.1.0 to 41.2.2 (#938) 2026-04-22 11:58:17 -07:00
Neil 5a97525d5c all same tiptap (#934) 2026-04-21 23:13:59 -07:00
Jinwoo Hong 7a9bc4ef6d feat: computer use via agent-browser CDP bridge (#856) 2026-04-20 20:56:14 -07:00
Jinwoo Hong ff16ab1565 feat(stats): add share button to usage panes (#874) 2026-04-20 18:54:16 -07:00
Jinjing 3a0fa521be feat(editor): support clicking anchor links to jump to headings (#879)
Anchor-only links (#heading) now scroll to the matching heading in both
the markdown preview and rich editor. Preview uses rehype-slug to stamp
heading ids; the rich editor walks headings with the same stateful
GithubSlugger for parity (including duplicate-heading suffixes).
2026-04-20 18:35:28 -07:00
Brennan Benson 222d70e063 feat: add idempotent E2E test suite with headless Electron support (#671) 2026-04-19 12:09:32 -07:00
dependabot[bot] 45aadd5556 build(deps): bump dompurify from 3.3.3 to 3.4.0 (#720)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-18 22:55:28 -07:00
Neil aa75adedf7 feat(settings): gate persistent terminal daemon behind experimental toggle (#774) 2026-04-17 16:00:16 -07:00
Jinwoo Hong 7c6d408f16 fix: resolve posix_spawnp failure in daemon's node-pty spawn (#762) 2026-04-17 10:37:56 -07:00
Jinwoo Hong fd4f986c59 feat: terminal persistence via out-of-process daemon (#729) 2026-04-17 01:42:41 -04:00
dependabot[bot] 0f0a237e69 build(deps-dev): bump electron from 41.0.3 to 41.1.0 (#721)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-16 16:39:34 -07:00
Jinwoo Hong cc66e120eb feat: Add SSH remote support (beta) (#590) 2026-04-13 19:23:09 -07:00
Jinwoo HongandClaude Opus 4.6 3793125319 fix: resolve Codex spawn failures on Windows (#562)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 15:49:44 -07:00
Jinjing 696590918c feat: Quick Jump to Worktree palette (Cmd+J) (#469)
* wip in the design doc

* fix: use Ctrl+Shift+J for worktree palette on non-darwin platforms

To avoid colliding with Ctrl+J (Line Feed) on Windows/Linux, we now
use Ctrl+Shift+J for the worktree jump palette on those platforms,
leaving Cmd+J for macOS.

* refactor: migrate QuickOpen to cmdk and unify overlay state

- Migrated `QuickOpen.tsx` to use `cmdk` (`CommandDialog`) for visual and
  behavioral consistency with the new worktree jump palette, while keeping
  the existing custom fuzzy match algorithm.
- Unified the overlay state systems (`activeModal`, `quickOpenVisible`,
  `worktreePaletteVisible`) into a single `activeModal` union type.
- This automatically handles mutual exclusion without boilerplate
  toggle logic spread across components.

* fix: forward QuickOpen and worktree shortcuts from browser guests

Added main-process interceptors for `Cmd/Ctrl+P` and `Cmd/Ctrl+1-9`
so that QuickOpen and numeric worktree jumping continue to work
even when an embedded browser guest (webview) has keyboard focus.

* fix: address review findings

- Set spawnEnv.SHELL before pty.spawn() in the fallback loop so the
  child process inherits the correct SHELL value instead of the stale
  original.
- Remove dead Cmd+P and Cmd+1-9 renderer keydown handlers from App.tsx;
  these are now handled via IPC from createMainWindow.ts before-input-event
  (the IPC handlers in useIpcEvents.ts have the same view-state guards).
2026-04-10 23:37:23 -07:00
Jinjing 0f819032a0 feat: auto-refresh File Explorer via filesystem watcher (#456)
* fix: address review findings

* feat: add filesystem watcher for auto-refreshing File Explorer

Adds @parcel/watcher-based filesystem watching so the File Explorer
automatically reflects external changes (creates, deletes, renames)
without manual refresh.
2026-04-10 19:50:14 -07:00
Jinjing c726878a27 feat: render markdown in worktree comment cards (#452)
Add CommentMarkdown component using react-markdown + remark-gfm +
remark-breaks to render rich formatting (bold, lists, code, links) in
sidebar worktree comment cards. Update height estimation to account for
markdown block elements and capped code block height.
2026-04-10 14:11:55 -07:00
Jinjing bced9b5308 refactor: reorganize project structure for build assets and scripts (#419)
Move build resources to resources/build/, icon source files to
resources/icon-source/, scripts to config/scripts/, and patches
to config/patches/ for a cleaner top-level directory layout.
2026-04-09 12:28:52 -07:00
Jinjing e5f75564af feat: add mermaid diagram rendering and code block copy button (#418)
* feat: add mermaid diagram rendering and code block copy button

- Add mermaid library for rendering mermaid diagrams in markdown preview
- Create MermaidBlock component for diagram rendering
- Create CodeBlockCopyButton component for copying code blocks
- Extract CSS into separate files for better organization

* fix: address review findings

- Sanitize mermaid SVG output with DOMPurify before innerHTML assignment
- Remove dead `initialized` flag in MermaidBlock
- Serialize concurrent mermaid.render() calls with a promise queue
- Add .catch() handlers for clipboard write promises
- Skip CodeBlockCopyButton wrapper for mermaid diagram blocks
2026-04-09 12:21:11 -07:00
Jinjing 0204c36c0f fix: xterm fit refresh, notification timing, and lint-staged config (#410)
- Move xterm FitAddon refresh() outside the resize conditional so
  sub-cell-width container shrinks don't leave blank content
- Defer startup notification to window 'show' event so the macOS
  permission dialog appears after the window is visible
- Add click handler on startup notification to open System Preferences
- Prevent GC of startup notification via activeNotifications set
- Fix lint-staged config: remove yaml/html/md from oxfmt pattern
  since oxfmt only supports json and css beyond JS/TS
2026-04-08 22:15:54 -07:00
Jinjing 8836bc5a6d fix: prevent terminal scroll position corruption during resize (#398)
Patch @xterm/addon-fit to refresh the full viewport and restore scroll
position after reflow, batch ResizeObserver through requestAnimationFrame
to coalesce rapid-fire reflows, and recover terminal rendering after
WebGL context loss.
2026-04-08 20:17:02 -07:00
NeilandClaude Opus 4.6 165502121b feat: polish markdown preview and rich editor (#369)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 13:03:43 -07:00
NeilandClaude Opus 4.6 03a7077597 feat: add pn tc command using typescript-native (tsgo) (#363)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 23:27:29 -07:00
Jinjing a3a0ba24d2 fix: preserve rich markdown round-trips (#267) 2026-04-03 09:57:54 -07:00
Jinjing 22f916e421 feat: add rich markdown editor mode (#264)
* feat: add rich markdown editor mode

* fix: preserve rich search navigation focus
2026-04-02 22:53:47 -07:00
Matheus Nogueira 2ec433f6df feat: add copy remote URL to line number context menu (#253)
* feat: add copy remote URL to line number context menu

Add 'Copy Remote URL' option to the line number gutter right-click menu,
allowing users to quickly copy a shareable link to a file and line on
GitHub, GitLab, Bitbucket, or other hosted git providers.

- Install hosted-git-info to parse remote URLs and generate browse URLs
- Add getRemoteFileUrl() to resolve file URLs using default branch
- Wire up IPC handler, preload bridge, and renderer UI
- Use ExternalLink icon to distinguish from path copy options

* refactor: use @types/hosted-git-info instead of custom type declarations

Replace the custom hosted-git-info.d.ts with the @types package from
DefinitelyTyped. Use a targeted cast for browseFile() which the @types
package doesn't include yet (stuck on v3 API).

* refactor: revert to local type declarations for hosted-git-info

The @types/hosted-git-info package is stuck on the v3 API and lacks
browseFile(). A local .d.ts is cleaner than casting around stale types.
2026-04-01 20:02:05 -03:00
Jinwoo HongandClaude Opus 4.6 831b65fe65 feat: restore terminal scrollback on app restart (#224)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 20:11:35 -07:00
Jinjing e699bec46e WIP: uncommitted changes before rebase (#168) 2026-03-28 11:59:55 -07:00
Jinjing 9c5a1f48bb Add PR checks workflow and Vitest coverage (#97) 2026-03-24 20:53:38 -07:00
NeilandClaude Opus 4.6 c0eaf328b2 Add right sidebar with file explorer, source control, and Monaco editor (#21)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 11:47:22 -07:00
NeilandClaude Opus 4.6 234c422225 Improve update experience: toasts, graceful restart, sidebar indicator (#14)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 18:42:49 -07:00
Neil 9de1eb4318 Terminal fixes, sort fixes, flashbang fix 2026-03-21 14:44:45 -07:00
Neil 03ffdbde4a bump packages 2026-03-21 13:37:24 -07:00
Neil 2c89a02741 menu fix 2026-03-21 13:36:41 -07:00
Neil b093a5ab96 terminal improvements 2026-03-21 13:18:13 -07:00
Neil a3ef3a59d5 xterm 2026-03-21 11:34:11 -07:00
NeilandClaude Opus 4.6 0cd33818f0 Fix PTY listener leak, use local restty with selection support (#5)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 10:14:20 -07:00
Neil 93996ddb09 some fixes 2026-03-17 11:10:39 -07:00
Neil 7f29249d48 Major features 2026-03-17 01:40:24 -07:00