Commit Graph
20612 Commits
Author SHA1 Message Date
Kelvin AmoabaandOliver Mee badab9cc41 fix(browser): import a cookie file into a client-hosted browser under a remote runtime (#35989)
* fix(browser): import a cookie file into a client-hosted browser under a remote runtime

A paired runtime refused every cookie-file import before the picker
opened, even when this desktop hosts the runtime's browser pages. The
file import now asks main, like the native-browser import does, and
imports into the page's route partition; it is still refused when the
pages are not hosted here.

Co-authored-by: Oliver Mee <102673257+oliver-mee@users.noreply.github.com>

* chore(browser): lower the focus-read baseline for the cookie import actions

---------

Co-authored-by: Oliver Mee <102673257+oliver-mee@users.noreply.github.com>
2026-10-29 15:53:48 +00:00
Kelvin Amoaba 75b658c278 feat(native-chat): hover cards for GitHub PR and issue links (#35199)
* feat(native-chat): hover cards for GitHub PR and issue links

Links to the chat's own repo (origin or upstream) open a card with the
state, title, author, update time, and +/- or comment count. Bare #123
references in agent replies now link too. Cards use a light one-call
lookup; older hosts ignore the flag and answer with the full lookup.

* test(github): expect the preview options argument in runtime owner/repo lookups

* fix(native-chat): route GitHub link cards by the chat's own host and retry failed repo lookups

The repo lookup took the first worktree with the chat's id, so a twin on
another host could answer, and the preview cache keyed by repo id alone.
A failed slug lookup also left cards off until the chat remounted.
2026-10-29 15:29:32 +00:00
Neil 482ff4228c fix(ai-vault): resume saved sessions for the OS of the host that runs them (#35988)
Resuming a saved session in an SSH or paired workspace assumed Linux whenever
the session had no recorded host OS, and a dropped session never passed one.
On a paired Windows server that quoted the command for the wrong shell and
could add Codex's Unix-only paste-burst flag. The resume now reads the
host's own reported OS. When the host hasn't reported it, quoting stays
POSIX, as before, and OS-specific agent flags stay off.
2026-10-29 08:27:33 -07:00
Neil 76cb99dc52 feat(automations): label workspaces a host creates with the desktop's own automation run (#35986)
* feat(automations): label workspaces a host creates with the desktop's own automation run

A desktop's own automation could create its workspace on a managed or paired
host, but the workspace lost its automation identity: no badge, and its run
pane closed instead of sleeping. The desktop now sends a capable host its run
as a label, naming itself (`local`) as the automation's owner. The host
records it with origin 'client', only for automations it does not hold, caps
its fields, and never lets a client-origin label grant run ownership, sleep
authority or automation create policy. Older hosts get nothing new; older
desktops still create plain workspaces. A client-origin label whose
automation can't be found reads as unavailable, not removed.

Refs #34433

* test(automations): keep the dropped-label warning test independent of test order

Refs #34433
2026-10-29 08:14:10 -07:00
Kelvin Amoaba 54fa31658c fix(browser): orca console and network print agent-browser's logs and honour --limit (#35981)
The agent-browser bridge cast agent-browser's {messages} and {requests} output to Orca's {entries, truncated} contract and dropped --limit, so text mode crashed and --json returned the raw shape. Map the output once at the bridge, keep the newest --limit entries, and make the contract fields agent-browser never reports optional.
2026-10-29 14:46:56 +00:00
Neil 525d17733a refactor: group native-chat image reference owner (#35807) 2026-10-29 07:46:31 -07:00
Neil 4595be8263 fix(codex): launch Codex without its paste-burst guess outside Windows (#35975)
* fix(codex): launch Codex without its paste-burst guess outside Windows

Codex treats a fast run of keys followed by Enter as a paste and turns the
Enter into a newline. Keystrokes relayed from a remote client can reach the
host bunched together, so the prompt stayed in the composer as a draft.
Orca's terminals bracket every real paste, so the guess can only misfire
there. Orca now launches and resumes Codex with disable_paste_burst=true,
except on Windows, where Codex reads console input records and relies on
the burst for pastes.

Fixes #34496

* test: expect Codex launches to disable the paste burst off Windows

Refs #34496

* fix(codex): keep the paste-burst flag out of commands that end their options

Refs #34496

* fix(codex): decide the paste-burst flag from a paired server's own OS on resume

Resume quoting on a paired server keeps the client's platform, so a macOS
client resuming Codex on a Windows server would have disabled the burst that
Windows Codex needs. The resume target now carries the server's reported OS
and leaves the flag off when it is Windows or unreported.

Refs #34496

* fix(codex): add the paste-burst flag only when the command runs Codex itself

A wrapper override may not forward -c, which would break every launch.

Refs #34496

* fix(codex): leave the paste-burst flag off compound commands and unreported SSH hosts

Refs #34496

* test: leave pass-through resume input untouched in the banner spec

Refs #34496

* test(mobile): expect AI-vault Codex resumes to disable the paste burst

Refs #34496
2026-10-29 07:45:06 -07:00
Kelvin Amoaba c5957e7d4d fix(mobile): notice a silent drop while dictating within seconds (#35834)
An overdue chunk reply now asks the connection for one decisive liveness
probe instead of waiting for the idle watchdog, so the resend lands inside
the host's grace. Native clients probe directly; the OTA page asks the
shell with a new notify that older shells refuse with a diagnostic only.
2026-10-29 14:32:59 +00:00
Neil 770a1b8e6e fix(automations): let a host create workspaces for another owner's automation run (#35978)
A desktop older than #34525 still sends the host its own dispatch token, which
only that desktop can verify, so the host rejected every run with "Invalid
automation provenance request". A runtime host now ignores a provenance
request for an automation it does not own and creates a plain workspace;
requests for its own automations are still verified.

Refs #34433
2026-10-29 07:30:54 -07:00
Kelvin Amoaba 558be9909c fix(mobile): resend dictation audio lost when the connection drops (#35777)
* fix(mobile): resend dictation audio a dropped connection left unanswered

The host feeds chunks in seq order, each seq once, holding audio that
arrives ahead of a resend for up to the reconnect grace, and says so in
its start reply. To such a host the phone resends chunks rejected as
delivery-unknown after each reconnect, so speech sent on a dying
connection is no longer lost.

* fix(mobile): cap held dictation chunks by count as well as bytes

* fix(mobile): skip every gap needed to keep held dictation audio within the cap
2026-10-29 14:25:38 +00:00
Kelvin Amoaba 25bd428976 feat(mobile): stop tap-mode phone dictation after a minute of silence (#35716)
* feat(mobile): stop tap-mode dictation after a minute of silence

A forgotten mic kept recording and held the screen awake until stopped. Hold mode is left alone: a finger on the button isn't a forgotten mic.

* fix(mobile): time dictation silence from the last speech window the meter measured

* refactor(mobile): simplify the dictation silence timer
2026-10-29 14:24:18 +00:00
Neil 5cd7b5d52c fix(telemetry): send PostHog events through the main HTTP client so they honor the proxy (#35972)
* fix(telemetry): send PostHog events through the main HTTP client so they honor the proxy

* fix(telemetry): omit credentials on PostHog sends
2026-10-29 07:13:47 -07:00
Neil ba7b9405d7 fix(wsl): an automation's window create never starts its startup terminal as the user (#35970)
spawnLocalStartupAndSetupTerminals marks wslUserAct only when the create carries no automation provenance, so an automation create that sends a startup command still holds on a stopped WSL distro.
2026-10-29 07:08:32 -07:00
NeilandChad Tolkien b95b11cc6e perf(codex): resolve the Codex CLI once per spawn recheck, off the main thread on Windows (#35967)
Every native terminal spawn schedules a Codex hook reconcile, which resolved
the Codex path twice with a synchronous stat scan of PATH and install dirs
(~50ms main-process block per spawn on Windows with a long PATH and no Codex).

The reconcile now resolves the path once and passes it to both the live
lookup and the saved-answer read. On Windows, where each stat is slow, that
lookup runs every read (PATH candidates, nvm dirs and aliases, install dirs)
through fs/promises; macOS and Linux keep the sync scan, now run once. Sync
and async share one lookup that yields its reads, so they cannot diverge.

Hook rechecks stay immediate on every spawn and nothing is cached. A spawn
that lands before a run's hook-file pass (while it is still finding Codex or
waiting for its answer) gets one trailing rerun, so an install or upgrade
that moved Codex mid-run cannot leave hooks unchecked.

Fixes #35565

Co-authored-by: Chad Tolkien <chad@sodadigital.com.au>
2026-10-29 06:58:26 -07:00
Neil 3f8b15d5a7 test(wsl): stop a distro mid-reply on the real-WSL lane, then Start and Continue (#35826)
* test(wsl): stop a distro mid-reply on the real-WSL lane, then Start and Continue

* test(wsl): read the held partial reply from the chat stream, not history

* test(wsl): close the mid-turn chat streams when a wait fails

* test(wsl): reinstall the guest claude the decoy probe removed before the mid-turn stop

* test(wsl): read the continued turn from the scripted Claude's report log

After Start the restarted server's model discovery relaunches the same scripted
CLI, which overwrites report.json with a discovery-only report after the
continued turn finished. The CLI now also appends every report to an opt-in
log, and the mid-turn step finds the resumed launch there.

* test(wsl): match the continued launch by its session id, after Continue only
2026-10-29 06:55:57 -07:00
Neil 6eebdbbaf8 fix(wsl): keep a stopped distro's worktrees and re-list once it runs (#35733)
* fix(wsl): keep a stopped distro's worktrees and re-list once it runs

After a relaunch with a WSL distro stopped, the E9 gate refused the
worktree scan and the sidebar showed "Worktree scan failed" with no rows
until the user pressed Retry. The listing now answers with the stored
rows (non-authoritative, so nothing is pruned), marks the distro stopped
or unverifiable in a new optional field, and re-lists once a wake or a
settled running read shows the distro running. The re-scan is held once
per repo and dropped when the repo is removed. The sidebar shows a
neutral state instead of a failure.

* fix(wsl): make the stopped-distro Retry a user act that may start the distro

The indicator's click now runs the scan inside runAsWslUserAct for the
repo's distro (new worktrees:scanStartingWslDistro IPC), then re-lists,
so clicking it can start the distro instead of re-running the gated
background scan that never could.
2026-10-29 06:54:51 -07:00
Neil 2a5f6c79c1 test(e2e): on the real WSL lane, background work never starts the stopped distro (E9 guard) (#35590)
* test(e2e): on the real WSL lane, background work never starts the stopped distro (E9 guard)

The Windows real-WSL lane opens a project inside its own imported distro, terminates that distro,
and runs a window of background work elsewhere (focus/blur/reveal, workspace switches, a linked
issue/PR card, Settings panes, Tasks, account switches). Every child the main process starts is
logged; no wsl.exe may run anything in the distro (listings are fine), and `wsl --list --running`,
watched each second, must never show it, which also catches UNC touches. Opening a terminal in the
WSL workspace then starts it. A participation check fails the lane if the guard skipped.

* test(e2e): actually render each Settings pane in the WSL lane's E9 background window

openSettingsTarget alone only set the navigation target, so no pane mounted and none of its reads
(servers, accounts, agents, integrations, CLI status, the repo pane's orca.yaml check) ran. Open
Settings, wait for each pane's section to mount, then close it.

* test(e2e): harden the WSL lane's E9 guard per review

- process-host logs every spawn to ORCA_E2E_SPAWN_LOG when set, so the guard sees worker-thread
  and inheriting-child spawns (e.g. the Codex rate-limit fetch), sync ones included.
- The spawn baseline is taken before `wsl --terminate`, and the running-list watcher starts right
  after it, so work in the stopping window counts.
- A wsl.exe launch counts as starting the distro unless it names another or only lists/terminates.
- The watcher is async with a 5 s timeout and non-overlapping ticks; a failed read is retried and
  fails the guard after three, never reads as "stopped". The recorder throws if it cannot hook,
  and the spawn log must be non-empty. The doc names the watcher as the authoritative assertion.

* test(e2e): bound the terminate grace, keep the spawn log out of shipped runs, tolerate torn lines

- The watcher forgives running reads only within 3 s of `--terminate` and before its first
  not-running read, which the rounds now await; any running read after it fails the guard.
- Main drops ORCA_E2E_SPAWN_LOG outside e2e mode (no ORCA_E2E_USER_DATA_DIR) before anything
  spawns, so no daemon, PTY or agent inherits it; the log holds full argv, tests only.
- readSpawnLog skips a line torn by a concurrent append.

* test(e2e): no blocking wsl.exe in the WSL lane's E9 guard, and a timeline for failures

The first lane run was cancelled at the 30-minute job limit while the guard step had run 25
minutes: past three 5-minute test timeouts, which only a blocked worker survives. Every wsl.exe
call (setup, terminate, cleanup) is now async with a timeout, so a hung one fails the test. The
guard logs a timestamped timeline (each running-list read, terminate, rounds) for diagnosis, and
the job limit goes to 50 minutes for the three added runs.

* test(e2e): let the setup's own WSL terminal launch settle before the terminate; 10 s grace

The lane run failed with "Ubuntu was still listed 3000 ms after --terminate" in all three runs.
The timeline showed why: focusing the WSL workspace in setup is a user act that opens a WSL
terminal, and its launch (codex trust probe, PTY, hook relay) landed about a second after the
terminate and restarted the distro. Setup now waits for that terminal's PTY and for wsl.exe
launches to go quiet for 3 s before terminating. The grace is two running-list reads (10 s).

* test(e2e): interleave wsl.exe launches into the E9 guard's timeline

The lane saw the distro boot about two seconds after the terminate with nothing naming the
launcher; each running-list tick now also prints the wsl.exe launches logged since the last one.

* test(e2e): time and stack every logged spawn and main's WSL UNC touches

The E9 guard printed spawns at its poll time, up to a second late, and with
no caller. Each record now carries when it happened and the caller's stack,
and main's fs touches of \\wsl.localhost paths are logged too, so a boot
with no wsl.exe launch before it can still be attributed.

* test(e2e): keep spawn-log stacks and main's fs hooks strictly to e2e mode

process-host now writes the spawn log, and captures caller stacks, only when
ORCA_E2E_USER_DATA_DIR is set as well, so a stray log variable in a CLI or
daemon environment does nothing. The main-process fs/spawn hook refuses to
install outside an e2e-mode app, and a source scan pins that no shipped code
imports or installs it.

* test(e2e): guard a focused WSL workspace left idle through the stop

Device runs saw a stopped distro restart with its bridge workspace focused
and nothing touched: the stop's own fallout re-ran renderer reads as user
acts. The new case keeps that workspace focused with a folder expanded in
the Explorer and Source Control shown, terminates, and idles. Shared guard
helpers move to tests/e2e/helpers/wsl-boot-guard.ts.

* test(e2e): capture caller stacks deep enough to reach the IPC handler

* test(e2e): give the focused-idle guard's timeout bump its reason
2026-10-29 06:52:46 -07:00
NeilandChad Tolkien 4642bc00d6 fix(telemetry): never deliver held startup events later than an eager client (#35949)
#35798 holds pre-window captures until the first window shows, which
can delay delivery past what an eager client does: 20 quick events
waited instead of tripping flushAt, and the first flush moved from 10s
after the first event to 10s after the client started. Held events now
start the client as soon as they reach flushAt, and a deadline 10s after
the first held event starts the client if needed and flushes. It stands in
for the timer an eager client would have armed, so it retires at the
SDK's first flush attempt (the flushAt-th enqueue, whether that send
succeeds or fails); after that the SDK's own flushAt and flushInterval
alone decide batching. Held
events are dropped when consent was withdrawn before start, and quit no
longer loads the SDK just to drop them.

Fixes #35752

Co-authored-by: Chad Tolkien <chad@sodadigital.com.au>
2026-10-29 06:26:41 -07:00
Neil 0bd7ecf1f3 perf(session-search): append to the index after a restart instead of rewriting grown transcripts (#35941)
Parser resume points live only in memory, so the first time a transcript grows
after a restart it is refolded from byte 0 and the search index deleted and
reinserted every row it held for that file. On a 40MB transcript that cost
2.8-11.9s per file versus about 1s for the parse alone.

The index now stores a SHA-256 of bytes [0, byte_offset) with each commit. The
replacement read the parser already does from byte 0 hashes as it goes; when it
reaches the cursor with a matching digest, the index appends only the messages
after it. A rewritten prefix, a cursor the read never lands on, or a replaced
inode falls back to a full replacement, and read failures still count toward
holding a file out. The parser still reads from byte 0 after a restart; the
saving is avoiding the delete and reinsert, not I/O.

Version 8 indexes gain prefix_hash additively under BEGIN IMMEDIATE, so
concurrent openers add it once; a missing hash costs each file one replacement.
SESSION_SEARCH_SCHEMA_VERSION bumps remain the mechanism for parser fixes.

Refs STA-12516
2026-10-29 05:58:10 -07:00
Neil 1a12ec8864 fix(telemetry): keep the SDK opted out while an env override disables telemetry (#35940)
DO_NOT_TRACK, ORCA_TELEMETRY_DISABLED and CI markers beat the stored
choice, but setOptIn(true) and banner acknowledgement still re-enabled
the SDK, and setOptIn(false) then captured telemetry_opted_out, which
quit flushed. Consent-change paths now skip SDK opt-in and the direct
opt-out capture while an env override is active; the client is already
opted out at creation under the override.
2026-10-29 05:58:05 -07:00
Neil 1263370049 fix(wsl): hold a daemon-off restore of a stopped WSL distro (#35938) 2026-10-29 05:42:45 -07:00
Neil 0ff3fb67c9 fix(wsl): held terminals read as a sentence; a person's worktree create starts its own terminals (#35935)
RPC errors for a terminal held on a stopped or unchecked WSL distro keep runtime_error but carry a readable message and the hold in data. A headless launch the runtime held records the coded wslDistroStopped skip. A worktree create someone asked for (UI, CLI, agent, paired client) starts its setup and default terminals as their act; an automation's create stays background.
2026-10-29 05:32:55 -07:00
Neil 8cc687818e test(e2e): force the stale-title window in the live-reattach mode check (#35936)
The same-process serve restart step relied on timing to land the reattach
replay inside the window where the host still publishes the tab-default
title, which happened about one run in five. Pin the client's published
pane title to the tab default and clear its pane status for the duration
of the restart, so the replayed image's own title alone must prove the
live agent. The check fails 3/3 without #35920 and passes with it.

Refs #35559
2026-10-29 05:30:32 -07:00
Neil 010d0d586a feat(wsl): a pane main held for a stopped distro shows the Start card (#35927)
The renderer maps main's terminal_held_wsl_distro_stopped start failure to #35813's shared stopped card; its Start calls layout.startWslHeldPanes, which starts each pane through ensureRestoredPaneStarted as the user's act.
2026-10-29 05:11:38 -07:00
Neil 434ffbac1b fix(wsl): a passive restore's env prep never starts a stopped WSL distro (E9) (#35858)
* fix(wsl): a passive restore's env prep never starts a stopped WSL distro (E9)

resolvePtySpawnHostEnv runs before #35813's hold. Every spawn but a passive
restore now runs its prep as a user act on its distro, so explicit launches
are unchanged. prepareForCodexLaunchAsync checks blockedWslDistroForExec once
for WSL targets and, when blocked, skips the guest-home probe, the legacy auth
drain, the config and instructions sync and the session bridge, returning the
home without probing. When not blocked, the home is warmed with getWslHomeAsync
so the sync reads hit the cache instead of a 5 s wsl.exe. The state-DB
recovery and the explicit plugin readiness wait are gated the same way.

* fix(wsl): only a launch someone asked for acts on its distro; gate the relay start

A passive restore or a non-WSL launch never runs as a user act, not even on
the default distro (a null distro resolved to the default before). The
daemon-off local provider applies the same rule, receiving wslPassiveRestore
from the spawn options. Starting the hook relay (ensureForDistro from every
WSL spawn's env build) now checks blockedForExec before the state check, so a
passive restore on a stopped distro starts no relay.
2026-10-29 05:10:19 -07:00
Neil 43ed9878b7 fix(terminal): judge live-agent reattach modes by the image's own title (#35920)
After a serve restart where the daemon survives, a paired client could
drop mouse and focus reporting for a still-live agent. The host publishes
the pane with its tab-default title until it seeds the daemon's live title
about 180 ms later. A reattach image replayed inside that window was judged
against the default title, read as a plain normal-buffer program, and got
the reset that disarms its modes, though the image itself carried them.

The snapshot now carries the host's tracked title when the image was taken,
as an additive `lastTitle` field in the snapshot info, gated on the image's
seq. Every reset that judges a replayed image as a live agent's (the
post-replay reset, the focus-in that follows it, the hidden-restore reset,
and the model-snapshot reattach) uses that title when present, so the
decision describes the same moment as the replayed bytes. Local Electron
model snapshots already carried this title and now use it the same way. The reattach policy itself is
unchanged: non-agent normal-buffer panes still shed modes a dead child may
have left (#7329, #7893).

Older hosts omit the field and clients fall back to the published title.
Older clients ignore it.

Refs #35559
2026-10-29 04:45:26 -07:00
OrcaWinandOrcaWin c40f32163e fix(mobile): translate coded generation failures and counted chat copy (#35923)
- Commit-message generation keeps the host's optional errorCode, errorParams and
  errorDetail and translates every known text-generation code, matching desktop's
  rules: unknown codes, older hosts or missing values show the host's English
- Background tasks, subagent groups, the model label and agent-session write
  notices use localized mobile adapters instead of the shared English sayers

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-29 04:39:23 -07:00
NeilandChad Tolkien 594844cf0f perf(ssh): load ssh2 on first use instead of at startup (#35911)
Every value import of ssh2 sat on the main-process startup graph, so
Electron paid for loading ssh2 before any window even when no SSH host
is configured. Route all runtime ssh2 access through a lazy loadSsh2(),
define the BaseAgent subclasses on first use, and read ssh2's default
host-key algorithm list on first connect instead of at module load.

Profiles with saved SSH targets still load ssh2 during startup, right
after the profile store loads and before any window or reconnect, so
SSH users keep the old timing. A failed eager load is logged and
surfaces at connect instead of aborting startup. Profiles without SSH
targets never load ssh2 until first use.

An oxlint no-restricted-imports entry rejects value imports of ssh2
outside tests, and a guard test imports the SSH connection graph to
prove ssh2 stays unloaded. SSH suites mock the loader seam instead of
the ssh2 package, so no global vitest setup is needed.

Fixes #35731

Co-authored-by: Chad Tolkien <chad@sodadigital.com.au>
2026-10-29 04:28:00 -07:00
Neil b58d758599 fix(claude): resume a chat with a saved effort on a Claude Code that predates --effort (#35878)
* fix(claude): resume a chat with a saved effort on a Claude Code that predates --effort

A chat resumed with its saved effort always launched Claude with --effort,
which Claude Code before 2.1.38 rejects as an unknown option, so the chat
could never start again. New chats carry no saved effort and started fine.

Gate effort on the CLI version facts Orca already probes for
--thinking-display and --plugin-dir, which now answer supported,
unsupported or unknown. A chat with a saved effort waits out the version
probe and puts --effort on the command line only where the CLI has it.
Live effort and Fast changes use a control request Claude Code before
2.1.50 never answers, so on those CLIs saved choices stay saved but are not
sent, the chat offers no effort or Fast choice, and a live change is
refused at once instead of after a 30 second wait. Unknown versions keep
today's behavior.

Fixes #34795

* test(claude): give the scripted runtime a current Claude Code's flag support

Production always passes flag support, so a runtime without it now reads
as a CLI whose version is unknown and keeps saved effort off the command
line. The scripted CLI stands for a current Claude Code, so name its
version and keep its saved choices on the launch.

Refs #34795
2026-10-29 04:24:02 -07:00
OrcaWinandOrcaWin 4e9e320e32 fix(i18n): translate remaining renderer leftovers (submodules, agent summaries, filter counts, automations) (#35914)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-29 04:16:11 -07:00
Neil af8117c07a perf(native-chat): stop re-rendering composer controls on every keystroke (#35913)
* perf(native-chat): stop re-rendering composer controls on every keystroke (#35836)

Each keystroke (and each IME compositionupdate) re-rendered the composer's
action bar and TipTap editor, which re-applied editor options and re-decorated
the view, even though neither had changed. The draft store also gave each write
a fresh image-row array, which invalidated every image consumer.

Memoize NativeChatComposerActions and NativeChatPromptEditor (initialValue only
seeds the editor at mount), pass them stable handlers that call the latest
committed closure, and keep the stored image row's identity when it's unchanged.
Draft-store writes, onDraftChange and every consumer still see each edit
synchronously, so composition semantics are unchanged.

CDP-simulated pinyin IME, 4x CPU throttle, median per compositionupdate:
14.5ms -> 6.8ms (PTY composer), 14.3ms -> 7.2ms (structured composer).

* chore(native-chat): note the prompt editor memo's stable-props contract
2026-10-29 04:12:00 -07:00
Neil 211bbbb6d1 fix(wsl): main's background terminal starts never start a stopped WSL distro (#35865)
* fix(wsl): main's background terminal starts never start a stopped WSL distro

Every start main makes through the runtime controller is background work unless its caller names the user's act (CLI and window creates and splits, paired-client creates and tab opens, agent launches and sessions, conversation resumes). #35813's hold now also holds those fresh and restored starts while the distro is stopped or unverifiable.

* fix(wsl): headless Run now starts as the user's act; update create expectations

A headless automation's Run now names the user's act through launchAgentTerminal, so it may start a stopped WSL distro; a scheduled run stays background and is held. The paired-client background create expectation now includes wslUserAct.

* fix(wsl): main's background start checks a folder workspace's path passively

With #35899's folder stat gate, the runtime preflight passes passiveWslRestore = !wslUserAct, so a background start never stats a stopped distro's folder as a user act before the daemon hold.
2026-10-29 03:54:50 -07:00
Neil a5bb1ae9ce fix(automations): a scheduled run never starts a stopped WSL distro (#35857)
* fix(automations): a scheduled run never starts a stopped WSL distro

Scheduled runs whose target is on a stopped (or unverifiable) WSL distro skip with a coded, retryable wslDistroStopped reason naming the distro, checked at the tick and again at dispatch; repeated ticks fold into one skip. Run now is the user's act and still starts it.

* fix(automations): gate host-path WSL projects by their distro; translate the skip

A host-path project whose Git runs in WSL passes its project distro to the stopped-distro check (as #35778 does). wslDistroStopped is translated into the 10 other locales.
2026-10-29 03:49:40 -07:00
Neil 3ef3123f26 fix(wsl): the port scanner never realpaths a stopped distro's workspace root (#35907)
The workspace port scanner resolves each workspace root's realpath to match
listening ports; for a \\wsl.localhost root that 9P touch started a stopped
distro about 17 s after it was terminated (E9). It now leaves a stopped
root's alias unknown, as a timed-out lookup does, and never wakes.
2026-10-29 03:49:17 -07:00
Neil 31b672e995 fix(wsl): Source Control's PR push-target and Create PR checks never start a stopped distro (#35885)
* fix(wsl): Source Control's PR push-target and Create PR checks never start a stopped distro

Showing Source Control resolved the linked PR's push target
(worktrees:resolvePrBase) and its Create PR eligibility
(hostedReview:getCreationEligibility); both read the repo's git config over
\\wsl.localhost and ran git and gh in the distro, starting a stopped one
(E9). Both now refuse a stopped distro unless the user is creating or
launching from the PR, or pressed Create PR (optional wakeWslDistro), in
the IPC handlers and their runtime twins.

* fix(wsl): gate the GitLab MR push-target lookup the same way

Source Control's push-target ensure also resolves a linked GitLab MR
(worktrees:resolveMrBase / worktree.resolveMrBase), which read the repo and
ran glab and git in a stopped distro. It now refuses unless the user is
creating from the MR, which passes wakeWslDistro.

* test(runtime): let the mocked running gate cover guardWslUncPathAccess too

Runtime specs fake win32 with no wsl.exe and mock blockedWslDistroForPath
to running; the real guard calls its own module's check, so the PR-base,
MR-base and eligibility gates refused there. The guard mock now asks the
mocked check, keeping per-test overrides working.
2026-10-29 03:48:58 -07:00
Neil 557f281780 fix(wsl-host): a chat holds Send while its WSL distro is stopped, until Start (#35864)
* fix(wsl-host): a chat holds Send while its WSL distro is stopped, until Start

* test(wsl-host): find the held Send by the reason it waits
2026-10-29 03:46:05 -07:00
Neil 83909a9b72 fix(wsl): issue-command follow-ups: no-op saves, WSL Git repos, paired hosts (#35900)
- A blur with no edit saves nothing, so it never starts a stopped distro.
- The write gate also covers a host-path repo whose Git runs in WSL (its
  save's ignore check); clearing runs no Git and stays lazy.
- A paired host's refused read is re-asked on focus and every 30 s while
  visible, through a watchRefusedWslRead extracted from the base-ref
  watcher, which now uses it too.
2026-10-29 03:43:42 -07:00
Chad TolkienandNeil 568cd1ba72 perf(telemetry): load posthog-node and start its client after the first window (#35798)
Requiring posthog-node at bundle evaluation and constructing the PostHog
client in initTelemetry put ~58ms on the main-process startup path before
any window showed. The SDK is now required lazily inside
createPostHogClient, and initTelemetry defers client creation until the
first window is shown (15s fallback for headless serve / GPU failures).

Captures tracked before the client starts are held with their original
timestamps and replayed in order on start. Opt-out and shutdown start the
client first so held events flush and telemetry_opted_out still enqueues
before optOut(); a client start failure no longer blocks either path.

Fixes #35752

Co-authored-by: Neil <neil@stably.ai>
2026-10-29 03:36:04 -07:00
Venius24andNeil e08616e95d fix(orchestration): name the provider's words when a worker's preamble is rejected (#35791)
When a structured worker's dispatch preamble is definitively rejected, the
dispatch_preamble_undelivered error now appends the provider's failure detail
("Details: ...") unless the rejection sentence already quotes it. The quoted
text is bounded and normalized by the same quotedProviderDetail helper the
rejection writer uses.

Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
2026-10-29 03:35:49 -07:00
Neil bccdb0254f fix(wsl): never boot a stopped distro to check a folder workspace's path (#35899)
A background read of a \\wsl.localhost folder workspace's status (sidebar
polling, runtime status RPC, a passive terminal restore) stat'ed the folder
and booted its stopped distro. The status now reports 'unavailable' without
touching it; a passive restore holds with Start; a spawn the user asked for
checks the folder as their act, which may start the distro as before.
2026-10-29 03:32:56 -07:00
Neil d865074b8f fix(wsl): hold a passive WSL restore before the cwd probe, whichever provider spawns (#35895)
The passive-restore hold lived in the daemon adapter, so a degraded or
off daemon (LocalPtyProvider) never applied it, and even with the daemon
the startup cwd probe (wsl.exe --exec test -d) ran first and could boot
the distro. The hold now runs in the shared startup-target resolution,
before that probe and before any provider spawns (E9).
2026-10-29 03:29:50 -07:00
Neil 38c111697a fix(wsl): a workspace switch wakes the explorer and git status only while recent (#35897)
The explorer's workspace-open read and the first git status took a pending
user switch with no age limit, so a switch no consumer used (sidebar closed)
could be redeemed long after the distro stopped. They now use the same 10 s
window as pane restore and git history, through one shared
takeRecentWorkspaceSwitchWake.
2026-10-29 03:21:57 -07:00
OrcaWinandOrcaWin bbb563e83a fix(i18n): translate source control remote operation error toasts (#35893)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-29 03:07:42 -07:00
Neil 84a4995e65 fix(terminal): drop a replaced process's title and input modes on restore (#35889)
When a host restart restores a pane by starting a new shell, the pane kept
the dead process's title and the client's xterm kept its input modes. A
pane that had Claude open came back as bash but still read as Claude, so
the reattach picked the agent-preserving reset and mouse moves and focus
changes were typed into the shell as escape codes.

Two process-bound facts now follow the respawn verdict:

- Title: the cold-restore payload no longer carries the checkpoint's last
  title into the new process's records, and durable checkpoints of the new
  process take the title from the live terminal only. The title, agent
  identity and title-derived status reflect the new shell.
- Input modes: a pane records which process incarnation its xterm's modes
  belong to. When the host binds a different known incarnation, the pane
  grounds the process boundary before the new process's replay, the same
  ground a fresh spawn already writes, so only modes the new process set
  are armed.

Older servers still report incarnations, so new clients ground their modes
against them; older clients get the neutral title from new servers and
take the shell reset path.

Fixes #35559
2026-10-29 03:03:54 -07:00
OrcaWinandOrcaWin c8dec213c4 test: remove copy inventories and redundant formatter replays (#35890)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-29 03:03:35 -07:00
Neil 9f62a4fa2d fix(windows): start the WSL holder with only a NUL handle to inherit (#35799)
* fix(windows): start the WSL holder with only a NUL handle to inherit

libuv starts every Windows child with bInheritHandles=TRUE and no handle
list, so a detached holder that outlives Orca kept any inheritable handle
Orca had open, such as a launcher's pipe or a DevTools socket. Start it
through CreateProcessW with PROC_THREAD_ATTRIBUTE_HANDLE_LIST naming one NUL
handle for its stdio. The build probes now check the newest export without
calling it, and the lane receipt labels ConPTY's own startup output.

* fix(windows): report isolated holder exits and kills the way libuv does
2026-10-29 02:56:09 -07:00
Neil e0f05c3fc9 fix(wsl): Codex WSL hook installs and host hook checks never start a stopped distro (E9) (#35827)
* fix(wsl): Codex WSL hook installs and host hook checks never start a stopped distro (E9)

(a) installManagedHooksIntoWslRuntime checks the settled running gate inside
its trust queue right before the first UNC read, and again before the
post-hash fallback trust write; a later reconcile checks before revoking or
reinstalling. A stopped or unverifiable distro skips (null, as with no WSL
plan). The canonical-path probe runs through process-host behind
blockedWslDistroForExec; a refused probe settles as unavailable and keeps the
known identity. The guest shell preflight and a pane launch's home preparation
run as user acts on their distro.

(b) repo.hooksCheck takes an optional background flag (older hosts ignore it);
the renderer sends it, and the host refuses a stopped distro's background
check the same way the desktop's hooks:check does.

* fix(wsl): a pane launch is not a user act for the Codex hook install

A passive restore or remount reaches launch preparation too (#35813), so it no
longer runs as a user act; a stopped distro skips the install and the relay
installs once the distro runs. A skipped WSL home now returns not_installed
instead of falling through to the host writer, which would have written the
WSL home over UNC.

* fix(wsl): a fallback grant skipped mid-install reports trust pending

hooks.json is written before the hash wait, so a skip after it is not a clean
skip: return an error status saying the trust is pending instead of null.

* chore: drop the stale process-host direct-import baseline entry
2026-10-29 02:52:01 -07:00
Neil cd821abb2c fix(wsl): Commits history wakes a stopped distro only on the user's own act (#35854)
* fix(wsl): Commits history wakes a stopped distro only on the user's own act

Showing Commits woke the distro on every mount, remount and re-show. Now
only the user expanding Commits in the same worktree, or the user's own
switch to the workspace (once per switch), may start it; the Refresh
button keeps its explicit wake (E9).

* test: a mount and a base-ref move read Commits history in the background

#35778's base-move refetch test expected every shown-history read to
wake a stopped WSL distro; only the user's own act does now.
2026-10-29 02:47:20 -07:00
OrcaWinandOrcaWin 03d1e8c289 test: remove low-value error-copy and primitive schema tests (#35882)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-29 02:43:43 -07:00
Neil a50b9964a1 test: clear inherited GIT_* env once per test file so real-Git suites cannot write into an outer repo (#35859)
* test: clear inherited GIT_* env once per test file so real-Git suites cannot write into an outer repo

* test: clear only repo-locating Git env so the compat lane keeps GIT_EXEC_PATH
2026-10-29 02:40:33 -07:00