Commit Graph
4725 Commits
Author SHA1 Message Date
Brennan BensonandOrca ed529a011b fix(updater): restore Windows update signature verification (#7861)
Co-authored-by: Orca <help@stably.ai>
2026-07-08 22:28:13 -07:00
NeilandOrca 25ea2bbfd1 onboarding: seamless macOS notification permission step with live state detection (#7684)
* feat(onboarding): state-aware macOS notification permission step

The Set up notifications step showed a one-size-fits-all 'Open Mac
Settings' button that simultaneously fired the macOS permission prompt
and opened System Settings — two competing system UIs, with System
Settings unnecessary for the common fresh-install case.

Electron exposes no API to read macOS notification authorization, but
scheduling outcomes do reveal it: a silent probe notification's 'show'
event means permission is granted, 'failed' means delivery is blocked.
A new notifications:probeDelivery IPC runs that probe (cached via
passive delivery evidence and a persisted confirmation flag), and the
onboarding card now renders the real state:

- fresh install: the probe itself pops the native Allow dialog the
  moment the step opens; the card flips to 'Notifications are enabled'
  automatically when the user clicks Allow (silent 2.5s re-probes)
- blocked: amber card with an Open System Settings deep-link, which
  also self-heals once the user flips the toggle
- granted: green confirmation card

The test-notification button now feeds the same card instead of the
ambiguous 'if no banner appeared…' toast during onboarding.

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

* fix: don't log expected probe rejections while polling for permission

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

* fix: amber warning styling + single stable dev bundle id for notifications

- Blocked card now uses the app's shipped amber idiom (tinted surface with
  amber title/body) instead of white-on-amber-wash, which read muddy in
  dark mode; macOS permission card split into its own module to stay under
  the max-lines budget.
- Dev instances previously minted a unique macOS bundle id per
  branch x Electron version, registering a new Notification Settings entry
  every time ('Orca: <branch>' rows piling up forever) and pointing the
  settings deep-link at ids System Settings can't resolve. All dev
  instances now share com.stablyai.orca.dev: one Notification Center
  entry, one permission grant covering every dev build.

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

* fix: tighten macOS permission card copy

Body copy was one long sentence; now a single short instruction with
'Updates automatically.' as a separate dimmer line. Also repairs locale
catalog parity for keys introduced by commits rebased into this branch.

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

* fix: drop 'Updates automatically.' line; ad-hoc sign dev app copies

The extra line read as confusing filler — the cards now carry one short
instruction each.

Dev Electron copies had broken code signatures (the Info.plist identity
edits invalidate the ad-hoc seal), which macOS punishes by refusing
Notification Center registration outright: every dev notification failed
with UNErrorDomain error 1, the app never appeared in System Settings >
Notifications, and the settings deep-link had nothing to land on. The dev
runner now ad-hoc re-signs the copied bundle after the plist edits
(bundleLayoutVersion bumped so stale unsigned copies are recreated).
Verified end-to-end: runner-built copy passes codesign --verify --deep,
probe delivery returns delivered, the onboarding card flips green in dev,
and the deep link opens the dev app's own notifications pane.

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

* fix: drop confusing copy line; session-only permission evidence

Removes the 'Updates automatically.' line from both permission cards.

Also drops the persisted notificationDeliveryConfirmed flag: OS-level
permission changes between sessions, and a stale positive rendered a
false green card. Delivery evidence is now session-scoped only.

Documented detection ceiling (verified empirically on macOS 26): while
the permission dialog is unanswered — and when notifications are toggled
off in System Settings after being authorized — macOS accepts requests
and silently swallows them, with no public API (Notification Center
delivered-history and legacy ncprefs both included) able to distinguish
that from real delivery. 'failed' remains definitive for unsigned builds
and dialog-level denials.

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

* feat: real macOS notification permission readout via native helper

Electron has no API for UNUserNotificationCenter authorization, and every
observable fallback lies: scheduling succeeds (and getHistory lists the
notification) even while macOS silently swallows display because the
permission dialog is unanswered or notifications were toggled off in
System Settings. The onboarding card therefore showed 'enabled' after the
user disabled notifications.

Adds native/notification-status-macos: a tiny Swift binary that prints
the app's real authorization status. It runs from inside the app bundle
(NSBundle resolves the bundle by walking up from the executable) and
embeds the app's CFBundleIdentifier in a __TEXT,__info_plist section so
every codesign --force pass — electron-builder's signing or the dev
runner's ad-hoc deep sign — derives the identifier macOS keys
notification records to. Spawning it from the app returns authorized /
denied / not-determined exactly matching System Settings.

notifications:probeDelivery now prefers this readout (authoritative,
silent), firing at most one dialog-trigger probe per session while the
decision is pending, and falls back to the previous delivery-probe
heuristics when the helper is unavailable. The card polls the readout
silently in every state, so toggling Allow notifications in System
Settings flips the card within a poll — both directions, verified live.
Test notifications also consult the readout so 'delivered' is no longer
claimed for swallowed notifications.

Packaged builds ship the helper via extraResources and sign it in
afterPack like the computer-use helper; dev copies compile it on demand
(swiftc, non-fatal when missing) with the shared dev bundle id.

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

* feat: in-app fallback for swallowed notifications + permission card in Settings

- Dispatch now consults the authorization readout before creating a
  native notification: when macOS would silently swallow it (denied or
  prompt unanswered) it returns reason 'blocked-by-system' instead of
  piling invisible notifications into Notification Center. The terminal
  notification path surfaces that as a once-per-session in-app toast
  with an Open System Settings action. Mobile fan-out is unaffected.
- Settings > Notifications now shows the same live permission card as
  onboarding (moved to components/notifications/), polling the readout
  so System Settings changes reflect within seconds, and the test
  button updates it inline.
- Test sends that are blocked at the OS level now show the
  settings-pointing failure toast instead of a generic error.

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

* fix: hide macOS permission card while Orca notifications are disabled

A green 'Notifications are enabled' card next to a disabled Enable
Notifications toggle read as a contradiction — the card now renders (and
the readout polls) only while Orca's own notifications setting is on.
Also single-flights the authorization helper so simultaneous agent
completions share one readout process.

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

---------

Co-authored-by: Orca <help@stably.ai>
2026-07-08 22:21:40 -07:00
Jinjing c170866180 fix(terminal): clear leaked mouse-reporting modes on pane reattach (#7893)
* fix(terminal): clear leaked mouse-reporting modes on pane reattach

A TUI that enables mouse tracking (?1000/1002/1003 + SGR 1006/1016) and
dies uncleanly never emits the disable sequence, so the daemon's snapshot
records the mode and buildRehydrateSequences re-arms it on every reattach.
POST_REPLAY_REATTACH_RESET cleared cursor/focus/kitty state but not mouse
modes, so a plain shell in the reattached pane echoed every pointer-motion
report (`<35;col;rowM`) as literal text.

Add RESET_MOUSE_REPORTING (?9l ?1000l ?1002l ?1003l ?1006l ?1016l) to both
POST_REPLAY_REATTACH_RESET and POST_REPLAY_MODE_RESET. Live agent panes keep
mouse modes via POST_REPLAY_LIVE_AGENT_REATTACH_RESET, so agent scroll is
unaffected.

Verified against the real daemon serializer + real xterm: the old reset
leaves mouseTrackingMode armed, the new reset returns it to 'none'.

* test: add regression tests for terminal mouse mode leak on reattach

- Add an E2E test to verify that a warm reattach disarms mouse modes
  left armed by an uncleanly exited TUI.
- Add a test fixture that writes the mouse tracking enable sequence
  without a matching disable sequence.
- Ensure the reattached pane disarms mouse tracking and that actual
  mouse movement produces no reports.

* Add types to isMouseReport in terminal reattach leak test

Explicitly annotate parameter and return types for the isMouseReport
helper function inside the page.evaluate block.

* Refactor mouse-mode leak E2E test to use shell printf and live pane

Eliminate the external Node.js fixture file and streamline the E2E test
by using a POSIX printf shell builtin to arm the mouse tracking modes.

Additionally, verify the leak precondition by inspecting the active pane's
live terminal state (mouseTrackingMode) rather than querying internal
daemon buffer snapshots via window.api.pty.getMainBufferSnapshot.
2026-07-08 22:14:08 -07:00
Jinjing 404804737d Change GitHub issue layout from sidebar to top columns (#7887)
Replace the sidebar layout in the GitHub issue details view with a
responsive grid of top columns placed above the description body. This
ensures the description content is not squeezed by a right rail and fits
the header's full content width.
2026-07-08 22:06:46 -07:00
Jinjing 4ded642a3a Detect and surface recoverable zero-turn sessions in AI Vault (#7889)
Identify Claude sessions with no saved conversation turns but possessing
recoverable signals such as queued prompts or subagent transcripts.
This displays them in the sidebar with a "Not saved" badge instead of
filtering them out as empty, and provides detailed notices to recover
them via logs while disabling standard resume actions.

Additionally, extract Gemini session parsing logic into a separate
module and support counting sibling subagent transcripts across local
and remote SSH session scans.
2026-07-08 21:47:02 -07:00
Neil 8dbcb2be3e feat(floating-terminal): amber attention dot for unacknowledged bells and completions (#7888)
Show a small amber dot on the floating-workspace launcher (both the
floating-button and status-bar triggers) whenever any floating-workspace tab
still has an unacknowledged terminal bell or agent completion, and a
composited amber dot on the Windows tray icon when the window is
minimized/hidden. Both clear through the existing show-until-interact paths —
engaging with or closing the offending tab drops the dot with no stale unread
state left behind.

The launcher dot derives from the existing per-tab/per-pane unread maps via a
new selectFloatingWorkspaceHasUnread selector (primitive boolean, empty-
workspace early return, no bespoke state). The tray dot rides the notification
dispatch and clears on window show/restore.
2026-07-08 21:39:49 -07:00
Jinjing 5c6f0ad52d Fix stale open pr after merge (#7886)
* docs: design fix for sticky OPEN PR after merge

Capture root cause and primary fix for Checks panel preserving open/draft
PR cache on authoritative no-pr after merge + HEAD diverge.

* Clear open and draft PR caches on fallback refresh misses

Avoids preserving non-terminal ("open" or "draft") PR states in both
the PR and hosted-review caches when a fallback refresh returns an
authoritative "no-pr" result. This resolves a sticky "OPEN" UI bug
where a merged PR continued to show as open.

- Removes fallback PR preservation from the main PR cache check.
- Gates the hosted-review cache fallback preservation to only accept
  terminal states ("closed" or "merged").
- Updates unit tests to assert cache clearing for open/draft states.

* Remove stale open PR refresh design document

Delete the design and diagnosis document for the stale open PR checks
panel refresh issue now that the investigation and planning phase is
complete.
2026-07-08 21:38:49 -07:00
Jinjing 040e61e13f Keep explicit push and force push actions available without upstream (#7864)
- Keep the explicit "Push" and "Force Push" dropdown options enabled when
  there is no upstream or the upstream status is loading, letting Git
  resolve the target at execution time.
- Stop auto-upgrading regular push operations to force push in the background,
  ensuring normal push actions stay non-force.
- Explicitly route the primary action and commit-and-push flows to the
  "force_push" action when a lease force push is required.
2026-07-08 21:22:49 -07:00
JinjingandOrca 6b4831d5ef Fix Grok and Pi terminal title normalization and status detection (#7880)
* fix(mobile): normalize Grok rotating OSC titles at the main observation boundary

Desktop already collapses Grok Build's rotating working frames via the
renderer's normalizeTerminalTitle, but the main process stored raw OSC
titles, so mobile session tabs (fed from pty.lastOscTitle) still saw a
distinct title every spinner frame and re-touched snapshots each time.

Apply normalizeTerminalTitle once where main records an observed OSC
title, before the prevTitle comparison that gates session-tab and
mobile-snapshot touches, and normalize hydration-seeded titles the same
way so the first live frame after a seed compares equal. Agent status
stays detected from the raw title, mirroring the renderer tracker.

Covers remoted/SSH PTYs too since they surface through the same main
observation path.

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

* Fix Grok and Pi terminal title normalization and status detection

- Require a strict "spinner - phrase - grok" pattern for Grok working
  titles to prevent false positives on other agent tasks ending in
  "- grok" (such as Claude or Codex).
- Treat collapsed "Pi" and "OMP" synthetic titles as idle by default
  to prevent them from reverting to neutral status after normalization.
- Prevent duplicate mobile session tab updates during Grok status
  frame rotations by ensuring they normalize to a stable title.

---------

Co-authored-by: Orca <help@stably.ai>
2026-07-08 21:22:06 -07:00
JinjingandOrca 7e1a77728b fix(renderer): preserve live agent cursor visibility across replays (#7858)
Cursor Agent parks the real cursor on a blank row and hides it (?25l),
drawing its own caret. Orca's post-replay resets forced ?25h, painting a
stray cursor block below the agent's prompt after reattach and after
hidden-to-visible snapshot restores.

Root cause fix: stop re-showing a cursor the replayed bytes intentionally
hid, instead of compensating afterwards.

- Live-agent reattach reset now preserves the payload's final DECTCEM
  state (last ?25l/?25h wins); the post-parse viewport veto re-shows the
  cursor when the screen disproves a live parked agent, so a shell can
  never inherit a permanently hidden cursor from a dead TUI's leftovers.
- Hidden-output restore now uses a live-agent variant of the snapshot
  reset when status/title corroborates a live agent: forcing ?25h
  re-showed the parked cursor, and ?1004l permanently silenced the
  focus-in the agent needs to unpark (agents only enable focus reporting
  at startup, so nothing ever re-armed it).

Co-authored-by: Orca <help@stably.ai>
2026-07-08 19:08:00 -07:00
Jinjinganddalveytech-vincent 070a956a72 feat(source-control): add push failure AI recovery (#7826)
* feat(source-control): add Fix push failure with AI for pre-push hooks

Detect pre-push hook failures separately from auth/transport errors so
push toasts and inline messages no longer suggest checking repo access.
Mirror the commit-failure recovery flow with a fixPushFailure action,
summary panel, details dialog, and agent launch recipe in Settings.

Fixes #6497

* feat(source-control): add push failure AI recovery

Co-authored-by: dalveytech-vincent <vincent@dalveytech.com>

---------

Co-authored-by: dalveytech-vincent <vincent@dalveytech.com>
2026-07-08 18:59:28 -07:00
Jinjing 2af8fb886f Collapse Grok rotating working titles to stable label (#7863)
Grok Build's working OSC titles interpolate a rotating status or tool
phrase between the spinner and its name, causing tab and sidebar
titles to fluctuate rapidly. Collapse these working frames to a stable
"⠋ Grok" label, while leaving idle and session titles untouched.
2026-07-08 18:57:07 -07:00
Jinjing 29cbe2d8cb Show empty sessions by default in AI Vault Panel (#7853)
* Show empty sessions by default in AI Vault Panel

Change the default state of `hideEmptySessions` from true to false, and update the active filter count calculation to treat false as the new default.

* Centralize AI Vault view defaults and fix reset state alignment

Consolidate the default values for sorting, grouping, and hiding empty
sessions into a single place. This prevents inconsistencies between the
initial state, the badge count adjustment checks, and the "Reset" view
action, where the reset previously toggled hideEmptySessions to true
contrary to the initial false value.

* Count agent adjustments by membership instead of list length

Ensure that swapping one agent for another (which keeps the total
array length the same) is correctly identified as a deviation
from the default of having all agents enabled.
2026-07-08 18:44:54 -07:00
Jinjing 9e23b8963b fix(agent-status): show waiting for Claude AskUserQuestion, stop stale-title worktree spinners (#7852)
Claude's AskUserQuestion tool is auto-allowed, so it emits a PreToolUse (not
PermissionRequest) while blocked on a human answer. normalizeClaudeEvent mapped
that to `working`, so the sidebar showed a spinner that decayed to grey while
the question sat. Map the auto-allowed AskUserQuestion PreToolUse to `waiting`
instead, mirroring the Kimi/OpenCode handling, so the row and worktree dots read
amber "Waiting for input".

Separately, a frozen braille-spinner title left by an exited agent (e.g.
"⠐ Review branch for regressions" over a shell prompt) kept classifyTitleActivity
returning `working`, spinning the worktree dot forever with 0 agents — the row
builder rejects the same unattributable title, so no agent row is shown. Gate
tabHasStatus's title-derived working/permission on the same agent attribution the
row builder uses (resolveAgentTypeFromTerminalTitle), so a title only spins the
dot when it would also show a row. Hook-driven status (hasLiveWorking/
hasPermission) is untouched.
2026-07-08 18:44:43 -07:00
JinjingandOrca c2b074bd15 fix(terminal): shape Arabic/RTL text on the cell grid via xterm character joiner (#7665)
* fix(terminal): shape Arabic/RTL runs on the cell grid via xterm character joiner (#5262)

Register a character joiner that groups contiguous RTL runs (tunneling
through neutral spaces/digits/punctuation between RTL words) so both the
WebGL and DOM renderers draw each run as one string, applying native
contextual shaping and BiDi ordering inside the run's grid-aligned cell
box. Buffer and PTY stream are untouched; xterm un-joins ranges holding
the cursor or a partial selection, keeping cursor visibility and
selection cell-accurate. Non-RTL lines early-return via a single
charCodeAt sweep.

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

* Deregister Arabic shaping joiner when disposing pane

Since xterm.js does not automatically remove registered character joiners
upon terminal disposal, they must be explicitly deregistered to avoid
memory and registration leaks.

- Update `registerArabicShapingJoiner` to return a cleanup function.
- Store and call the cleanup handler when disposing a managed pane.
- Update tests to assert proper registration and deregistration.

* fix(terminal): gate RTL joining on live WebGL, tunnel ZWNJ/ZWJ/RLM, lock joiner lifecycle in tests

Review findings on the Arabic shaping branch:
- The DOM renderer sizes a joined span with one letter-spacing value applied
  per character, so joined RTL runs blew out row grid alignment whenever the
  WebGL renderer was unavailable (GPU off, auto policy, context loss). The
  joiner now only returns ranges while the pane's WebGL addon is live.
- ZWNJ/ZWJ/RLM (mandatory in Persian orthography) hard-broke RTL runs,
  rendering word halves in swapped visual order. They are now transparent
  inside a run without extending or counting toward it.
- openTerminal's existing unicode-ordering test failed at HEAD because the
  fake terminal lacked registerCharacterJoiner; the harness now implements
  the joiner API and a new test locks register-on-open/deregister-on-dispose.

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

* fix(terminal): keep zero-width RTL marks from opening joined runs, treat ALM as transparent

Round-2 review findings:
- A combining mark (tashkeel/niqqud) orphaned after an LTR base could open
  an RTL run mid-cell; xterm rounds that string range to an empty joined
  cell range and the WebGL renderer draws an empty glyph over the next
  character. Marks now extend and count only in runs opened by a spacing
  RTL letter.
- ALM (U+061C) sat inside the strong-RTL block scan, so it opened and
  counted toward runs unlike RLM. It now joins the transparent set.
- New test locks openTerminal wiring the joiner predicate to
  pane.webglAddon (previously () => true would pass the suite).

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

* fix(terminal): treat zero-width Cf controls in RTL blocks as run-transparent

Round-3 review finding: zero-width format controls that live inside the
strong-RTL scan ranges (Arabic number signs U+0600-0605, end of ayah U+06DD,
Syriac abbreviation mark U+070F, disputed end of ayah U+08E2) and the BOM/
ZWNBSP U+FEFF are width-0 in xterm. Like combining marks they could open a
run mid-cell, producing an empty joined cell range that blanks the following
glyph in the WebGL renderer. They are Cf not Mn, so canOpenRtlRun could not
catch them. Fold them into the run-transparent set (never open, count, or
break a run) and document the upstream standalone-width-0-cell join skew.

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

* Document WebGL decoration limitation for Arabic shaping joiner

Add comments explaining a known upstream limitation in xterm.js WebGL
renderer where search-match highlights inside a joined run render
all-or-nothing, similar to ligatures.

---------

Co-authored-by: Orca <help@stably.ai>
2026-07-08 18:29:36 -07:00
Brennan BensonandOrca 47389990a5 fix(mobile): surface disconnected source-control states + keep the mobile WS fallback port stable (STA-1511) (#7855)
Co-authored-by: Orca <help@stably.ai>
2026-07-08 18:28:59 -07:00
01d21cdce1 fix(agents): route WSL OMP hooks to the Windows listener (#7565) (#7641)
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
2026-07-08 17:05:21 -07:00
Brennan BensonandOrca 95f3933ea2 feat(native-chat): upload composer attachments over SSH (#7832)
Co-authored-by: Orca <help@stably.ai>
2026-07-08 16:56:16 -07:00
Jinwoo Hong 20832ef36f ci(daemon): fail builds, packaging, and CI when the terminal daemon cannot start — and stop failing silently (#7849) 2026-07-08 19:46:14 -04:00
Brennan BensonandOrca c8c5201145 perf(windows): relax whole-process-table scans for terminals with no agent evidence (#7607)
Co-authored-by: Orca <help@stably.ai>
2026-07-08 16:41:21 -07:00
Jinwoo Hong 685418d8e4 fix(daemon): daemon cannot start in 1.4.129-rc.1 — electron require leaked into daemon-entry chunk (#7844) 2026-07-08 19:41:09 -04:00
NeilandOrca 4a6d12959f fix: recover fresh local terminal spawns from a deleted saved cwd (#7847)
After #7750 removed the containment guard, the residual #7239 failure mode
is a persisted/inherited startupCwd whose directory no longer exists: every
spawn dies with the provider's missing-directory error. Fresh local renderer
spawns now opt in (cwdFallback: 'worktree') to recover at the workspace root
with a generic in-terminal notice; reattach, SSH, remote-runtime, runtime/API
and mobile callers keep exact cwd semantics, and existing directories —
including outside the worktree (#7685) — spawn as requested.

Co-authored-by: Orca <help@stably.ai>
2026-07-08 16:33:58 -07:00
Brennan BensonandOrca bd4f2e02db Fix Orca Mobile agent tabs opening as a plain shell instead of launching the agent (#7837)
Co-authored-by: Orca <help@stably.ai>
2026-07-08 15:34:37 -07:00
Brennan Benson e218bf88f6 Keep your New GitHub issue draft after an accidental dismissal (#7778) 2026-07-08 14:38:25 -07:00
Jinwoo HongandOrca 5a390cd60e Fix Claude Agent Teams detection without Claude CLI (#7834)
Co-authored-by: Orca <help@stably.ai>
2026-07-08 14:34:16 -07:00
Jinwoo HongandOrca 0784a7ea37 fix(ssh): bridge the full Orca CLI over the SSH relay instead of a hardcoded command switch (#7771)
The relay CLI shim on SSH remotes rejected every orchestration/mutation
command with 'Unsupported SSH Orca CLI command' because the host handled
relay CLI requests with a hand-rolled allowlist of five read-only-ish
commands. The host now runs the real bundled orca CLI entry (same entry
as the local shell command, via ELECTRON_RUN_AS_NODE) as a captured
subprocess, so remote invocations get the full command surface by
construction. Remote cwd is carried via ORCA_CLI_CWD so cwd-based
selectors (--worktree active) resolve against the caller's remote
directory; only Orca terminal-context env vars cross the bridge.

Host-interactive commands (serve, claude-teams, agent-teams-tmux) get a
targeted error, and the legacy in-process switch remains as a fallback
when the host CLI entry cannot be launched. Relay-side request timeouts
are raised to fit mutation and long-poll (--wait/--timeout-ms) commands,
and stdin forwarding now covers *-stdin payload flags.

Fixes #7716

Co-authored-by: Orca <help@stably.ai>
2026-07-08 13:59:42 -07:00
Brennan Benson e3eec5c39f Let pane-scoped evidence beat stale tab icon identity (#7755) 2026-07-08 13:54:06 -07:00
c2468ab820 fix(source-control): keep unresolved PR comment prompts retryable (#7466) (#7638)
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: brennanb2025 <brennankbenson@gmail.com>
2026-07-08 13:24:04 -07:00
Jinwoo HongandOrca 2b3eba46cb Per-environment SSH state so desktop clients get live SSH overlays for Remote Orca Server workspaces (STA-1468 desktop topology) (#7831)
Co-authored-by: Orca <help@stably.ai>
2026-07-08 13:17:19 -07:00
Jinwoo HongandOrca ace196b08e fix(ssh): stop false "Remote connection dropped" after sleep/App Nap pauses (#7828)
* fix(ssh): guard mux dead-link detector against sleep/App Nap timer pauses

After system sleep or App Nap timer throttling, the first post-wake
timeout-check tick saw pre-pause keepalives as >20s stale and killed a
healthy link (false 'Connection timed out (no ack received)' ->
dispose('connection_lost') -> reconnect overlay churn). Track the last
tick time; when a tick gap far exceeds the interval, reset staleness
tracking, probe with a fresh keepalive, and let the next full window
make an honest liveness determination. A genuinely dead link is still
detected within ~25s after wake.

Also adds probeLiveness(timeoutMs): a keepalive round-trip primitive
that resolves true on the first frame of any kind, used by the resume
path to distinguish surviving links from dead ones.

Refs #7773

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

* fix(ssh): probe relay liveness on system resume instead of unconditional reconnect

powerMonitor 'resume' previously called connectionManager.reconnect()
for every active target, guaranteeing a teardown + reconnect overlay on
every wake even when the connection survived sleep. Now each session's
relay link is probed (keepalive round-trip, 5s timeout, one retry for
slow post-wake network); only targets whose probe fails are reconnected.
Dead-after-sleep connections still reconnect promptly. The 'suspend'
grace-time handling is unchanged.

Refs #7773

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

* feat(relay): prefix relay.log diagnostic lines with ISO timestamps

The remote relay.log had no timestamps, which blocked correlating
reconnect flaps with user activity and sleep/wake windows while
diagnosing #7773. Daemon-mode diagnostic lines now carry an ISO
timestamp prefix ('<ISO> [relay] ...', grep-stable). Connect-mode and
orca-cli passthrough stderr is untouched since it goes back to the
app/user terminal and is parsed (handshake-mismatch detection).

The relay bundle is content-hashed at build time, so the versioned
install picks up the new relay automatically on next deploy.

Refs #7773

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

* fix(ssh): re-check session identity before post-probe resume reconnect

The resume probe can take ~10s; if the user disconnected the target or the
session/connection was replaced during that window, reconnecting would
resurrect an intentionally torn-down connection (CodeRabbit).

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

---------

Co-authored-by: Orca <help@stably.ai>
2026-07-08 13:06:39 -07:00
Jinwoo HongandOrca 6c988356e2 fix: Remote Orca Server reconnect liveness — recover mirrors, input routing, and creates after tunnel drops (#7827)
Co-authored-by: Orca <help@stably.ai>
2026-07-08 12:08:27 -07:00
Jinwoo HongandOrca b665708c7f fix(ssh): make fs.listFiles cancellable and single-flight per relay client (#7769)
Co-authored-by: Orca <help@stably.ai>
2026-07-08 12:01:06 -07:00
Jinwoo HongandOrca 864594ffdd Fix SSH state for paired remote clients + complete target re-adoption sweep (STA-1468) (#7767)
* Sweep all persisted carriers of a removed SSH target id on re-adoption

reassignSshTargetId re-pointed repos and worktree metas but left the old
target id embedded in persisted session pty ids (ssh:<id>@@pty-N in tabs,
layouts, remoteSessionIdsByTabId), the startup reconnect list
(activeConnectionIdsAtShutdown, replayed via ssh.connect at boot — the
exact 'SSH target not found' in STA-1468), sleeping-agent resume records,
provisioned project host setups, sidebar host-scope arrays, and relay pty
leases. Any survivor resurfaces later as a failing connect or reattach.

New ssh-target-id-migration module re-points every carrier in one pass,
wired into reassignSshTargetId with per-carrier unit and store-level
round-trip tests.

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

* Bridge SSH connection state to paired remote clients

The SSH surface was desktop-only: ssh:state-changed went to the host's
own BrowserWindow and the web client's ssh API was a no-op stub, so a
paired client's reconnect overlay never learned the host connected and
its target labels stayed empty (STA-1468 — overlay stuck on 'please
connect' over a live terminal).

- New sshStateChanged runtime client event, emitted from broadcastSshState
  through OrcaRuntimeService onto the existing clientEvents stream.
- New ssh.listTargets / ssh.listRemovedTargetLabels RPC methods next to
  the previously unused ssh.getState / ssh.connect.
- Web preload now routes listTargets / listRemovedTargetLabels / getState
  / connect to the paired host's runtime RPC instead of stubbing them.
- useIpcEvents applies sshStateChanged on paired web clients through the
  same guarded path as desktop ssh.onStateChanged; desktop clients ignore
  the event since a foreign runtime's targets would pollute their local
  SSH store.

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

* Harden the SSH reconnect overlay against stale or unknown target state

- Only present the destructive 'SSH host removed' state on positive
  evidence (a removal tombstone label, or a hydrated non-empty target
  list lacking the id). A client whose SSH state never hydrated has an
  empty labels map for every id and must not offer workspace removal.
- After a failed Connect, resync target metadata so a stale overlay
  converges to the ghost/re-adopted state instead of offering the same
  failing Connect forever (the repeated 'SSH target not found' toast
  loop in STA-1468).

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

* Address CodeRabbit review on #7767

- Re-key workspaceSessionsByHostId partitions stored under a removed SSH
  host id during re-adoption (no writer keys partitions by ssh host today,
  but the schema tolerates it — re-key instead of stranding; live partition
  wins when both keys exist).
- Track SSH target-list hydration explicitly (sshTargetsHydrated) instead
  of inferring it from a non-empty label map, so a legitimately empty
  target list still counts as removal evidence and a never-hydrated client
  still never offers destructive removal.
- Apply the refreshed target list before the best-effort removed-labels
  fetch in the overlay resync, so a labels failure can't discard it.

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

---------

Co-authored-by: Orca <help@stably.ai>
2026-07-08 11:36:19 -07:00
38e82b4fff Fix AI Vault scanning for runtime hosts (#7631)
* Fix AI Vault runtime host scanning

* fix runtime ai vault response validation

* test runtime ai vault validation more loosely

* fix(ai-vault): harden runtime host scanning

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

* fix(ai-vault): resume runtime host sessions

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

---------

Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
2026-07-08 11:20:26 -07:00
14ac945c50 fix(main): detect CJK input source via cfprefsd on macOS 15 (#7572)
* fix(main): detect CJK input source via cfprefsd on macOS 15

macOS 15's `plutil -extract <key> json` aborts with "invalid object in
plist for destination format" on the AppleSelectedInputSources array even
though it is all strings, so the selected-input-source probe threw and fell
back to the keyboard layout id (com.apple.keylayout.US). That disabled
forwardAsciiPunctuation, so third-party IMEs (Sogou, Doubao) sent half-width
,.? to the PTY instead of full-width ,。? in terminal panes and agent chat.
Apple's built-in IME happened not to trip the plutil bug.

Read the live prefs via `defaults export` (cfprefsd) and extract as xml1
before converting the clean subtree to JSON, dodging both the plutil json
bug and the stale on-disk plist. The parser and CJK term list are unchanged.

* fix(main): reap CJK input-source probe process group on timeout

Run the macOS input-source probe via detached spawn and SIGKILL the whole
process group on timeout so a wedged cfprefsd can't orphan the defaults/plutil
pipeline stages (the probe re-runs on every window focus-in). Pin absolute
/usr/bin paths, guard the stdout stream, and cover the non-zero-exit, spawn-
failure, and timeout fallbacks in tests.

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

---------

Co-authored-by: su'qiang <nslogname@MacBook-Pro.local>
Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
Co-authored-by: Orca <help@stably.ai>
2026-07-08 02:24:41 -07:00
Ken FukuyamaandJinjing 45931a716e Allow browser annotations to target existing agents (#7347)
* Allow browser annotations to target existing agents

* Update browser annotation send tooltip

* test: guard browser annotation send menu wiring

---------

Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
2026-07-08 01:35:37 -07:00
Brennan BensonandOrca c0091c07c3 perf(ssh): visibility-gate and back off the remote port scanner (#7610)
Co-authored-by: Orca <help@stably.ai>
2026-07-07 21:42:12 -07:00
a09a00f066 fix(pty): load omp status extension in wsl shells (#7642)
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
2026-07-07 21:24:08 -07:00
2ce77d9098 fix(runtime): keep same-path imports host-qualified (#7395)
* fix(runtime): keep same-path imports host-qualified (#7018)

* review: harden runtime repo host match against SSH-repo hijack

An unstamped repo with a connectionId is an SSH repo (resolves to
ssh:<id>), so a same-path runtime import must not adopt it into a
runtime/local host. Match/adopt an unstamped repo only when it has no
connectionId, mirroring the existing local-IPC dedup guard
(src/main/ipc/repos.ts). Adds a regression test that fails without the
guard (SSH repo hijacked into runtime host).

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

* review: only runtime hosts backfill an unstamped repo

A legacy unstamped repo is indistinguishable from a genuine local repo
(both have null executionHostId and connectionId). Restrict the adoption
branch to runtime incoming hosts so a local/ssh import at a colliding
path can never re-attribute a real local project to the wrong host.
Runtime is the only host that lost its identity to the pre-#7018
path-only import and needs the backfill. Adds a regression test.

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

---------

Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
2026-07-07 20:45:55 -07:00
Jinwoo HongandOrca 8368e946df Fix orchestration agent prompt injection (#7758)
Co-authored-by: Orca <help@stably.ai>
2026-07-07 19:50:57 -07:00
Jinwoo Hong dfc12f2cf6 fix(watcher): isolate @parcel/watcher in a forked process so native crashes can't kill the app (#7547) (#7757) 2026-07-07 22:10:22 -04:00
Jinwoo HongandOrca 98bee1b419 Fix un-removable SSH ghost worktrees after host remove/re-add (#7753)
Co-authored-by: Orca <help@stably.ai>
2026-07-07 19:01:42 -07:00
Brennan BensonandOrca f311539f9c Split agent-detection into title status/display/identity domain modules (title evidence plan, PR 3) (#7612)
Co-authored-by: Orca <help@stably.ai>
2026-07-07 17:50:37 -07:00
Luis Sebastian Urrutia Fuentes 37ba94a228 fix(i18n): polish Spanish locale copy (#7422) 2026-07-07 17:10:53 -07:00
Brennan BensonandOrca 482bfbc9bb Keep editor tabs in sync with external file changes instead of silently dropping them (#7591)
Co-authored-by: Orca <help@stably.ai>
2026-07-07 17:10:40 -07:00
Jinjing 9cc177b8ea Update mobile Android APK links to 0.0.24 (#7756) 2026-07-07 17:05:24 -07:00
c1d8086a04 fix(omp): migrate legacy overlay state (#7735)
* fix(omp): migrate legacy overlay state

* fix(omp): harden legacy overlay migration

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

---------

Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
2026-07-07 16:55:08 -07:00
Jinwoo HongandOrca 79d0de9c33 fix(terminal): remote query-reply corruption (#7329) + snapshot grid-width repaint (#7279) (#7736)
Co-authored-by: Orca <help@stably.ai>
2026-07-07 16:42:43 -07:00
Jinwoo Hong c256a5a417 Windows terminal update-survival (single consolidated PR) (#7538) 2026-07-07 19:21:07 -04:00
Brennan BensonandOrca d8df9c818f fix(terminal): allow terminals to spawn outside the worktree (#7685) (#7750)
Co-authored-by: Orca <help@stably.ai>
2026-07-07 15:34:29 -07:00