Commit Graph
1405 Commits
Author SHA1 Message Date
Jinwoo-H 0cddbbdeba Merge PR #1343: manage sessions panel + pid-recycling daemon guard 2026-05-02 03:09:16 -04:00
Jinwoo-H 7b3f854264 Merge PR #1327: release ptmx fd on natural exit + defuse SIGHUP-to-recycled-pid 2026-05-02 03:08:01 -04:00
Jinwoo-H 7dd4978411 Merge PR #1326: single-instance lock + owned-metadata clear 2026-05-02 03:07:57 -04:00
github-actions[bot] 812f13a627 release: v1.3.29-rc.0 v1.3.29-rc.0 2026-05-02 07:04:38 +00:00
f2d58e06e4 fix(browser): clean up closed browser sessions and webviews (#1321)
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Nikolatesla-lj <Nikolatesla-lj@users.noreply.github.com>
Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
2026-05-02 00:04:33 -07:00
Neil 9f2ab5ed0d fix(terminal): mirror VS Code GPU rendering controls (#1344) 2026-05-02 00:04:14 -07:00
Jinwoo-HandOrca 77113fff03 feat(daemon): foundation for pty:management IPC surface
Adds the plumbing the Manage Sessions settings panel depends on:

- daemon-init exports getDaemonProvider / replaceDaemonProvider /
  restartDaemon / cleanupDaemonForProtocol so the pty:management
  handlers can access the current provider and coordinate a clean
  restart without importing window-services internals.
- daemon-pty-router exports getAllAdapters so the killAll / listSessions
  handlers can fan across the current adapter plus any legacy-protocol
  adapters still attached for in-flight sessions.
- daemon-pty-adapter gains a listSessions RPC and readonly
  protocolVersion so the handlers can annotate each session with the
  adapter it belongs to and route killOne back to the right adapter.
- types.ts exports DaemonSessionInfo (SessionInfo + protocolVersion)
  as the shared shape the preload API surface mirrors.
- ipc/pty.ts, attach-main-window-services, TerminalPane and
  terminal-search pick up the small bindings required to wire the
  router through existing code paths without regressions.

Co-authored-by: Orca <help@stably.ai>
2026-05-02 02:46:57 -04:00
Jinwoo-HandOrca 4511fa67b4 fix(settings): honest killAll counts + suppress post-kill spawn toast
killAll now snapshots the initial session IDs and polls listSessions every
100ms for up to 6.5s — past the daemon's 5s SIGTERM→SIGKILL ladder — so
well-behaved shells hosting long-running agents finish their SIGTERM
handlers before we classify them as "refused to exit." Shutdowns fire once
per initial session (no retry spam), and fresh session IDs that appear
mid-poll (renderer remounts) don't inflate remainingCount.

pty-transport's connect() catch now detects the adapter's
TerminalKilledError tombstone rejection ("...was explicitly killed") and
suppresses the red "file an issue" toast. After Kill All, a pane remount
would call pty:spawn on the dead session ID; surfacing the tombstone as
a scary error misrepresented an intentional user action. The pane still
renders "Process exited" via the normal lifecycle.

Co-authored-by: Orca <help@stably.ai>
2026-05-02 02:41:09 -04:00
Jinwoo-HandOrca f021fda1b0 feat(settings): manage sessions panel for daemon staleness UX
Add a Manage Sessions settings panel with list/kill-all/kill-one/restart
backed by a new pty:management IPC surface. Rows are hover-highlighted and
click to reveal the corresponding terminal pane, mirroring the bottom
status-bar sessions popover. Kill-all and restart-daemon are icon buttons
(Trash2, RotateCw) with tooltips so the restart action doesn't collide with
the row-refresh RefreshCw icon.

Co-authored-by: Orca <help@stably.ai>
2026-05-02 02:13:44 -04:00
github-actions[bot] 5dc7fbdabc release: v1.3.28 v1.3.28 2026-05-02 06:01:53 +00:00
github-actions[bot] fb39a4954a release: v1.3.28-rc.0 v1.3.28-rc.0 2026-05-02 05:34:53 +00:00
NeilandOrca 74a7a3c790 fix(release): grant actions:write on callers of release.yml (#1341)
release.yml's publish-release job got `actions: write` in f6cc2aee so it
can dispatch homebrew-bump.yml, but reusable-workflow permissions are
capped by the caller. release-cut.yml and release-rc.yml only listed
`contents: write`, so the first cut after f6cc2aee died with
startup_failure (run 25244518794) before any job could start.

Grant `actions: write` on both callers to match what release.yml needs.

Co-authored-by: Orca <help@stably.ai>
2026-05-01 22:34:26 -07:00
NeilandOrca 1db7839570 revert(sidebar): restore unread bell, keep bold-title treatment (#1340)
Co-authored-by: Orca <help@stably.ai>
2026-05-01 22:13:06 -07:00
NeilandOrca e6d61d2f6c feat(sidebar): add Search button to nav, restore task-provider icons (#1339)
Co-authored-by: Orca <help@stably.ai>
2026-05-01 22:04:55 -07:00
Brennan BensonandOrca 70befde774 feat(github): per-repo issue-source selector (#1317)
Co-authored-by: Orca <help@stably.ai>
2026-05-01 21:48:51 -07:00
Jinwoo-HandOrca a6315968e5 test(daemon): cover pid-recycling guard surface in daemon-health
Adds unit coverage for the new Phase 0 surface:

- parseDaemonPidFile: JSON round-trip, JSON without startedAtMs,
  bare-integer fallback for legacy pid files, malformed-input rejection.
- startTimeMatches: null-expected fail-open, null-actual fail-open,
  within-tolerance match, outside-tolerance rejection.
- killStaleDaemon: with a mismatched startedAtMs in the pid file,
  assert that no SIGTERM/SIGKILL is sent even though the liveness probe
  (process.kill(pid, 0)) runs.

startTimeMatches was promoted from module-private to exported so it can
be exercised directly — it's a pure function with no internal state.

Co-authored-by: Orca <help@stably.ai>
2026-05-02 00:42:23 -04:00
Jinwoo-HandOrca a1b1b1439a fix(daemon): guard killStaleDaemon against pid recycling
The daemon's pid file carried only a bare integer, so killStaleDaemon had
no way to verify the current owner of that pid was still the process it
forked. Unix pids recycle — on macOS the default ceiling is ~2048 and
wraps in minutes under load — so blind SIGTERM/SIGKILL on a recycled pid
could hit an unrelated user process (editor, language server, background
task) silently.

Three moving pieces:

1. Pid file now carries startedAtMs. daemon-spawner exports DaemonPidFile
   and serializeDaemonPidFile; daemon-init fills startedAtMs from
   getProcessStartedAtMs(child.pid) right after the daemon signals ready.
   parseDaemonPidFile tries JSON first and falls back to bare-integer for
   backward compatibility (startedAtMs: null on legacy files).

2. isDaemonProcess takes expected startedAtMs. In addition to the cmdline
   match, it consults getProcessStartedAtMs(pid) and compares with a
   ±1.5s tolerance. Null on either side is fail-open so the guard never
   strengthens existing behavior negatively (Windows, legacy pid files,
   kernel-thread /proc failures).

3. SIGKILL re-check. The SIGTERM-then-wait window is up to 3s — long
   enough for the pid to be recycled if the original daemon dies during
   the wait. Before escalating to SIGKILL, isDaemonProcess runs again;
   on mismatch we log reason=pid_recycled and skip SIGKILL.

Carried forward from #1323 as a standalone safety fix — independent of
that PR's router/drain machinery, which is not shipping.

Co-authored-by: Orca <help@stably.ai>
2026-05-02 00:40:45 -04:00
2c7dddbbc4 fix(terminal): dirty-file close prompts for split, bulk, and quit flows (#1338)
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: shamounY <shamoun.yousuf04@gmail.com>
2026-05-01 21:39:15 -07:00
NeilandOrca f6cc2aee92 fix(release): grant actions:write + drop broken auto-merge on tap (#1336)
Two bugs surfaced on the v1.3.26 release:

1. release.yml's new `Trigger Homebrew cask bump` step failed with
   HTTP 403 "Resource not accessible by integration". The publish-release
   job's permissions block only listed `contents: write`, but
   POST /actions/workflows/:id/dispatches requires `actions: write` on the
   scoped-down GITHUB_TOKEN. Added the permission.

2. Even when the bump workflow does run, its `gh pr merge --auto` was
   silently no-op'ing against the homebrew-orca tap, leaving bump PRs
   open. `--auto` only activates when there's a required check or
   branch-protection rule to wait on; the tap intentionally has neither.
   Switched to a direct squash-merge so the tap stays hands-free as
   originally intended.

Co-authored-by: Orca <help@stably.ai>
2026-05-01 20:24:41 -07:00
github-actions[bot] dfee883f8a release: v1.3.27 v1.3.27 2026-05-02 03:15:09 +00:00
NeilandOrca 6303bdb50f fix(release): recover orphan tags instead of hard-failing the cut (#1335)
If a cut pushes the tag but the workflow is cancelled (or the dependent
release.yml job otherwise fails to start) before a GitHub release is
published, every subsequent patch cut recomputes the same version and
dies on "Tag already exists." This wedged the pipeline on 2026-05-01
when v1.3.26 was pushed by cancelled run 25237882049 — patch cuts kept
failing for hours until release.yml was dispatched by hand.

When the tag exists but no published release is attached, skip the
bump/push steps and emit the existing tag as the job output so
release.yml runs against it and finishes what the prior attempt
started. Still refuse the collision when a real published release
exists — that's a genuine conflict (e.g. a hand-tagged version) and
needs human attention.

Co-authored-by: Orca <help@stably.ai>
2026-05-01 20:13:46 -07:00
Leynier Gutiérrez GonzálezandAmp 6faf406511 fix(claude-hook): use forward slashes in Windows managed hook command path (#1329)
Co-authored-by: Amp <amp@ampcode.com>
2026-05-01 18:50:22 -07:00
github-actions[bot] 0e06d2e9b5 release: v1.3.26-rc.3 v1.3.26-rc.3 2026-05-02 01:41:53 +00:00
JinjingandOrca 547448e15c refactor: rename pet → sidekick across codebase (#1334)
Renames the experimental pet overlay to "sidekick" with themed character
names (Claude the Mage, OpenCode the Rogue, Gremlin the Trickster).
Covers IPC channels, preload API, persisted UI state, settings flag,
on-disk userData path, components, and types.

Deletes the standalone pet-overlay design mock.

Co-authored-by: Orca <help@stably.ai>
2026-05-01 18:40:52 -07:00
github-actions[bot] fe17888104 release: v1.3.26 v1.3.26 2026-05-01 23:40:18 +00:00
Brennan BensonandOrca f12c3005ed feat(sidebar): bold unread workspaces instead of bell icon (#1330)
Co-authored-by: Orca <help@stably.ai>
2026-05-01 16:20:58 -07:00
github-actions[bot] c167e4e6e9 release: v1.3.26-rc.2 v1.3.26-rc.2 2026-05-01 23:19:15 +00:00
JinjingandOrca d287342f99 feat: add experimental pet overlay (#1331)
* feat: add experimental pet overlay

Adds an opt-in 3D pet overlay pinned to the bottom-right. Gated behind
an experimental flag so three.js + GLB models stay out of the renderer
bundle for users who never enable the feature. Ships with four bundled
models plus user-uploaded custom GLBs via a pet:import IPC; a status-bar
segment provides model picker + hide toggle.

See docs/design/pet-overlay.md for the full design.

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

* refactor(pet): replace 3D GLB models with 2D webp images

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

* chore(pet): compress pet webp images and remove unused assets

Reduce resources/claude.webp, gremlin.webp, opencode.webp sizes; drop
the obsolete pet-overlay design doc and compress-pet-glb script now
that the GLB pipeline has been replaced by 2D webp images.

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

---------

Co-authored-by: Orca <help@stably.ai>
2026-05-01 16:18:21 -07:00
Jinwoo-HandOrca 80bd220ab5 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>
2026-05-01 19:00:11 -04:00
Jinwoo-HandOrca 4548d20cc4 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>
2026-05-01 18:53:34 -04:00
Jinwoo-HandOrca 4c1fa2b7bb fix(runtime): focus hidden windows on second-instance event
focus() alone is a silent no-op when the primary window is hidden
(close-to-tray on macOS via Cmd+W, or on a different macOS Space) or
behind other apps on Windows. Call show() before focus() so a second
launch attempt reliably surfaces the existing window regardless of
state.

Co-authored-by: Orca <help@stably.ai>
2026-05-01 18:35:16 -04:00
Jinwoo-HandOrca 3642deac60 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>
2026-05-01 18:17:53 -04:00
github-actions[bot] d26cb4b898 release: 1.3.26-rc.1 [rc-slot:2026-05-01-15] v1.3.26-rc.1 2026-05-01 22:13:14 +00:00
Jinwoo-HandOrca 22681cff06 fix(runtime): add single-instance lock + owned-metadata clear to prevent orca-runtime.json corruption
Closes #1312.

Every AppImage/.app relaunch was booting a fresh Electron main that clobbered
`<userData>/orca-runtime.json` and `agent-hooks/endpoint.env`. When the newest
instance quit, metadata pointed at a dead pid and `orca status` reported
`stale_bootstrap` even though the original Orca was still running. SIGKILL'd
predecessors also left orphaned `o-<pid>-*.sock` files in userData.

Three surgical changes:

1. `app.requestSingleInstanceLock()` in a new
   `src/main/startup/single-instance-lock.ts` helper, wired into
   `src/main/index.ts` after `configureDevUserDataPath(is.dev)` so dev and
   packaged runs lock in separate namespaces. Losing instances focus the
   primary's window via `second-instance` and quit without touching userData.

2. `clearRuntimeMetadataIfOwned(userData, pid, runtimeId)` in
   `runtime-metadata.ts` — compares both pid AND runtimeId against the
   current file before clearing, so the auto-updater handoff window never
   erases the replacement process's fresh bootstrap. Called from a rewritten
   `will-quit` handler that folds `runtimeRpc.stop()` + owned-clear into the
   same `Promise.allSettled([disconnectDaemon, …]).then(app.quit)` chain
   (inside the `!daemonDisconnectDone` guard so the second-pass re-entry
   can't re-invoke stop+clear).

3. `sweepOrphanedRuntimeSockets()` in `runtime-rpc.ts` runs at the top of
   `start()` on POSIX, using `process.kill(pid, 0)` to probe liveness and
   remove `o-<dead-pid>-*.sock` orphans left by SIGKILL/OOM-kill.

Tests (37 new/updated):
- `single-instance-lock.test.ts` (3): lock-failed does not register listener;
  lock-acquired registers exactly one; callback dispatches correctly.
- `runtime-metadata.test.ts` (+4): clearRuntimeMetadataIfOwned matched /
  pid-mismatch / runtimeId-mismatch / no-file branches.
- `runtime-socket-sweep.test.ts` (4): own-pid-skip / alive-retain /
  dead-sweep / regex-miss separated via synthetic ownPid=1; two
  regex-invariant tests assert the sweep regex matches the real
  `createRuntimeTransportMetadata` output (including the 'rt' fallback).

Design doc: `docs/fix-missing-single-instance-lock.md`.

Co-authored-by: Orca <help@stably.ai>
2026-05-01 17:50:27 -04:00
bbd77c2449 fix(worktree): restore sparse checkout without per-poll git subprocesses (#1316)
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Colin <colin.chambachan@gmail.com>
2026-05-01 13:25:22 -07:00
d4bbf473c1 Support wiki-style Markdown document links (#1282)
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
2026-05-01 13:15:08 -07:00
Brennan BensonandOrca 19c4888e17 feat(titlebar): Cmd+J search icon next to agent badge (#1314)
Co-authored-by: Orca <help@stably.ai>
2026-05-01 12:56:00 -07:00
Brennan BensonandOrca 6dc2e9e751 fix(tabs): align tab row bottom with sidebar header (#1318)
* fix(tabs): align tab row bottom with sidebar header

The center column's top band was 6px drag strip + 34px tab row = 40px,
while the sibling `titlebar-left` above the sidebar is 42px. The tab row
sat 2px high, making the seam between the two columns visibly off.

Bump the drag strip from 6px to 8px so the top band totals 42px and the
tab row's bottom border lines up with the sidebar header.

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

* fix(tabs): shrink tab row to 32px, pad drag strip to 10px

Keep the total top-band at 42px (matching the sidebar's titlebar-left)
while making the tabs themselves 2px shorter, so the tab chrome feels a
touch more compact without breaking alignment with the sidebar header.

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

* fix(tabs): drop doubled border on leftmost split pane

The TabGroupSplitLayout wrapper paints a full-height `border-l` at the
sidebar seam, and every split pane paints its own `border-l`. On the
leftmost pane those stacked at the same x, reading as a ~2px bar just
below the drag strip where the wrapper's 1px line continues alone above.

Mirror the right-edge handling: skip the pane's `border-l` when it
touches the left edge, leaving the single wrapper border to draw the
seam — same visual weight as the right edge.

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

* docs(tabs): refresh stale wrapper border-l comment

Why: `border-l` on the wrapper comment still described the pre-fix
overlap behavior. After `touchesLeftEdge`, the leftmost pane drops
its own `border-l`, so the seam is exactly 1px — the old comment
contradicted the code.

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

---------

Co-authored-by: Orca <help@stably.ai>
2026-05-01 12:53:45 -07:00
Neil 17110818c6 docs: fix README header alignment (#1320) 2026-05-01 12:46:56 -07:00
Neil 8d56823998 docs: localize README install updates (#1319) 2026-05-01 12:38:59 -07:00
Jinwoo HongandOrca 22b80f8ce5 fix(terminal): split panes lose source cwd when shell omits OSC 7 (#1313)
Co-authored-by: Orca <help@stably.ai>
2026-05-01 12:25:41 -07:00
NeilandOrca 48d7e20493 fix(release): dispatch Homebrew cask bump from release pipeline (#1315)
Co-authored-by: Orca <help@stably.ai>
2026-05-01 12:21:53 -07:00
Brennan BensonandOrca 5bf114787f feat(sidebar): move worktree filter out of search bar into header (#1303)
Co-authored-by: Orca <help@stably.ai>
2026-05-01 11:53:20 -07:00
github-actions[bot] d17ba3e036 release: 1.3.26-rc.0 [rc-slot:2026-05-01-03] v1.3.26-rc.0 2026-05-01 10:27:22 +00:00
github-actions[bot] 73ce1d4af7 release: v1.3.25 v1.3.25 2026-05-01 07:55:30 +00:00
github-actions[bot] 265512200c release: v1.3.25-rc.15 v1.3.25-rc.15 2026-05-01 07:34:17 +00:00
NeilandOrca b8ded7e9fe feat(tabs): stronger tab icons — blue browser globe, bold terminal tile (#1305)
- BrowserTab: Globe icon uses text-blue-500 on both active and inactive tabs
  for a distinct, recognizable anchor in the tab strip.
- shell-icons: GenericTerminalIcon now renders a pitch-black tile with a
  thick stroked >_ (chevron at 3.2px, underscore at 2.6px, taller chevron)
  so mac/linux/default terminal tabs match the colored-badge treatment of
  the PowerShell/CMD/WSL icons instead of a flat lucide chevron.
- SortableTab: all terminal tabs use ShellIcon. On Windows, tabs without a
  per-tab shellOverride fall back to the user's configured default
  Windows shell so the tab-strip icon reflects what's actually running.

Co-authored-by: Orca <help@stably.ai>
2026-05-01 00:33:46 -07:00
NeilandOrca ff22944fd7 feat(release): publish Orca as a Homebrew cask (#1304)
Co-authored-by: Orca <help@stably.ai>
2026-05-01 00:33:21 -07:00
Brennan BensonandOrca 98506a6848 fix(sidebar): smoothly animate off-screen worktree reveal on click (#1302)
Clicking a worktree card whose row lies outside the sidebar viewport
caused an instant jump when scrolling it into view. Switching
`scrollToIndex` to `behavior: 'smooth'` turns that minimum-distance
scroll into an animated slide while keeping `align: 'auto'` so visible
cards still no-op (no re-centering).

Co-authored-by: Orca <help@stably.ai>
2026-04-30 23:58:06 -07:00
Brennan BensonandOrca 639e65f774 fix(sidebar): smoothly animate off-screen worktree reveal on click (#1301)
Co-authored-by: Orca <help@stably.ai>
2026-04-30 23:52:25 -07:00