Commit Graph
1877 Commits
Author SHA1 Message Date
Neil 35411bd76e Confirm onboarding dismissal 2026-05-26 01:49:39 -07:00
Yusuke Hata 36b4b726fa feat(terminal): add terminalJISYenToBackslash setting (#2818) 2026-05-26 00:50:15 -07:00
ddda84f529 fix(shell-ready): honor user's ZDOTDIR (XDG-layout fix, redo of #1737) (#1947)
* fix(shell-ready): honor ZDOTDIR without breaking zsh scoping

Fixes #1866

This reimplements PR #1737 (reverted in #1864) with a safer approach
that preserves normal zsh startup semantics.

**Core fix**: Discover ZDOTDIR by sourcing user ~/.zshenv in a subshell
instead of inside a wrapper function. This preserves top-level zsh
scoping for common patterns like `typeset -U path` that broke in the
original implementation.

**Shell safety improvements**:
- Use `printf '%s\n'` instead of `echo` for capturing ZDOTDIR (handles
  special characters in paths safely)
- Subshell isolates early returns and side effects from wrapper

**Code quality**:
- Extract duplicated zsh wrapper template to `src/main/shell-templates.ts`
- Both local-pty and daemon paths now share identical wrapper logic

**Test coverage**:
- Add live zsh subprocess tests that spawn real zsh to verify:
  - XDG ZDOTDIR discovery works
  - `typeset -U path` in .zshrc preserves top-level scoping
  - Early returns in .zshenv don't crash the wrapper
  - Vanilla (non-XDG) configs fall back to HOME correctly
- Template structure tests validate subshell discovery logic

Before (broken):
```zsh
__orca_source_user_zshenv() {
  source "$HOME/.zshenv"  # typeset becomes function-scoped
}
```

After (fixed):
```zsh
_orca_discovered_zdotdir=$(
  unset ZDOTDIR
  [[ -f "$HOME/.zshenv" ]] && source "$HOME/.zshenv" 2>/dev/null
  printf '%s\n' "${ZDOTDIR}"
)
export ORCA_ORIG_ZDOTDIR="${_orca_discovered_zdotdir:-${_orca_spawn_orig_zdotdir:-$HOME}}"
```

The subshell sources .zshenv at top-level (preserving normal scoping),
captures only the ZDOTDIR value, then exits. User rcfiles (.zshrc, etc.)
are still sourced at the wrapper's top level, so all scoping works normally.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* Add shell-script-literal test framework and improvements

Adds a new declarative test framework for shell-ready tests that uses
literal shell scripts (copy-pastable into terminals) with inline snapshots.

Framework features:
- Shell scripts as string literals with # Run: marker to split setup/test
- Direct script execution (no brittle parsing) via temp files
- Path normalization for reproducible snapshots (<HOME>, <WRAPPER_DIR>)
- Auto-detects shell from command, supports bash/zsh/sh
- Inline snapshot testing with vitest toMatchInlineSnapshot()

Code quality improvements:
- Extract escapeRegex to shared string-utils.ts (deduplicates 2 copies)
- Refactor shell-templates.ts for readability (condense comments, add structure)
- Pre-compile regex patterns to avoid hot-path allocation
- Fix path normalization to sort by length (prevent nested path corruption)
- Fix actualUserHome handling to skip empty values

All tests passing (64/64 shell-ready tests, 55/55 affected tests).

Files added:
- src/main/providers/__tests__/shell-ready-framework/shell-script-test.ts
- src/main/providers/__tests__/shell-ready-framework/README.md
- src/main/providers/__tests__/shell-ready-framework-example.test.ts
- src/shared/string-utils.ts

Files modified:
- src/main/shell-templates.ts (readability cleanup)
- src/main/codex/config-toml-trust.ts (use shared escapeRegex)
- src/main/daemon/shell-ready.test.ts (updated for new framework)
- src/main/providers/local-pty-shell-ready.test.ts (updated for new framework)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(shell-ready): preserve zshenv semantics

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
2026-05-26 00:24:45 -07:00
Jinwoo HongandOrca 6f18d362cc Improve mobile markdown editing (#2826)
Co-authored-by: Orca <help@stably.ai>
2026-05-26 00:07:53 -07:00
BorjaandNeil e510421699 Add Command Code as a supported CLI agent (#2520)
* Add Command Code as a supported CLI agent

Register Command Code (https://commandcode.ai) across the agent
catalog, launch config, telemetry kind, agent-status icon record, and
settings search. Detection uses the full `command-code` binary rather
than the shorter `cmd` alias that `npm i -g command-code` also
installs — agent-process-recognition normalizes process names by
stripping `.exe`/`.cmd` extensions, so using `cmd` would collide with
Windows' built-in `cmd.exe` shell.

Closes #2083

* Complete Command Code agent registration

---------

Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
2026-05-25 22:35:41 -07:00
Neil ab80339158 Fix shell-launched OMP status hooks (#2821)
* Fix shell-launched OMP status hooks

* Update oh-my-pi branding

* Add OMP to mobile agent metadata
2026-05-25 22:20:15 -07:00
Neil 6b51b85519 Fix OMP agent status routing (#2815) 2026-05-25 19:32:15 -07:00
Brennan BensonandOrca add481978e Revert Claude scoped settings launch path (#2809)
Co-authored-by: Orca <help@stably.ai>
2026-05-25 19:03:14 -07:00
Brennan BensonandOrca e0af80ddec Fix onboarding tour footer and copy (#2799)
Co-authored-by: Orca <help@stably.ai>
2026-05-25 18:56:43 -07:00
formatme efd75da5d6 Add OMP as first-class TUI agent
Adds OMP as a first-class TUI agent and keeps Pi/OMP overlay state isolated across local and relay PTY paths.\n\nValidated locally with focused Vitest coverage, typecheck, lint, git diff --check, and Electron manual verification using installed omp (omp/15.3.2).
2026-05-25 18:35:48 -07:00
Jinwoo HongandOrca bec6b81cb4 Fix floating workspace terminal shortcut focus (#2801)
Co-authored-by: Orca <help@stably.ai>
2026-05-25 17:18:06 -07:00
Brennan BensonandOrca a2c71461b4 Isolate Codex hooks in Orca runtime home (#2350)
Co-authored-by: Orca <help@stably.ai>
2026-05-25 15:07:40 -07:00
Jinwoo HongandOrca 3a40c62169 Improve Computer Use permission setup (#2758)
Co-authored-by: Orca <help@stably.ai>
2026-05-25 14:54:47 -07:00
Brennan BensonandOrca 9453d63989 Persist right sidebar visibility globally (#2792)
Co-authored-by: Orca <help@stably.ai>
2026-05-25 13:38:45 -07:00
Neil 6744f19a49 Refine shortcut settings UX (#2787)
* Compact shortcut row actions

* Redesign shortcuts settings controls

* Refine shortcuts settings UX

* Polish shortcut settings interactions
2026-05-25 11:36:53 -07:00
Neil d4703bd1ab Restore agent hook opt-out controls (#2778) 2026-05-25 10:37:22 -07:00
Jinjing 18ed410b19 feat: allow starting from primary worktree (#2781) 2026-05-25 01:54:03 -07:00
Brennan Benson 5287a581a6 Revert "Allow OS metadata during worktree delete preflight" (#2776) 2026-05-24 23:23:31 -07:00
Brennan BensonandOrca fdb63366d3 Allow OS metadata during worktree delete preflight (#2760)
Co-authored-by: Orca <help@stably.ai>
2026-05-24 23:00:40 -07:00
Jinwoo HongandOrca 3d85148e95 Change floating workspace shortcut default (#2678)
Co-authored-by: Orca <help@stably.ai>
2026-05-24 12:03:08 -07:00
Neil bea744b7e4 Revert "Hide branch names behind workspace card property" (#2740) 2026-05-23 23:04:59 -07:00
Neil 28ba9151a5 Revert "Add agent hook opt-out controls" (#2739) 2026-05-23 23:04:57 -07:00
Neil f0627cccc6 Fix SSH target removal state cleanup (#2710) 2026-05-23 21:44:40 -07:00
Neil 4f81953d10 feat: add agent hook opt-out controls (#2714) 2026-05-23 21:16:49 -07:00
Neil cacc09e92f Add commit failure AI recovery action (#2705)
* Add commit failure AI recovery action

* Add agent picker to commit failure fix action
2026-05-23 21:13:00 -07:00
Neil 283fdc6805 Bound PTY batch flushes to reduce typing latency spikes (#2724)
* Bound PTY batch flushes

* Add PTY batch flush benchmark

* Reduce PTY runtime ingress work

* Fix PTY benchmark lint
2026-05-23 20:01:06 -07:00
Neil 3dd281eb8e Hide branch names behind workspace card property 2026-05-23 19:16:50 -07:00
Neil 82a461c66e Fix OpenCode TUI scroll regression
Revert the May 23 terminal perf restore path and cap retained newline-free TUI redraw output while keeping completed-line terminal read pagination.
2026-05-23 17:16:35 -07:00
Neil 3233a41215 Allow custom shortcut for equalizing panes
Adds an unassigned terminal.equalizePaneSizes keybinding action so users can assign their own Equalize Pane Sizes shortcut without changing defaults.
2026-05-23 15:54:47 -07:00
Neil f72de14dbb Revert terminal perf rollback for OpenCode TUIs (#2718)
* Revert "Finish terminal perf rollback for OpenCode TUIs (#2716)"

This reverts commit 51618f1e92.

* fix: repair terminal perf restore regressions
2026-05-23 15:41:24 -07:00
Brennan BensonandOrca b9c55bb071 Add onboarding tour retention telemetry (#2713)
Co-authored-by: Orca <help@stably.ai>
2026-05-23 14:15:11 -07:00
Neil 51618f1e92 Finish terminal perf rollback for OpenCode TUIs (#2716)
* revert: terminal mounted worktree slicing

* fix: restore non-terminal rollback scope
2026-05-23 14:10:15 -07:00
Neil 14fa257394 Revert terminal hidden-output perf series (#2715)
Reverts the hidden terminal pressure changes from #2661 to restore the prior terminal rendering path while the fullscreen TUI regression is handled separately.
2026-05-23 13:53:11 -07:00
Neil 1ea9aeb362 fix: harden perf cleanup edge cases (#2712) 2026-05-23 13:38:05 -07:00
Jinjing 3f6940a746 fix: address review findings (#2703) 2026-05-23 13:11:08 -07:00
Jinjing ace241c43f feat: allow hiding workspace card metadata (#2701) 2026-05-23 13:02:50 -07:00
Jinjing c93dd901a3 fix: address review findings (#2695) 2026-05-23 12:33:49 -07:00
Brennan BensonandOrca 669ade2313 Update onboarding feature wall experience (#2652)
Co-authored-by: Orca <help@stably.ai>
2026-05-23 12:21:13 -07:00
Jinjing ffec74c7ba Fix SSH agent and identity file auth ordering (#2681)
* fix: address review findings

* fix: address CI failures
2026-05-23 01:56:15 -07:00
Jinwoo HongandOrca 007b7cc283 Fix Claude permission status across subagents (#2674)
Co-authored-by: Orca <help@stably.ai>
2026-05-23 04:28:45 -04:00
Jinjing a50a97670f Refine settings panel layout and controls (#2676) 2026-05-23 01:16:46 -07:00
Jinjing 102cc09622 Improve worktree import handling (#2677)
* feat: improve worktree import handling

* chore: remove PR docs assets

* rm html
2026-05-23 01:13:33 -07:00
Neil 58accdf8a8 Revamp onboarding notification setup (#2670) 2026-05-22 23:47:31 -07:00
Jinjing de96ac5678 fix: address review findings (#2667) 2026-05-22 23:42:40 -07:00
Neil 79b18f6fed Fix Orca Mobile layout and sidebar controls (#2663)
* Fix Orca Mobile layout and sidebar controls

* Use brand icons for mobile platform badges

* Add readable card for mobile pairing steps

* Align mobile flow primary actions

* Fix mobile sidebar toggle defaults
2026-05-22 23:32:17 -07:00
Jinjing 002cab9d82 fix: address review findings (#2664) 2026-05-22 22:49:31 -07:00
Brennan BensonandOrca e8837275fe Default workspace list to repo grouping (#2657)
Co-authored-by: Orca <help@stably.ai>
2026-05-22 20:14:45 -07:00
Jinwoo HongandOrca 02a0aad987 Refresh ports when advertised URLs change (#2638)
Co-authored-by: Orca <help@stably.ai>
2026-05-22 12:17:21 -07:00
Yusuke Hata ff469bfd5b fix: resolve JIS keyboard bracket and backslash shortcut mapping (#2624)
Fix JIS bracket/backslash shortcut intent matching across tab and terminal-pane shortcuts.\n\nReview follow-up:\n- centralize semantic punctuation matching for bracket/backslash keys\n- preserve physical-code fallback when key text is inconclusive\n- avoid stealing AltGr bracket input on Windows/Linux\n- add regression coverage for JIS, AltGr, and fallback behavior
2026-05-22 14:54:19 -04:00
5ca6828371 feat: surface dev-server URLs in the ports panel (#2534)
* Surface dev-server URLs in workspace ports panel

Why: the OS scanner only sees `127.0.0.1:3001`, so clicking a Vite
port in the panel opens the wrong host/protocol when the dev server
binds with a custom hostname or HTTPS (e.g. `https://local.getmontecarlo.com:3001/`).
We now watch PTY output for advertised origins and prefer them at
display, copy, and open time. Falls back to the OS-derived address.

The watcher taps the central `runtime.onPtyData` path so it sees local,
daemon-backed, and SSH PTYs uniformly. URL candidates are validated with
`new URL()`, sanitized to origin only (no path/query/fragment/userinfo),
and gated by listener-PID validation so stale entries get evicted when
a different process reuses the port.

SSH `DetectedPort` enrichment is out of scope here — that panel uses
separate data shapes and port-forwarding may rewrite the local port,
making naive URL reuse incorrect. Tracked as a follow-up.

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

* Extend advertised-URL enrichment to SSH ports

Why: the first cut only enriched the local workspace ports panel. SSH
worktrees use a separate panel with `DetectedPort` and `PortForwardEntry`
shapes scanned by the remote relay, so the same dev-server banners that
flow through Orca's SSH PTYs were captured by the watcher but never
surfaced.

The renderer-side SSH scanner doesn't know which worktreeId the watcher
keyed an entry under, so a small helper walks the store to find every
worktree attached to a given connection and asks the watcher for the
best match per port (custom DNS host > loopback > LAN IP, https and
recency as tie-breakers). Enrichment runs at every broadcast and list
site in src/main/ipc/ssh.ts.

For a forwarded SSH port, the open action now uses
`advertisedProtocol://customHost:localPort`. We deliberately reuse the
local forward port — the remote port number is not reachable from the
local machine — and we only reuse the host when it's a custom DNS name
(IP literals and the remote's `localhost` get ignored, falling back to
127.0.0.1 like before). Loopback advertisements from the remote box are
a no-op because they don't translate to the local browser.

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

* Address Codex review of advertised-URL enrichment

Four findings from the post-implementation review:

- Watcher rejects wildcard advertised hosts (`0.0.0.0`, `::`, `*`). The
  OS scanner already normalizes wildcards to localhost for the connect
  host; if a dev server prints `http://0.0.0.0:3000/` verbatim we keep
  that sensible default instead of letting the watcher overwrite it
  with a host the browser can't open.

- Pre-bind pending buffer is now capped at 32 distinct PTY IDs with
  LRU eviction. Spawn-failure paths could otherwise leave never-bound
  entries forever — per-PTY 16 KiB bound was the only guard.

- `clearProviderPtyState` now calls `advertisedUrlWatcher.unbindPty`.
  SSH reattach failures, `clearPtyOwnershipForConnection`, and daemon
  spawn-failure cleanup bypass `runtime.onPtyExit`; routing through the
  central provider teardown plugs those holes (and is idempotent with
  the existing `onPtyExit` hook for natural exits).

- `lookupBest` accepts an optional current listener PID and runs the
  same pin-then-evict logic as `lookup`. `enrichSshDetectedPorts`
  threads `DetectedPort.pid` through so a stale advertised URL gets
  evicted on remote port reuse. Forward enrichment stays best-effort
  (forwards are persisted config, not observed listeners — detected
  enrichment is the eviction path).

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

* fix: refresh SSH ports when advertised URLs change

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

* fix: show advertised URLs in port rows

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

* fix: address advertised URL review issues

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

* fix: tighten advertised URL cache handling

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

* fix: align advertised URL edge cases

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

* fix: handle advertised URL cache invalidation

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

* fix: show status port action tooltips

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

* fix: keep port action tooltips above popover

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

* fix: clear port action focus after click

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

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
2026-05-22 03:52:51 -04:00