Commit Graph
6200 Commits
Author SHA1 Message Date
github-actions[bot] 34d746ee0c release: v1.4.121-rc.2 v1.4.121-rc.2 2026-07-03 20:31:54 +00:00
Jinwoo-HandOrca 56d4d6b2b0 Findings + tests: batch windows were the DSR-load gap (19->8.0ms dev); timing tests updated to 2ms windows
Co-authored-by: Orca <help@stably.ai>
2026-07-03 16:30:51 -04:00
Jinwoo-HandOrca e67a91d7af Cut daemon and main PTY batch windows 8ms -> 2ms
At 9% pipeline utilization the DSR-under-load latency is fixed batching
windows, not queue depth (proved by the MessageChannel drain lever
moving nothing). Both hops charged an expected half-window per chunk;
2ms keeps burst coalescing at negligible IPC overhead (~500 msgs/s
worst case vs MB/s payloads).

Co-authored-by: Orca <help@stably.ai>
2026-07-03 16:28:36 -04:00
Jinwoo-HandOrca 2434dfaaee Schedule zero-delay terminal drains via MessageChannel
Chromium clamps nested setTimeout(0) to ~4ms, stacking dead gaps onto
every parse-clocked drain tick; the explicit 4ms high-priority re-arm
interval added more. A posted message is still a macrotask — input and
paint are serviced between posts — so cooperative yielding survives
without the clamp. Generation-tokened cancellation; vitest keeps the
timer path (fake timers can't advance channel posts) plus a real-timer
smoke test for the channel path. Standing-queue target: VS Code's ~7ms
class (measured us 18.6ms, them 7.18ms, same rig).

Co-authored-by: Orca <help@stably.ai>
2026-07-03 16:24:52 -04:00
Jinwoo-HandOrca 4252a7eab4 VS Code head-to-head: Orca beats/ties 5 of 6 metrics (16x idle, 5x styles-stress, better p99); load p50 gap attributed to ACK window + timer-clamped drain cadence
Co-authored-by: Orca <help@stably.ai>
2026-07-03 16:20:28 -04:00
Jinwoo-HandOrca a03918156d Merge origin/main (#6954 typed OMP title flicker fix) into orca-performance
The fix patched main's direct title-update block in onPtyData — an
architecture the term-speed-2 chain replaced with the per-PTY title
tracker. Resolution keeps the tracker and ports the fix's semantics into
applyTrackedPtyTitle: foreground-owner probe with title-observation
sequencing on status transitions, same-status compatible-title changes
reuse the pending probe, and mobile snapshot fan-out is deferred until
the probe settles (delayPtyBackedMobileSnapshotForForegroundAgent).
Renderer side keeps the chain's shared handleCommandFinished (side-
effect authority routing) and grafts the fix's
clearCommandInferredPaneAgentAfterPtySideEffects() call.

Validation: #6954's own 760+ lines of merged tests pass against the
tracker port (574 runtime + 344 pty-connection/lifecycle); full battery
5,661 green (1 documented pre-existing WSL failure); typecheck clean.

Co-authored-by: Orca <help@stably.ai>
2026-07-03 04:05:31 -04:00
Jinwoo-HandOrca 72b1d2bc61 Prod verdict: v1.4.121-rc.0 bench — DSR-load p50 134->18.6ms (7.2x), agent-tui 2.0->11.2 MB/s, idle at Terminal.app parity; pipeline now cadence-bound
Co-authored-by: Orca <help@stably.ai>
2026-07-03 03:52:06 -04:00
Jinwoo-HandOrca 07f21a86c7 Fix stray brace from revival merge in long-table-scroll-restore e2e spec (broke e2e transform in CI)
Co-authored-by: Orca <help@stably.ai>
2026-07-03 03:50:22 -04:00
Jinwoo-HandOrca d55df1e3ad Merge origin/main (v1.4.120 + #7205) into orca-performance
Conflict resolutions:
- terminal-stream-protocol: Metadata keeps opcode 12 (shipped to mobile
  in v1.4.120); branch-only Ack renumbers to 13.
- scheduler: keep HIGH_PRIORITY_MAX_WRITES_PER_DRAIN=8 (perf fix) over
  main's 2 (#7139 landed there with the old constant).
- headless-emulator: keep chain structure (scanner classes, query-reply
  forwarding); graft main's pathFlavor/remotePosixFileUriAuthority OSC7
  options through TerminalOscCwdTitleScanner. Main's
  TerminalPrivateModeTracker is logic-identical to the chain's
  TerminalMouseModeMirror (kept, with pre-filter).
- orca-runtime: keep chain factory; graft main's pathFlavor wiring and
  snapshot cwd fallback; keep both teardown lines.
- pty-connection: keep both chain reconcile and main's ordered-seq
  tracking; clear the chain's restored-snapshot baseline on pty exit
  (same seq-domain boundary main's reset enforces) — fixes revive with
  restarted seq counter dropping chunks as duplicates.
- subscribe-buffer tests: updated to merged semantics — main's inline
  overflow recovery ships current data as the FIRST snapshot; the
  chain's resized/pending-output-overflow follow-up remains as backstop.

Validation: typecheck clean; 7,548 tests green across daemon/ipc/
runtime/pane-manager/terminal-pane/shared/mobile-transport (1 documented
pre-existing WSL failure).

Co-authored-by: Orca <help@stably.ai>
2026-07-03 03:34:59 -04:00
Dvitash 0ff2c09002 Fix typed OMP remote title flicker (#6954) 2026-07-03 00:26:37 -07:00
Neil f1bcb77392 fix: parse Claude Fable current-week usage
Claude Code 2.1.199 renders the Fable plan bucket as Current week (Fable), while Orca only parsed a standalone Fable heading. Accept weekly-style Fable headings as the distinct Fable weekly meter while keeping broader Fable-weekly copy as a section boundary to avoid false positives.

Validation:
- pnpm exec vitest run --config config/vitest.config.ts src/main/rate-limits/claude-pty.test.ts src/main/rate-limits/claude-fetcher.test.ts src/main/rate-limits/service.test.ts src/renderer/src/components/status-bar/tooltip.test.ts src/renderer/src/components/status-bar/inline-usage-bars.test.tsx
- pnpm run typecheck
- pnpm exec oxlint src/main/rate-limits/claude-pty.ts src/main/rate-limits/claude-pty.test.ts src/main/rate-limits/claude-fetcher.ts src/main/rate-limits/claude-fetcher.test.ts src/main/rate-limits/service.ts src/main/rate-limits/service.test.ts src/renderer/src/components/status-bar/tooltip.test.ts src/renderer/src/components/status-bar/inline-usage-bars.test.tsx
- git diff --check HEAD~1..HEAD
- live local Claude fetcher returned fableWeekly: 62
2026-07-03 00:16:19 -07:00
github-actions[bot] 0ab4d8925c release: v1.4.120 v1.4.120 2026-07-03 07:06:43 +00:00
Jinwoo-HandOrca 7ec672f483 Findings: flow control merged; definition-of-done accounting; prod verification re-scoped to packaged RC
Co-authored-by: Orca <help@stably.ai>
2026-07-03 03:01:50 -04:00
Jinwoo-HandOrca 348aeb3250 Add producer-side PTY flow control (watermarks + protocol v19)
Main now pauses the actual PTY when a pane's renderer-pending backlog
crosses the 256KB high watermark and resumes once it drains below the
32KB low watermark (wide hysteresis band so a draining queue cannot flap
pause/resume per flush slice). node-pty pause() stops the pty fd read, so
the kernel/ConPTY buffer fills and a flooding shell blocks on write —
flood-induced buffered lag becomes shell blocking instead of unbounded
main-process buffering (terminal-performance-initiative §5).

Transport: new fire-and-forget pausePty/resumePty daemon notifications
(protocol v19; 18 added to PREVIOUS_DAEMON_PROTOCOL_VERSIONS), routed
DaemonServer -> TerminalHost -> Session -> subprocess pause()/resume().
LocalPtyProvider pauses node-pty directly. Router/degraded providers
forward; IPtyProvider gains optional pauseProducer/resumeProducer.

Safety invariants:
- Lost-resume failsafe: daemon Session auto-resumes 5s after a pause with
  no matching resume; main re-asserts the pause at most once per 5s while
  still above the high watermark, so a lost resume can never wedge a shell
  and a sustained flood stays throttled.
- Resume on every teardown path: Session kill/exit/dispose/detach; main
  releases on pty exit and on window-destroyed bookkeeping wipes; the
  adapter owes paused sessions a resumePty on the next connect after a
  socket drop.
- Providers without support (SSH relay, legacy protocol <= v18) no-op
  silently, and the scrollback-scaled pending-output cap still bounds
  main memory when pause is unavailable.
- Kill switch: PRODUCER_FLOW_CONTROL_ENABLED in ipc/pty.ts flips the
  whole mechanism off in one line.

daemon-errors.ts is split out of types.ts to stay under the max-lines cap.

Tests: watermark transitions/hysteresis/re-assert (controller unit),
lost-resume failsafe + resume-on-kill/exit/dispose/detach (session),
notification routing + v18 gating + reconnect owed-resume (adapter),
direct pause/resume (local provider), and a flood test asserting pause
fires once, pending stays bounded at HIGH + one chunk, and resume fires
once after drain (ipc/pty).

Co-authored-by: Orca <help@stably.ai>
2026-07-03 02:48:01 -04:00
github-actions[bot] 8e1ce20289 release: v1.4.120-rc.6 v1.4.120-rc.6 2026-07-03 06:44:20 +00:00
Jinwoo HongandOrca 10e8f86899 Coalesce PTY input write bursts (#7205)
Co-authored-by: Orca <help@stably.ai>
2026-07-02 23:43:35 -07:00
Mark Xian 2848c5daf4 Fix rename inputs committing on CJK IME Enter confirmation (#6980)
Fixes #6980.
2026-07-02 23:37:12 -07:00
Rod Boev 09fc57e113 fix(browser): keep CDP reload from closing Orca browser tabs
Fix the per-tab CDP proxy reload path so raw Page.reload keeps the Orca browser tab alive. Lifecycle priming is bounded and root reloads use the same safer webContents reload behavior as Orca's own browser reload path.
2026-07-02 23:24:24 -07:00
Jinwoo-HandOrca e8ba7f0f79 Record A/B gate pass in findings log; add A/B result JSONs
Co-authored-by: Orca <help@stably.ai>
2026-07-03 02:22:59 -04:00
Siddiqui Qamar f0278c116e fix(mobile): preserve terminal input mode on reentry (#7129)
Fixes #6972.\n\nPreserves mobile terminal buffered/live input mode across Android terminal re-entry and session refreshes. Includes follow-up hardening for pre-hydration preference edits and failed storage reads.
2026-07-02 23:22:30 -07:00
Jinwoo-H a3c2785f8c Merge revive/term-speed-2: term-speed-2 chain revived onto orca-performance
A/B gate (load-controlled, alternating, n=2/side): DSR-under-load p50 tied
(~20ms both), p99 better on revive (26-63ms vs 108-218ms), throughput
within overlapping noise. Full report in the revival agent's merge commit
and notes/terminal-performance-initiative.md findings log.
2026-07-03 02:20:41 -04:00
Jinwoo-HandOrca 24cde7a44d Retract confounded daemon conviction; mandate load-controlled A/B protocol for the revival merge gate
Co-authored-by: Orca <help@stably.ai>
2026-07-03 02:08:18 -04:00
Jinwoo-HandOrca 71c89da9bb Pre-filter daemon OSC/mouse scanners for introducer-free chunks
Skips the scan-tail copy and full-chunk walks when a chunk cannot contain
an OSC or private-mode sequence (single native includes() checks), with
split-sequence correctness preserved via explicit tail retention. Strictly
positive micro-optimization on the daemon per-chunk path; 641 daemon tests
green (1 pre-existing WSL failure unrelated).

Co-authored-by: Orca <help@stably.ai>
2026-07-03 02:07:21 -04:00
NeilandOrca fa94065a81 Recover exported terminal handles from live PTYs (#7162)
* Recover exported terminal handles from live PTYs

* Guard terminal-handle adoption: first-wins, no collisions

Discovery adoption of ORCA_TERMINAL_HANDLE is now skipped when the pty
already has a handle bound this session (re-keying would strand waiters
registered under the old handle) or when the reported handle is already
bound to a different pty (provider-reported values are not trusted to be
collision-free). Also adds the relay why-comment and PtyProcessSummary
type alias from review feedback.

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

---------

Co-authored-by: Orca <help@stably.ai>
2026-07-02 23:06:32 -07:00
Jinwoo-HandOrca d776792f1e Findings: revival branch green but perf-gated — daemon Session ingest regressed 103->40-48 MB/s (chain emulator restructure); merge blocked until blockedfix parity
Co-authored-by: Orca <help@stably.ai>
2026-07-03 02:01:22 -04:00
github-actions[bot] bf6a39987c release: v1.4.120-rc.5 v1.4.120-rc.5 2026-07-03 05:50:01 +00:00
Jinwoo-H 64b6f7abea Merge remote-tracking branch 'origin/orca-performance' into revive/term-speed-2 2026-07-03 01:44:34 -04:00
Jinwoo-HandOrca a5052c35f3 Merge nwparker/term-speed-2-architecture-docs into orca-performance base
Revives the terminal model/view architecture chain (hidden view parking,
hidden delivery gate, side-effect authority in main, model query authority
— all kill-switched, defaults on) on top of orca-performance's terminal
performance fixes. 34 conflicted files resolved with these decisions:

- Both sides' features kept and kill-switchable. orca-performance's fixes
  preserved exactly: parse-clocked scheduler drains (9e8bb2243), windowed
  retained-tail redraw (4e08a28cd), throttled wait-blocked check
  (66f20258e), #7139/#7150 cooperative drain, backlog caps, wedge guards,
  and probe-certified replay release.
- orca-runtime.ts onPtyData: chain's per-PTY title tracker + side-effect
  facts replace the inline OSC title blocks; our scheduleWaitBlockedCheck
  and redraw-cursor plumbing retained; refreshPtyForegroundAgent re-grafted
  into applyTrackedPtyTitle on status transitions.
- pty.ts: chain's hidden-gate drop sites, restore markers, initiallyHidden
  spawn marking, ConPTY DA1 record, and view-attribute/delivery-interest IPC
  wired through our newer spawn/delivery structure. The chain's flat 2 MB
  pending cap was NOT taken: our scrollback-scaled cap (#7150, empty-drop +
  droppedOutput sentinel) wins and now also emits the chain's one-per-episode
  pty:modelRestoreNeeded 'pending-cap' marker when the gate is enabled. Our
  8 MB renderer in-flight high water kept over the chain's 2 MB.
- pty-connection.ts: chain's gate sync, model-restore channel, side-effect
  fact consumer, and post-restore seq reconciliation composed with our
  hidden-startup query grammar, synchronized-frame latency machinery, and
  probe-certified restore. Phase 6 (skip-grammar deletion) intentionally NOT
  taken: our side evolved that grammar past the chain's base and #7150
  machinery builds on it; with the gate on it is dormant (main drops hidden
  bytes), with switches off it remains the byte-identical fallback.
- Shared module moves adopted (agent-title-*, github-links, bell detector,
  command-code, PR-link detector) with our newer bounded regex-free OSC
  parsers wired through the chain's scanner classes; our pi-synthetic/Devin/
  MiMo agent additions ported into the split modules.
- daemon-pty-adapter: chain's sleep-restore cache + our checkpoint cooldown,
  teardown flag, and oscLinks-carrying cold-restore payload combined.
- rpc/methods/terminal.ts: chain's ACK-gated multiplex output + recovery
  snapshots composed with our budgeted mobile snapshots and resize re-stream.
- Tests adapted only where they encoded superseded cadence: watermark counts
  (2 MB->8 MB), pending-cap trim -> empty-drop sentinel, initial snapshot
  frame seq (layout seq -> snapshot output seq), mock module paths.

Contract tests: 881 passed. Renderer terminal suites: 1895 passed.
Full main runtime+ipc: 2974 passed. Typecheck (3 configs) clean.
Pre-existing baseline failures (pty-subprocess WSL, PR sidebar, Linear
prompt, SidebarToolbar) are unrelated and fail identically on 7839fb9db.

Co-authored-by: Orca <help@stably.ai>
2026-07-03 01:44:20 -04:00
Brennan BensonandOrca d65c938529 Keep runtime mirror sized with desktop terminal resizes (#7192)
Co-authored-by: Orca <help@stably.ai>
2026-07-02 22:42:49 -07:00
Neil 0fd2d67c69 Allow manual sorting of Project Groups (#7191) 2026-07-02 22:23:18 -07:00
Neil b523c5311f fix: show Claude Fable usage in account switcher
Show Fable usage in inactive Claude account switcher previews by supplementing OAuth usage with scoped Claude CLI /usage data, with macOS scoped Keychain safety checks and compact preview layout coverage.

Validation:
- pnpm exec vitest run --config config/vitest.config.ts src/main/rate-limits/claude-fetcher.test.ts src/main/rate-limits/service.test.ts src/renderer/src/components/status-bar/inline-usage-bars.test.tsx src/renderer/src/components/status-bar/tooltip.test.ts
- pnpm run typecheck
- pnpm exec oxlint src/main/rate-limits/claude-fetcher.ts src/main/rate-limits/claude-fetcher.test.ts src/main/rate-limits/service.ts src/main/rate-limits/service.test.ts src/renderer/src/components/status-bar/StatusBar.tsx src/renderer/src/components/status-bar/inline-usage-bars.test.tsx
- git diff --check HEAD~1..HEAD
2026-07-02 22:18:12 -07:00
NeilandOrca 4caea00f16 Skip the synchronous cold-restore replay for live daemon sessions in doSpawn (#7105)
Co-authored-by: Orca <help@stably.ai>
2026-07-02 22:04:05 -07:00
Neil 185b768609 Add rich Markdown spellcheck setting (#7103) 2026-07-02 21:59:41 -07:00
NeilandOrca 4c4cbf2d76 Fix Vim alternate-screen terminal redraw recovery (#7142)
* Fix Vim alternate-screen terminal redraw recovery

* Decide alternate-screen atlas recovery from parsed buffer state

Replace the raw-chunk scan for alternate-screen enter sequences with the
xterm parser's own verdict: in-place rewrite chunks check
buffer.active.type (plus a parse-time buffer-switch count) inside the
write callback, where the buffer is authoritative. Covers enter/exit
sequences split across PTY chunk boundaries and full enter-exit cycles
coalesced into one write, and deletes the hand-rolled CSI parser.

Adds regression tests from a real captured vim session (including a
CSI sequence split at a 1024-byte PTY read boundary) and a contract
pin against the real @xterm/headless parser.

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

---------

Co-authored-by: Orca <help@stably.ai>
2026-07-02 21:59:17 -07:00
Jinwoo-HandOrca 545ea0b44a Add producer flow-control design to initiative plan
Co-authored-by: Orca <help@stably.ai>
2026-07-03 00:39:48 -04:00
Jinwoo-HandOrca 7839fb9dbd Findings + results: three stacked fixes unlock the pipeline (agent-tui 16x, DSR-load p50 161->18.8ms in dev)
Co-authored-by: Orca <help@stably.ai>
2026-07-03 00:37:57 -04:00
Jinwoo-HandOrca 66f20258e3 Throttle the terminal wait-blocked check off the PTY hot path
Post-windowed-tail attribution (findings log 2026-07-03): the blocked-
reason complex — two full-tail buildTerminalWaitText builds plus
toLowerCase and multi-pattern scans per chunk, existing only to stamp
waitBlockedAt — consumed ~85% of onPtyData's remaining cost (~700-790ms/s
under an agent-TUI flood).

The check now runs at a 50ms cadence over coalesced chunks (PTY chunk
boundaries are arbitrary, so coalescing preserves semantics), with a
trailing-edge timer so burst-final state is always evaluated, and an
immediate bypass when the incoming chunk (plus a 31-char split carry)
contains a prompt keyword — so actionable-prompt stamping stays
per-chunk-immediate while keyword-free flood frames skip the complex
entirely. Previous wait text is cached per pty instead of rebuilt, and
state is cleared at both pty teardown sites.

1,415 runtime tests green (including the cross-chunk prompt test, which
exercises the keyword bypass), typecheck and lint clean.

Co-authored-by: Orca <help@stably.ai>
2026-07-03 00:35:51 -04:00
github-actions[bot] f7ec1c727e release: v1.4.120-rc.4 v1.4.120-rc.4 2026-07-03 04:28:04 +00:00
Jinwoo HongandOrca 827d2bb6aa Refine TUI wheel scroll feel (#7179)
Co-authored-by: Orca <help@stably.ai>
2026-07-02 21:27:16 -07:00
Brennan BensonandOrca 3e4ace0562 Fix Codex pane output tearing after app occlusion (#7173)
Co-authored-by: Orca <help@stably.ai>
2026-07-02 21:00:03 -07:00
Brennan BensonandNeil 0ea354d454 Keep terminals responsive under agent output load (#7139)
Co-authored-by: Neil <neil@stably.ai>
2026-07-02 20:39:49 -07:00
Jinwoo-HandOrca 054b665d90 Findings: remaining whale is the per-chunk blocked-reason check (~85% of onPtyData post-fix)
Co-authored-by: Orca <help@stably.ai>
2026-07-02 23:00:51 -04:00
Jinwoo-HandOrca 7eb6e08b1c Record windowed-tail partial win + next-cycle recipe in findings log
Co-authored-by: Orca <help@stably.ai>
2026-07-02 22:57:05 -04:00
Jinwoo-HandOrca 78467822bb Add dev bench results: parse-clock and windowed-tail fixes
Co-authored-by: Orca <help@stably.ai>
2026-07-02 22:56:35 -04:00
Jinwoo-HandOrca 4e08a28cdf Window the retained-tail redraw path to the cursor's reach
Attribution (findings log 2026-07-03): main's onPtyData consumed ~93% of
the event loop under an agent-TUI flood, and the dominant term was
appendNormalizedToMultilineTailBuffer + finalizeRetainedTerminalRows
materializing ~2x tail-length row objects plus a per-row trailing-space
regex on every chunk — 0.888ms/chunk at the 2,000-line cap, on every
Claude-Code-shaped frame (cursor-up + erase-below).

The multiline algorithm now runs on a suffix window sized by the chunk's
maximum upward cursor excursion (plus the inherited redraw cursor and a
safety margin); the untouched prefix is shared by reference with a cheap
last-char trailing-space check to match the reference trim. Pathological
full-height cursor-ups fall back to the unwindowed implementation, which
is kept verbatim and exported as the reference for the 500-case
differential fuzz (retained-tail-redraw-window.equivalence.test.ts).

Micro-bench at a full 2,000-line tail: 0.888 -> 0.073 ms/chunk (12x).
1,415 runtime tests green, typecheck clean.

Co-authored-by: Orca <help@stably.ai>
2026-07-02 22:54:42 -04:00
Jinwoo-HandOrca 59316c40bc Findings: 51x loss attributed to O(tail) retained-tail redraw path in main onPtyData
Co-authored-by: Orca <help@stably.ai>
2026-07-02 22:48:57 -04:00
Jinwoo-HandOrca be854330c9 Record task #9 attribution + parse-clock fix in findings log
Co-authored-by: Orca <help@stably.ai>
2026-07-02 22:15:25 -04:00
Jinwoo-HandOrca 9e8bb22432 Parse-clock high-priority terminal drains instead of fixed-nap dripping
Attribution (task #9): the drain loop wrote at most 2x16KB then slept
4/16ms regardless of parse speed — an isolation bench (new
pane-terminal-output-scheduler-throughput.bench.test.ts) measures that
drip at 1.9 MB/s background / 27 MB/s foreground against xterm's
~103 MB/s parse rate, matching the baseline-jul02 end-to-end numbers
(agent-tui 2.0 MB/s in prod 1.4.91).

Fix: high-priority (visible-pane) drains now re-arm on xterm's
parse-completion callback and carry 8 writes per tick; the isolation
ceiling rises 27 -> 117.6 MB/s (parse-limited). Background cadence is
deliberately unchanged (2 MB/s drip protects the focused pane; hidden
delivery is term-speed-2's job). DRAIN_TIME_BUDGET_MS still bounds
per-tick work, preserving #7139's cooperative-drain intent.

Validation: 621 scheduler/guard/pty tests green, typecheck clean.

Co-authored-by: Orca <help@stably.ai>
2026-07-02 22:13:45 -04:00
Brennan Benson 087ad66aa2 Revert "Ship serve-sim camera dylib as data and materialize it at runtime" (#7172) 2026-07-02 18:46:00 -07:00
Jinwoo-HandOrca b662d72791 Record dev-build #7153 check in findings log
Co-authored-by: Orca <help@stably.ai>
2026-07-02 21:35:09 -04:00