Commit Graph
87 Commits
Author SHA1 Message Date
Neil 8666c4031b fix: allow dot-dot-prefixed pty session paths (#3705) 2026-05-30 12:02:18 -07:00
Neil 7d3b8333aa Clean up daemon hello handshake listeners (#3831) 2026-05-30 11:45:21 -07:00
1265d52d60 fix: time out daemon hello handshakes (#3739)
* fix: time out daemon hello handshakes

* test: cover daemon hello close races

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

---------

Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
2026-05-30 11:40:09 -07:00
Neil ac8146ab67 perf: handle large daemon pty reconciliation lists (#3785) 2026-05-30 10:11:34 -07:00
Neil feabbd2ea2 fix: clean up daemon health socket listeners (#3771) 2026-05-30 09:41:18 -07:00
Neil 6368562230 fix: clean up production daemon shutdown listener (#3765) 2026-05-30 09:22:01 -07:00
Neil 1c594ac381 fix: clean up daemon socket probe listeners (#3763) 2026-05-30 09:15:02 -07:00
Neil 44533684b0 fix: clean up daemon socket startup listeners (#3717) 2026-05-30 07:24:06 -07:00
Trevin Chow 519a120828 feat: show the running coding agent's icon in terminal tabs (#3410) 2026-05-30 02:14:22 -04:00
Jinwoo Hong 0d060e1d21 Make WSL first-class for local agents and provider accounts (#2649) 2026-05-29 16:06:33 -07:00
Jinwoo Hong 1371402bc6 Preserve live PTYs during daemon resolver refresh (#2974) 2026-05-27 23:40:34 -07:00
Neil dafc35bbc8 fix: clean daemon init startup listeners (#2884)
* fix: clean daemon init startup listeners

* test: cover daemon startup listener cleanup
2026-05-26 20:27:47 -07:00
Neil fe7042b948 fix: clean production launcher startup listeners (#2885) 2026-05-26 20:24:42 -07:00
Neil 721ef42ab8 fix: clear daemon server startup error listener (#2877) 2026-05-26 20:14:17 -07:00
Neil a6f9a5826e Add Command Code agent status tracking
Adds Command Code hook installation, status normalization, launch seeding, and terminal-output fallback detection for working/done sidebar status. Includes review hardening for long-running tool repaint cadence and prompt sanitization across split ANSI chunks.
2026-05-26 14:45:34 -07:00
Neil 016b574fe9 Fix macOS daemon DNS resolver reuse (#2835) 2026-05-26 13:13:08 -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
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
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
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
Jinjing c93dd901a3 fix: address review findings (#2695) 2026-05-23 12:33:49 -07:00
AIEPhoenix bd6139878c fix(daemon): strip Electron node flag from PTYs
Strip ELECTRON_RUN_AS_NODE from daemon-spawned PTY environments so user shells do not inherit Electron's internal Node-mode flag. Adds regression coverage for the daemon PTY env boundary.

Fixes #2414.
2026-05-22 00:12:54 -07:00
Neil cef5570188 perf: flush daemon stream data per session (#2595) 2026-05-21 21:40:37 -07:00
Neil 8aa4d3df19 perf: checkpoint daemon PTYs only when dirty (#2593) 2026-05-21 21:27:53 -07:00
Neil 19bfc56cc3 Revert "Reduce renderer and terminal performance churn" (#2579) 2026-05-21 18:22:25 -07:00
Neil ded5fda98d Reduce renderer and terminal performance churn (#2572) 2026-05-21 18:20:00 -07:00
Jinwoo Hong da93f0d852 Fix WSL Codex terminal environment (#2558) 2026-05-21 17:29:46 -04:00
Jinjing cb15124cbb Improve daemon echo latency after interactive input (#2535) 2026-05-21 11:48:53 -07:00
Anwesh 25794b7c61 Emit OSC 133 C/D from bash shell wrappers
Fix Linux/bash agent status cleanup by emitting OSC 133 command lifecycle markers from bash shell wrappers, including local, daemon, and SSH relay paths.
2026-05-20 22:13:33 -04:00
Jinwoo Hong 6abf031d66 Fix WSL terminal settings parity (#2446) 2026-05-20 17:33:07 -04:00
Jinwoo Hong db3765fc17 Revert terminal stream backpressure changes (#2380) 2026-05-19 18:04:42 -07:00
Jinjing 9d5f27fa3c Fix PR check refresh and terminal tombstone test (#2375)
* Prefetch task PR checks by head SHA

* Fix terminal host tombstone cap test
2026-05-19 17:42:30 -07:00
Jinjing 87c16a99c9 Improve lineage parent chip UI (#2364)
* fix: address review findings

* fix: unblock PR CI checks
2026-05-19 16:31:56 -07:00
Neil 49b504dc45 Improve terminal input redraw latency
Keep terminal UI drawing glyphs on WebGL and bypass daemon stream batching for small redraws immediately after terminal input.
2026-05-19 15:49:35 -07:00
Brennan BensonandOrca 7d71131bb4 Infer interrupted agent status from terminal input (#2263)
Co-authored-by: Orca <help@stably.ai>
2026-05-19 15:19:38 -07:00
Jinwoo HongandOrca f010bb8619 Fix terminal stream backpressure and split-pane input lag (#2341)
Co-authored-by: Orca <help@stably.ai>
2026-05-19 13:59:01 -07:00
Brennan BensonandOrca e671606fff Add Copilot agent hook status support (#2027)
Co-authored-by: Orca <help@stably.ai>
2026-05-17 13:05:24 -07:00
Jinjing 73d4a1781e fix: combine buf0-bot validated bug fixes (#2086) 2026-05-16 11:34:13 -07:00
Jinwoo HongandOrca 9217cf625d Fix mobile TUI scroll gestures (#1940)
Co-authored-by: Orca <help@stably.ai>
2026-05-15 13:17:35 -07:00
Brennan BensonandOrca 60fdd11114 Migrate agent pane identity to stable leaf ids (#1909)
Co-authored-by: Orca <help@stably.ai>
2026-05-15 12:10:06 -07:00
Brennan BensonandOrca 60656e7a6e Improve PTY exhaustion recovery messages (#1931)
Co-authored-by: Orca <help@stably.ai>
2026-05-15 10:50:22 -07:00
Brennan BensonandOrca 09814150ea fix(dashboard): drop agent rows via foreground-process tracking, not title heuristic (#1167)
Co-authored-by: Orca <help@stably.ai>
2026-05-14 20:28:52 -07:00
Jinwoo Hong 5d85380a74 fix(pty): add Windows daemon spawn diagnostics (#1862) 2026-05-14 17:06:54 -04:00
Neil a7eb3e7179 Revert "fix(shell-ready): honor user ZDOTDIR"
Reverts #1737 because sourcing user .zshenv inside a wrapper function can change zsh scoping behavior for common startup-file patterns. We will revisit with a safer targeted fix.
2026-05-14 13:28:02 -07:00
Neil 4d81408b7c Revert "Recover from daemon hello timeout" (#1860) 2026-05-14 13:08:29 -07:00
Prateek RungtaandClaude Opus 4.7 11f24f17ad fix(shell-ready): honor user's ZDOTDIR so XDG-layout zsh users get the right rcfiles (#1737)
The wrapper .zshenv used to capture ORCA_ORIG_ZDOTDIR before sourcing the
user's ~/.zshenv, so users who set ZDOTDIR=$XDG_CONFIG_HOME/zsh in .zshenv
ended up with the wrapper sourcing ~/.zshrc instead of
~/.config/zsh/.zshrc. Functions, aliases, and PATH edits silently
disappeared inside every shell-ready PTY (startup-command, attribution
shim, SSH).

Reorder: clear ZDOTDIR, source user .zshenv inside a function (so an early
`return` doesn't abort our wrapper), recapture from user-resolved →
spawn-env → HOME, then re-pin ZDOTDIR to the wrapper dir baked into the
template. Trailing-slash normalization now matches the Node-side
normalizer. Same change in the renderer- and daemon-side wrappers.

New zsh-subprocess tests (gated on `which zsh`) cover the XDG case,
early-return survival in user .zshenv, spawn-env preservation, HOME
fallback, and self-loop normalization including pathological multi-
trailing-slash paths.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 12:45:58 -07:00
zhang.bin bf9af63090 fix(pty): preserve WSL worktree cwd in terminals (#1808) 2026-05-14 01:57:31 -07:00
Jinwoo Hong 63bd56c770 Recover from daemon hello timeout (#1179) 2026-05-14 01:55:21 -07:00
Neil 0c1429e26b perf(terminal): batch daemon pty stream events (#1818)
Coalesce adjacent daemon PTY data chunks before NDJSON stream serialization while preserving exit ordering.
2026-05-14 01:22:57 -07:00
Neil 40528262c0 perf(terminal): checkpoint only dirty daemon sessions (#1812) 2026-05-14 00:28:01 -07:00