Commit Graph
17839 Commits
Author SHA1 Message Date
Jinjing 6a160aa5c8 fix(editor): soften file reveal flash and skip new views (#36039) 2026-10-29 11:20:49 -07:00
Neil 46e897f87b refactor(jira): group search and fallback notice owners (#36036) 2026-10-29 11:14:35 -07:00
OrcaWinandOrcaWin 2e5610316a test: remove browser capability inventories and mock receipts (#36032)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-29 11:03:49 -07:00
Jinjing a656872d02 Remove obsolete TestFlight preview link from mobile docs (#36029) 2026-10-29 11:00:22 -07:00
Jinjing e182f1daa2 Preserve force-with-lease rejection details in push errors (#36027) 2026-10-29 10:59:55 -07:00
NeilandManan Chataut bc228ff5cb fix(native-chat): keep a huge unbroken paste from freezing the chat (#32355) (#36031)
* fix(native-chat): keep a huge unbroken paste from freezing the chat

A long run with no whitespace ("xxxx…", "0000…", "abab…") wrapped with
kerning makes Chromium reshape it at every line, quadratic in run length:
128 KiB stalls 2.4 s, 1 MiB 19 s, 5 MiB never finishes. ProseMirror forces
that layout on paste and on each keystroke, so the composer freezes in
every terminal-backed chat, including paired servers and WSL. A sent
message stalls the transcript the same way: its fold clips the text but
still lays it all out (128 KiB: 2.5 s).

Runs over 256 characters now render with font-kerning: none, so prose of
any length and Shift+Enter lines keep kerning:
- composer: inline decorations, updated only for the lines a transaction
  touches (a keystroke beside 8,000 decorated lines ~1 ms, not ~190 ms)
- user messages in the transcript and expanded queued cards: the whole
  text when it holds such a run

Text, drafts and what is sent are unchanged. After: 1 MiB single line
84 ms, 5 MiB 312 ms (keystroke 248 ms), 1 MiB of 4000-char lines 50 ms
(was 2.3 s), transcript 128 KiB 80 ms. Worst case left kerned, 256-char
runs: 1 MiB 242 ms, 5 MiB 1.2 s, like 1 MiB of short lines (291 ms).

Fixes #32355

Co-authored-by: Manan Chataut <mananchataut@gmail.com>

* fix(native-chat): keep kerning on long CJK and Thai paragraphs

These scripts have no spaces but Chromium can break between their
characters, so a long paragraph is not one unbreakable run. Count
ideographs, kana, Hangul and Thai as break opportunities so such text
keeps kerning.

Co-authored-by: Manan Chataut <mananchataut@gmail.com>

* fix(native-chat): rescan only the edited run, and wait out IME compositions

Splitting one run inside a block of thousands replaced every decoration
in that block, and ProseMirror's removal is quadratic: 1,411 ms for one
space in a paragraph of 8,000 long runs. A change now rescans only from
the run edge before it to the run edge after it, and removes only the
decorations that overlap: ~1 ms for the same edit.

Decorations are only mapped while an IME composition is in progress, so
the composing text node is not re-rendered. The deferred range is
rescanned with the next non-composing change, or on compositionend when
none follows.

The keystroke-timing test is replaced by deterministic ones: unaffected
decorations are reused and the result equals a full scan; a composition
defers the rescan and compositionend runs it.

Co-authored-by: Manan Chataut <mananchataut@gmail.com>

* fix(native-chat): never split a CJK code point, and treat NBSP as glue

A supplementary ideograph (U+20000-U+3FFFF) broke a run at its high
surrogate only, so the decoration began on the low surrogate and split
the pair across elements. Both the run scan and the leftward edge scan
now treat the pair as one break.

NBSP joins words for Chromium's line breaker (UAX #14 class GL), so an
NBSP-joined paste is one unbreakable run and must lose kerning; drop it
from the break set. No other non-breaking characters were in it.

Drop a composer test whose coverage the decoration reuse test already
has.

Co-authored-by: Manan Chataut <mananchataut@gmail.com>

* fix(native-chat): classify surrogate pairs whole at a rescan's edge

Two lone-surrogate edge cases made the incremental rescan disagree with
a full scan:
- an edit completing a pair at the window start (a lone high surrogate,
  then a pasted low surrogate and run) began the decoration on the low
  surrogate; the window now widens past the whole pair
- a lone low surrogate after any break counted as a pair end, dropping
  it from the run; that now requires a preceding high surrogate

A seeded fuzz also found inclusive decoration edges mapping across a
joined block's boundary, where ProseMirror cannot remove them; the
decorations are no longer inclusive.

Co-authored-by: Manan Chataut <mananchataut@gmail.com>

---------

Co-authored-by: Manan Chataut <mananchataut@gmail.com>
2026-10-29 10:56:40 -07:00
Neil 53e80ef9d4 fix(computer-use): stop relaunching the macOS permission helper on every status read (#34390) (#36028)
* fix(computer-use): stop relaunching the macOS permission helper while Accessibility is denied (#34390)

Every computerUsePermissions:getStatus / computer.permissionsStatus call launched a
fresh helper via open -n that polls TCC for up to ~3.5s. Three always-mounted
setup-guide hooks re-read on every window focus, so a denied Accessibility state
produced batches of helper launches and continuous TCCAccessRequest traffic.

Gate status reads in main: coalesce concurrent reads, reuse granted results for 2s,
and back off denied/failed results 10s doubling to a 120s cap. Window focus lowers
the backoff to a 10s floor; openSetup/reset invalidate it.

* fix(computer-use): never serve stale macOS permission status after the user acts (#34390)

- Re-probe once per real return to Orca (blur then focus) instead of a 10s floor,
  so grants and revocations made in System Settings show without another focus.
- computer.permissionsStatus accepts an optional fresh flag (web clients send it)
  that bypasses the denied backoff; older hosts strip it, older clients omit it.
- A provider permission_denied reply invalidates the cached status.
- Invalidate again after a TCC reset; stale in-flight probes get one follow-up
  probe instead of an overlapping helper.
- Failed checks are shared for 2s and retried, not backed off like a denial.

* fix(computer-use): gate macOS permission re-probes on app-level returns only (#34390)

- Track did-resign-active/did-become-active instead of BrowserWindow blur/focus,
  so moving between Orca's own windows never re-launches the helper.
- If the renderer's focus read reaches main before did-become-active, treat it as
  the return when a window is focused, so the first read after return is fresh.
- Passive badges (setup-guide progress, feature-wall status) opt into the denied
  backoff with background: true; omitted flags (older clients, active setup
  screens) keep near-live reads with 2s reuse. Replaces the unreleased fresh flag.
- Obsolete probes no longer record outcomes or advance the denied backoff.

* test(computer-use): drop casts from permission IPC wiring test

* fix(computer-use): keep remote permission reads near-live and count startup as away (#34390)

- Web clients never forward background: browser focus can't activate the host,
  so remote setup surfaces get 2s reuse instead of a stale denial.
- Seed the departed state when binding app activity, so a grant made during a
  slow startup is picked up on the first return.
- Drop the mock-only sidecar invalidation test; keep gate constants private.

* fix(computer-use): never serve a cached denial to foreground permission reads (#34390)

- Active screens, web clients and older clients only reuse a denial by joining
  an in-flight probe; granted and error results keep the 2s reuse.
- Revert the unreleased RPC background option so remote reads stay foreground.
- Drop the IPC test half that exercised events production no longer listens to.
2026-10-29 10:55:44 -07:00
Neil 80a2041142 fix(browser): an SSH workspace browser reaches sites through the host's proxy (#36022)
An SSH workspace's browser reaches sites from the SSH host: the host's sshd
dials each destination over a direct-tcpip channel. sshd ignores the
host's HTTPS_PROXY/HTTP_PROXY/ALL_PROXY, so on a host whose only way out is
an HTTP proxy (a Docker sandbox, for example), every external site failed
with ERR_SOCKS_CONNECTION_FAILED while localhost pages loaded.

The SSH route now reads the proxy variables an exec session on the host
gets (the environment orcad runs with) when it opens, and picks the
upstream for each destination the same way a paired server's own tunnel
does: environment proxy with its NO_PROXY list, never for loopback. An
HTTP(S) proxy is reached over the SSH channel and asked to CONNECT; a
no-auth SOCKS5 proxy gets a SOCKS handshake. This works for both the ssh2
and system OpenSSH transports. The CONNECT and SOCKS clients now run over
any transport, so the server tunnel and the SSH route share them.

Fixes #35217
2026-10-29 10:51:24 -07:00
Kelvin Amoaba 47b324b3c8 fix(browser): preview HTML files over 512 KiB from paired hosts (#36021)
The host's files.readDocPreview sends a preview file in one RPC reply, capped at 512 KiB for text, so Open in Orca Browser failed for larger HTML on managed runtimes. Add files.readDocPreviewChunk, which runs the same grant authorization and size caps per range, and page through it after a file_too_large reply. Hosts without the method keep today's 413.
2026-10-29 17:44:54 +00:00
OrcaWinandOrcaWin f4d19ca710 test: remove capability inventories and projection receipts (#36018)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-29 10:39:21 -07:00
Kelvin AmoabaandHEOJUNFO d61b37cbca fix(browser): return orca tab list at once when the worktree has no saved browser tab (#36017)
* fix(browser): list no tabs at once when the worktree saves no browser tab

The tab-list wake asked the window to mount the worktree's saved tab and
waited 8 s for it to register, even when nothing was saved to mount.

Co-authored-by: HEOJUNFO <100739943+HEOJUNFO@users.noreply.github.com>

* test(browser): keep the saved-tab wake check to the cases only it guards

* test(browser): drop the window cast from the no-wake check

---------

Co-authored-by: HEOJUNFO <100739943+HEOJUNFO@users.noreply.github.com>
2026-10-29 17:39:00 +00:00
Brennan Benson d61c8b8bbd Leave Claude plan mode when the user approves a plan (#34549)
* Leave Claude plan mode when the user approves a plan

Approving a proposed plan left Claude in plan mode, so it could not carry the plan out. On an approved plan, while Claude reports plan mode, ask it to return to the chat's own approval mode. The request is written before the approval and never awaited, so its failure cannot hold or reject the approval.

Tracked in STA-6663.

* Use checked types for Claude plan approval mode

* Restore Claude plan approvals by protocol action and mode

* Normalize missing Claude plan approval mode before narrowing
2026-10-29 10:24:41 -07:00
5dd4b68616 fix(browser): Next.js Server Actions work through the *.orca.localhost worktree URL (#14562)
* fix(proxy): preserve worktree forwarded host

* fix(proxy): drop the unreachable no-Host branch and trim the forwarded-host test

The proxy only forwards requests whose Host matched a label, so Host is
always set here.

---------

Co-authored-by: Yeonguk Jeon <273242699+promptprobe@users.noreply.github.com>
Co-authored-by: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com>
2026-10-29 17:24:34 +00:00
641e4792b9 Startup shows chats as Interrupted or Done without reading their history (#32146)
* feat(agent-session-journal): save each chat's open root turn beside its epoch

A restart could only tell whether a chat was cut mid-turn by replaying its
whole journal. journal_sessions now keeps the open root turn
(open_turn_id, open_turn_since), set by the row that opens a turn and
cleared only by a finish the provider reported, in that row's own
transaction. A turn a quit, crash or Stop cut short stays open, which is
what the next launch reads as Interrupted.

Journal schema version 5 adds the two nullable columns with a forward
migration; a new epoch starts with no turn open.

* fix(native-chat): restore chat tabs at startup without replaying any history

Startup opened every chat in the saved tab index and replayed its whole
journal into the main process to learn its status. With hundreds of tabs
and gigabytes of history, Orca froze in GC on every launch.

Startup now lists each restored chat from its record and publishes its
row as Interrupted (a turn was open when its host stopped, or the last
quit's resume offer lists it) or Done, through the status stream and the
agent-status sink, reading only each chat's journal_sessions row and its
newest row's time. A chat's history is read when something opens it; that
open settles what the gone generation left running and publishes the
journal's own row over the restored one.

No other startup path replays chats: restart offers list from their
markers without opening chats, and orchestration mail opens the chats it
must read one at a time. Opened chats are capped at 24 resident folds;
opening one past the cap closes the least recently active folds that are
only a cache, with the idle sweep's own close test.

* Fix lazy chat restoration and cache ownership

* Restore saved chat work across runtime restarts

* Wait for committed structural progress in migration fixture

* Correct restored ownership and bounded journal recovery

* Preserve bounded work selection during legacy recovery

* Complete deferred restart status publication

* Fix restart recovery test fixtures

* Use legal legacy recovery fixtures

* Correct population delete observation

* Bound legacy journal replay in a readonly worker

* Repair legacy worker proof oracles

* Reduce legacy scratch key serialization cost

* Decode population meter namespaces with scratch UTF-16 encoding

* Consolidate structured session imports for CI

* Remove redundant casts and document checked type exceptions

* Correct compiler contracts and retain journal fixture invariants

* Fix checked test fixture contracts after compiler validation

* Name population fixture identity type in exported signature

* Preserve historical quit presentation after rewind

* Fix structured session retry and remote worker delivery

* Preserve settlement and restored status contracts

* Enable legacy chat readiness on standalone hosts

* Repair structured session static checks

* Verify retained submission identity across rewinds

* Show saved chat status without replaying history at startup

* Keep chats closed when startup status finishes loading

* Keep startup owner recovery independent of history loading

* Preserve intentional quit verdicts in saved chat status

* Use a checked host fixture in startup restoration tests

* Group saved startup roster publication and verify scoped status work

* Use checked array access in status cut counters

* Complete checked saved status fixture typing

* Declare portable roster counter contract

* Use current saved chat startup APIs in contracts

* Preserve complete chat tab authority across startup

* Repair checked startup restoration test consumers

* Keep authority fixture module mocks in test entries

* Consolidate authority test fixture imports

* Check restore fixture contracts and recorded queue recovery

---------

Co-authored-by: m4air <m4air@Mac.localdomain>
Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
2026-10-29 10:20:52 -07:00
Neil 78ef844224 refactor(jira): group linked reads and source identity owners (#36013) 2026-10-29 10:18:17 -07:00
OrcaWinandOrcaWin def1565846 test: remove scalar settings suites and mocked status receipts (#36011)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-29 10:10:19 -07:00
Brennan Benson a214728b75 Reopening an old tool run no longer jumps to a stale scroll position (#35866)
* fix(native-chat): forget a run scroll when its disclosure is evicted

* Reset tool run scroll when opening after choice expiry
2026-10-29 10:07:27 -07:00
Brennan BensonandCodex QA b42fcd8a00 fix(runtime): retract Orca's own Codex ready title when the next turn starts (#35547)
* fix(runtime): retract Orca's own Codex ready title when the next turn starts

A Codex that paints no working title of its own (its activity title off) kept the
"Codex ready" frame Orca writes on its Stop hook for the whole next turn, so
tui-idle waits, mailbox delivery and the tab all read it as at rest. The working
hook now replaces Orca's own rest label with one working frame, as #29429 did
for agents whose profiles synthesize working titles.

Tracked in STA-12718.

* test: cover titleless turn wait and mailbox lifecycle

* test: type title recovery write spy

* test: isolate CLI lifecycle exit state across runtimes

---------

Co-authored-by: Codex QA <codex-qa@users.noreply.github.com>
2026-10-29 10:06:42 -07:00
Jinjing e41105b5fc fix(editor): suppress ambiguous Unicode highlights in Markdown (#36009) 2026-10-29 10:05:15 -07:00
Neil 525719789f perf(terminal): read the macOS process table in process instead of forking setuid ps (#35987)
* perf(terminal): read the macOS process table in process instead of forking setuid ps (#31783)

/bin/ps is setuid root, so every exec costs an uncached syspolicyd
assessment and an EDR inspection. The terminal host forked ~7-10 ps/lsof
per second with 4 agent panes, and each stale daemon multiplied that.

node-pty's patched pty.node now exports processTable (sysctl
KERN_PROC_ALL/KERN_PROCARGS2 on a worker thread), processCwd
(PROC_PIDVNODEPATHINFO) and processPath (proc_pidpath). runPsInProcess
renders the same ps column text for the invocations Orca issues, so the
existing parsers and callers are unchanged; anything it cannot reproduce,
non-macOS hosts, and builds without the exports keep running ps/lsof.

Measured with 4 anchored panes polled every 750 ms for 60 s: ~440
ps/lsof children before, 0 after.

* fix(daemon): roll the in-process macOS process table into a fresh v54 daemon (#31783)

* fix(terminal): bound, escape and complete the in-process macOS process table like ps (#31783)

Review follow-ups for the libproc reader:

- Timeouts: every caller passes its ps timeout; a read stalled behind a
  saturated libuv pool resolves timed out (code null, timedOut) at that
  budget, exactly as the killed ps would. Identical native reads share one
  worker, each caller racing its own deadline; past 8 distinct reads in
  flight callers run ps. execFile-shaped callers reject like a failed child.
- tty naming shares one slot with captureDarwinProcessTable's guard, so a
  draining naming pass sends both paths to ps instead of naming again.
- Commands: the addon renders argv with adv_cmds' getproclline and strnvis
  (VIS_TAB|VIS_NL|VIS_NOSLASH) under the caller's LC_CTYPE via a
  thread-scoped uselocale, so newlines print as \012 instead of splitting
  tokens; zombies print <defunct>.
- Other users' processes: unreadable argv is marked commandIncomplete. Only
  -p selections and processes on a terminal under the user's own readable
  process there (sudo in a pane) get a targeted `ps -p ... -o pid=,command=`,
  cached by (locale, pid, start time); root daemons and a pane's root login
  never spawn ps.
- -t selects with KERN_PROC_TTY after ps's addelem_tty path resolution, so
  per-terminal reads skip argv for every other process (~0.3 ms vs 4 ms ps).
- -p deduplicates; rows sort by terminal then pid as pscomp(); stat adds
  ps's < N X V L modifiers. The export is renamed readProcessTable so an
  older pty.node falls back to ps rather than misreading the new query.

* test(terminal): diff the real libproc addon against /bin/ps on macOS (#31783)

Spawns a pty holder whose argv carries a newline, tab, invalid UTF-8 and é,
then compares Orca's ps invocations column by column: pid/ppid/pgid/tpgid/
lstart/tdev/tty exactly, commands for the user's own processes, and stat
modulo running/idle (thread state needs setuid ps). Rows are compared only
when two in-process reads around the ps run agree, so churn cannot flake it.

* fix(terminal): never serve a native process table read begun before the request (#31783)

A timed-out read stayed shareable, so a later descendant capture could join
an earlier poll's abandoned worker and take its rows as fresh; a descendant
that exited meanwhile could have its reused pid SIGTERMed. The addon now
reports when its worker actually began reading (startedAtMs), and
runPsInProcess refuses a shared read that began before its own request and
reads again, so every consumer that signals from rows (descendant
teardown, foreground-group signalling, identity probes) only sees rows
scanned after its stamp. Regression: pty-descendant-termination-libproc.

Also from review:
- argv recovered with setuid ps is keyed by pid, start time to the
  microsecond, comm and executable path (exec changes the latter two) with
  a 10 min TTL and 512-entry bound.
- Recovery covers a sudo use_pty tree: the unreadable chain must start on
  the terminal of the user's own readable process, so the root shell and
  agent on sudo's own pty qualify while root daemons, GUI helpers and a
  pane's root login (own pty, under a terminal-less or tty-inheriting host)
  do not.
- Concurrent tty= readers wait out the single naming pass, and readers past
  the 8-read cap queue behind one, within their deadlines, instead of
  bursting /bin/ps at startup restore (24 panes polled at once: 0 ps).
- darwin-terminal-naming-slot.ts is now darwin-terminal-naming-single-flight.ts.

* test(terminal): require /bin/ps row order in the libproc parity test (#31783)

Parsers that take the first matching row depend on ps's terminal-then-pid
order, so compare the order of the rows both captures share, not just their
contents.

* test(terminal): pin libproc read start times instead of reading the wall clock (#31783)

* fix(terminal): match native process table reads to requests by sequence, not wall clock (#31783)

Freshness compared the worker's gettimeofday with Date.now(), so a clock
step back let an abandoned read's rows through (wrong-pid SIGTERM) and a
step forward could reject fresh reads until the deadline. Each read now
takes a JS-side sequence number when created and is submitted a microtask
later; a caller joins only a read not yet submitted or created after it
registered, so callers in one turn share a worker and nothing submitted
before a request serves it. The addon drops startedAtMs again. Deadlines,
timeouts and the argv cache use performance.now().

Callers past the 8-read cap wait on one slot notifier and each joined read
has one settle notifier; both unsubscribe on timeout, so a stalled pool
retains no per-caller reactions. If the pool is still at the cap when an
overflow caller's deadline passes, the reader is marked stalled for 30s
and callers run ps, as before this branch.

Recovered argv is trusted for 30s: exec can keep pid, start time, comm and
executable (node -> node with another script) and no cheap field shows it,
so a sudo pane costs one targeted ps per process per 30s.

* fix(terminal): keep ps fallbacks off a stuck terminal naming pass (#31783)

- captureDarwinProcessTable's canonical fallback, taken while the naming
  slot is busy, now runs /bin/ps directly instead of re-entering the
  in-process reader and waiting on that same slot (a held lstat timed out
  every strict capture without one subprocess fallback).
- In-process tty= readers wait out a short pass (startup restore) but hand
  a pass older than 500ms to ps, which names terminals out of process.
- The naming single flight keeps one settle notifier per pass; waiters sit
  in a Set and drop off on timeout, so timed-out callers leave no reactions
  on a stuck pass (was one per call). The notifier moves to
  deadline-settle-notifier.ts, shared with the native read scheduler.
- Once the native read breaker has tripped, a caller finding the cap still
  held after the cool-down returns to ps at once instead of waiting out its
  timeout.
- Descendant teardown and foreground-group signalling give the native read
  half their budget and fall back to a fresh ps on a native timeout, so a
  partly stalled pool cannot cost a kill.

* fix(terminal): give signalling ps fallbacks their full baseline timeout (#31783)

Splitting the budget in half shrank ps's window behind a stalled native
read: a 750ms ps lost descendant SIGTERMs and an 80ms foreground ps lost
group SIGWINCH. Descendant teardown and foreground-group signalling now try
the native reader for min(150ms, timeout/4) (inProcessSliceMs), then give
ps the whole original timeout; readProcessTableBeforeDeadline extends the
production reader's outer deadline by that slice, so ps succeeds exactly
when it did on main. The stale-read regression test now also asserts the
fresh rows' real descendant is signalled.

* fix(terminal): carry the in-process deadline allowance through every descendant reader (#31783)

readProcessTableBeforeDeadline granted the native slice only when the
reader was readProcessTable by identity, so the daemon shutdown sweep's
sharing wrapper kept a bare 250ms deadline: a stalled native read plus a
200ms ps missed it on every retry and descendants survived shutdown.
ProcessTableReader now declares deadlineAllowanceMs; the fresh reader sets
it (0 without the addon or with a stalled pool, so Linux and ps-only hosts
keep their exact deadlines), createProcessTableSnapshotReader and the
shutdown wrapper inherit it, and injected readers default to none. The
fresh reader moves to pty-descendant-fresh-table.ts. The real-ps parity
test gets a 30s per-case timeout, since whole-table /bin/ps runs slow
under suite load.

* chore(terminal): move the descendant reader's child_process baseline entry with it (#31783)

* test(terminal): pin the libproc test locale so lstart doesn't follow the runner's LANG (#31783)
2026-10-29 09:51:53 -07:00
Kelvin Amoaba 0c0814e872 fix(browser): keep the chosen default browser profile after a restart or update (#35991)
* fix(browser): keep the chosen default browser profile across restarts

The default profile pick lived only in the renderer browser slice, so every
launch rebuilt it as Default. Store it in GlobalSettings, next to the
profile scope setting, and read it through one resolver.

* test: seed default profile map without a new cast

* fix(browser): drop a saved default profile only once it is gone

Trust the saved pick when reading it and forget it on a delete or a full
listing without it, since partial catalogs and failed fetches prove
nothing. Load this desktop's profiles at startup even when Settings shows
a paired server, so local tabs resolve the saved pick's partition.

* test: drop the default-profile test that only guarded the removed mirror

* refactor(browser): share the profile delete step and simplify the startup local fetch

* fix(browser): load this desktop's profiles at startup without a focus read

* fix(browser): apply overlapping default profile writes in order
2026-10-29 16:49:01 +00:00
OrcaWinandOrcaWin 41bfe43ebb test: remove low-value wrapper and scalar store suites (#35906)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-29 09:40:20 -07:00
Kelvin Amoaba 92f9431416 fix(browser): give agent set device and viewport --mobile touch input and pointer: coarse (#35982)
* fix(browser): turn on touch when an agent sets a mobile device or viewport

* docs(orca-cli): say every page load resets agent device emulation
2026-10-29 16:34:03 +00:00
Neil 89705dbf85 fix(agent-resume): quote desktop-built commands for the host's own OS and shell (#35995)
Cold restore, sleeping-agent wake and account restart on a paired Orca
server quoted the resume line for this client's own OS, so a Mac client
quoted POSIX for a Windows server and a Windows client quoted PowerShell
for a Linux one. Fresh desktop-built launches knew the server's OS but
assumed PowerShell on Windows.

One resolver, resolveHostAgentStartupShell, now decides the shell a
desktop-built command runs in: a tab's override, then the executing host's
own Windows shell (this client's setting locally, the server's reported
terminalWindowsShell remotely), then the platform default. Fresh launches
and all three resume paths use it, with the server's reported OS. A nested
SSH workspace on a server quotes for its SSH target. A host that has not
reported its OS gets POSIX quoting with OS-specific agent flags off.
2026-10-29 09:23:56 -07:00
d527f971cd fix(orcad): keep the browser sidecar's listener on loopback (#31896)
* fix(orcad): keep the browser sidecar's listener on loopback

orcad starts its headless browser sidecar as an `orca serve` child and talks to it
only over the Unix socket / named pipe. Serve mode binds its WebSocket listener to
all interfaces, so every headless host also exposed the sidecar on a random port to
its LAN and VPN. Pin the sidecar's listener to 127.0.0.1, using the owner variable
orcad already sets, so no orcad or argv change is needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(orcad): pin the sidecar to loopback using the existing sidecar launch marker

orcad already marks its browser sidecar with ORCA_ORCAD_SIDECAR, read by
isOrcadSidecarLaunch() for the foreground policy. Reuse it instead of
remembering the consumed owner variable in a new module flag.

* test: drop the stale desktop pinnedBindHost parity exception and reset the sidecar mock per test

---------

Co-authored-by: Daniel <momo.zhiwang@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Kelvin Amoaba <97001695+AmoabaKelvin@users.noreply.github.com>
2026-10-29 16:22:55 +00:00
Jinjing 23c146929c Fix mobile terminal overlays after delayed PTY binding (#35842)
* Refresh mobile terminal overlays after delayed PTY binding

- Show phone fit and driver-lock state when hydration precedes pane binding

* test: verify mobile overlays render after delayed PTY binding
2026-10-29 09:14:04 -07:00
Kelvin Amoaba 7c5314196a feat(native-chat): preview cards for web links, fetched with a private-address guard (#35221)
* feat(native-chat): preview cards for web links in chat

Hovering an http(s) link that isn't the repo's own PR or issue shows the
page's image, favicon, site name, title and description. The chat's host
fetches the page with no cookies, refusing private, loopback and
link-local addresses after DNS and on every redirect, and returns images
as data URLs. A Chat > Behavior setting turns web previews off.

* perf(native-chat): cap link preview caches at 20 MB each

Preview images are held as data URLs, so a count limit alone let the
renderer and main caches grow to hundreds of MB in a long session.

* fix(link-preview): keep a > inside quoted attribute values

Page tags ended at the first >, so content="Home > Docs" was cut short
and an og tag whose content came before its property was dropped.

* fix(native-chat): keep link preview caches within budget and keyed by host

A preview that finished after newer ones stopped eviction at itself, so
both caches could stay over their byte limit. The GitHub card's load key
also left out the host its repo lives on.

* fix(link-preview): decode the named entities page titles use

Only five named entities were decoded, so titles like
Docs&nbsp;&ndash;&nbsp;Guide showed the raw codes in preview cards.
2026-10-29 16:12:07 +00:00
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