Commit Graph
17870 Commits
Author SHA1 Message Date
Kelvin Amoaba cc6da802a5 feat(browser): paste images into annotation comments and send them to the agent (#36004)
* feat(browser): paste images into annotation comments and send their paths to the agent

* fix(paste): hand an image-only clipboard to native paste so Cmd+V reaches the annotation field

* fix(browser): let an open image preview keep Escape instead of exiting Design Mode

* test(paste): drop the ownership-event test the menu-claim test already covers

* refactor(browser): reuse chat preview lifetimes and the terminal's paste host for annotation images

* fix(browser): release pasted edit images when the edited note disappears
2026-10-29 20:48:45 +00:00
Kelvin Amoaba 0cdb7b35cd fix(browser): refuse a 21st page annotation with a visible limit instead of dropping the oldest (#35979)
* fix(browser): refuse a 21st page annotation with a visible limit message instead of dropping the oldest

The store evicted the oldest note once a page held 20, so feedback vanished unseen. It now refuses the add; picking an element on a full page shows a limit toast instead of opening a draft, and the annotate banner states the limit.

* fix(browser): name the actions that free an annotation slot

* fix(browser): skip the limit toast for a selection loading already cancelled

* refactor(browser): one isBrowserAnnotationPageFull rule for the store, hook and banner

* refactor(browser): move the annotation limit message out of the grab hook

* fix(i18n): name the annotation limit placeholder
2026-10-29 20:48:13 +00:00
Kelvin Amoaba 93d8ce7767 fix(notes): name each agent in Send notes to by its sidebar name instead of its type (#35977)
* fix(notes): name each agent in the Send notes to menu the way its sidebar row does

* chore(ratchet): prune the notes-send menu from the host-list render baseline
2026-10-29 20:47:53 +00:00
Neilandzhangxaochen 8a4bc559e6 perf(mobile): skip line stats when loading Source Control status (#36061)
* perf(mobile): skip line stats when loading Source Control status

Mobile Changes rows never render per-file line counts, so the default
git.status line-stats pass (up to two `git diff --numstat` subprocesses
plus untracked file reads) was wasted host work on every load. Hosts
that predate the param strip the unknown key and behave as before.

Co-authored-by: zhangxaochen <3416677+zhangxaochen@users.noreply.github.com>

* test(mobile): re-record Changes-load goldens for the no-line-stats status read

Co-authored-by: zhangxaochen <3416677+zhangxaochen@users.noreply.github.com>

---------

Co-authored-by: zhangxaochen <3416677+zhangxaochen@users.noreply.github.com>
2026-10-29 13:36:57 -07:00
Neil e8e0803672 fix(wsl): hold main's background WSL start before the cwd probe; let the user's runtime start check a WSL folder (#35971)
* fix(wsl): hold main's background WSL start in the shared preflight; folder launch scope honours the user's act

Main's background start (no wslUserAct) is now held in resolvePtySpawnStartupTarget, before the
startup cwd probe and any provider. A runtime start the user asked for (CLI, window, phone, split)
checks a WSL folder workspace's path as their act, so it may start the distro; background work is
refused with the stopped-distro message instead of folder_workspace_path_unavailable.

* fix(wsl): agent-session create and user resume check a WSL folder as the user's act; background holds with Start

* fix(wsl): agent-session ensure and a failed start's kept pane pass the user's act to the WSL folder check

* test(e2e): a prepared terminal.create dedupes as the caller's act
2026-10-29 13:31:17 -07:00
Neil 29a6ff3ffa refactor: colocate Jira cache and project selection owners (#36051)
* refactor: colocate Jira cache and project selection owners

* ci: refresh Jira refactor validation after main test fix

* ci: refresh Jira owner move after main validation fixes
2026-10-29 13:29:24 -07:00
OrcaWinandOrcaWin a01568e08c test: remove low-value metadata and registration inventories (#36066)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-29 13:27:15 -07:00
Brennan Benson db9cfbdb0a test(worktrees): cover both emoji branch naming modes (#35745) 2026-10-29 13:25:27 -07:00
Brennan Benson 6e0c74465c fix(claude): avoid unsupported workflow agent views (#35749)
* fix(claude): keep unsupported child rows on their parent pane

* fix(i18n): remove obsolete Claude agent denial translations

* fix: recover unavailable Claude child navigation to parent

* test: complete agent row navigation contracts and CI compliance

* test: repair agent row localization and integration ownership
2026-10-29 13:25:15 -07:00
Brennan Benson ec4d46f4f0 Use the shared default agent selection for work-item launches (#35748)
* Use the shared default agent resolver for work items

* Assert the preferred work-item agent opens as chat

* Use workspace owner inputs throughout work-item agent launch

* Use equivalent test syntax accepted by CI

* test: exercise real availability for direct launch defaults

* test: name public direct launch fixture mock types

* test: document partial launch store assertion exception
2026-10-29 13:24:10 -07:00
Jinjing f9649f114c Update structured session fixtures for command prefixes (#36058)
* Update structured session test fixtures for command prefixes

* fix: keep session record validator within lint line limit
2026-10-29 13:22:15 -07:00
Brennan Benson 9fe6e173ca Session History opens conversation files instead of storage databases (#35051)
* fix(history): open conversation files instead of storage locators

* Preserve accepted transcript extension casing and verify log consumers

* Type session log action test fixtures explicitly
2026-10-29 13:20:31 -07:00
Brennan Benson 11e7f46fc1 fix(worktrees): retire Git metadata watchers on root loss (#35067)
* fix(worktrees): retire Git metadata watchers on root loss

* Fix native watcher retirement after missing snapshots
2026-10-29 13:20:03 -07:00
Brennan Benson 920fa6cdbc Restore Session History resume for symlinked workspaces (#35052)
* Fix Session History resume for symlinked workspaces

* Bound history alias derivation and cover resume consumers

* Reuse equal alias values across history publications

* fix(history): verify adopted source directory before commit

* fix: preserve UTF-8 paths in directory admission probe

* fix: bypass transcript preparation for non-adopted starts
2026-10-29 13:17:40 -07:00
Brennan Benson e08cb10cc6 Prevent resting chats from delaying native command menus (#35069)
* Scope native chat command discovery to menu demand

* Fix command discovery CI imports and test timing

* fix: recover demanded command menus after context retirement

* test: load command host fixture before mocked consumers

* test: retain eager cache reads across command expiry

* test: cover command recovery after pending deadline

* test: count demanded command renders and query isolation

* test: load mobile command host fixture during collection

* test: type command batch fields from subscribe events

* test: check command event arrays without assertion

* Fix command discovery fixture project boundaries

* Name command fixture mocks with public Vitest types

* Assert opening metadata on resumed session snapshots

* test: assert passive command population boundaries

* test: cover mobile command capability handoff

* test: correct capability proof scope adapters
2026-10-29 13:16:35 -07:00
Brennan Benson e69baa3499 fix(linear): stop writes when their caller lifetime ends (#35020)
* fix(linear): bound write preparation and mutation to one caller lifetime

* fix(linear): isolate cancellable preparation from shared reads

* test(linear): keep CLI lifetime coverage in its compiler project

* fix(linear): preserve comment change failure guidance

* test(linear): place CLI and runtime coverage with integration tests

* test(linear): reset CLI exit status across runtimes

* fix(linear): preserve truthful confirmation deadline causes

* test(linear): support renamed workspace selector in fixture

* test(linear): adapt relation lifetime fixture to client factory
2026-10-29 13:15:07 -07:00
Brennan Benson 14676d11fb fix(native-chat): keep the session record file within the length limit (#36056)
* test(claude): call the flag-support helper after the check API rename

* fix(native-chat): reuse the non-negative integer guard so the session record stays within the file-length limit

* test(claude): leave the flag-support test to #36058
2026-10-29 13:14:03 -07:00
Neil e32c794f7b fix: restore record lint and session fixture validation (#36065)
Compose the exact changes from PR36056 and PR36058 so lint and session fixture contracts pass together.
2026-10-29 13:10:16 -07:00
Brennan Benson 7321b066e8 Show messages between agents as cards with the other agent's status (#34824)
* Snapshot agent message relations and verify task display prefixes

* Show native chat agent messages in navigable cards

* Keep agent message cards derived from canonical input and sidebar state

* test: correct agent card contracts and cover raw queue editing

* test: repair agent card runtime and operation contracts

* fix: preserve queued image previews and typed test measurements

* fix: use checked worker fixture and owned sender button typography

* fix: complete agent card fixtures and native presentation

* test: preserve queued edit exports and current authorship

* test: use namespace type imports in queued edit fixture

* Preserve sender progress and consolidate card contracts

* Simplify sender and notice contract instrumentation

* Remove duplicate sender and notice measurement mirrors

* Use a template literal for the dispatch boundary fixture

* Correct sender and notice verification phase accounting

* Consolidate agent message tests around user contracts

* Restore folded agent message preview on focus exit

* Consolidate agent message regression coverage

* Consolidate agent message fixture data

* Fix display text test lint diagnostics

* Use conversation view type for mail test records

* Reuse active copy control in card workflow test
2026-10-29 13:09:50 -07:00
Jinjing cb21824bd9 Optimize hidden chat subscriptions and tab projections (#36047)
* perf(tab-bar): patch tab agent projections per changed tab instead of rescanning every layout

The shared TabBar agent projection rebuilt agent types and tab-wide chat
fallback safety from every terminal layout (~2.5k at the captured scale) and
every status row whenever either map's identity changed. Status pings that
keep each pane's agent type now reuse the cached projection, and layout edits
re-resolve only the added, replaced or removed tabs. Key reorders, agent-type
changes and added/removed status rows still take the full projection.

* perf(ai-vault): keep rank and owner-only updates from re-collecting every agent conversation

The AI Vault title subscription ran two full agent-conversation collections
(every terminal tab, retained, sleeping and live record) whenever any owner
input changed identity, including worktree rank/unread patches and unrelated
settings writes. Compare worktree rows through the existing owner-rows token
so rank-only patches skip the check, and reuse the conversation workspace set
while the agent/tab maps it reads are unchanged, so owner-only updates compare
only those workspaces' hosts. Real host moves still schedule a title rescan.

* perf(native-chat): project only changed sessions on structured status feed ticks

Each host status feed tick re-captured every structured chat member on that
host (hundreds at the captured scale), resolving each tab's owner about three
times plus companion pin checks, even though a status event names one
session. Members whose feed facts (summary, observation, failure, sleep and
launch directory) and tab are unchanged since their last consumed capture are
now skipped, and tab owners are cached until an owner input changes, with
worktree rows compared through the rank-insensitive owner-rows token.

An input is marked consumed only after projection returns normally, so a
throwing store commit still retries on the next emission. The bridge remains
the only writer of slept-at and launch-directory pins, so skipping unchanged
members does not drop a needed re-assertion.

* perf(native-chat): skip the per-render scroll-margin offset walk in hidden chats

The transcript window re-read its scroll margin through an offsetTop walk in
a dependency-free layout effect, so every render of every retained chat forced
a synchronous layout read, including display:none panes where the walk cannot
produce a margin. The read now runs only while the pane is visible; becoming
visible re-renders and measures, and mount/resize measurements are unchanged.

* perf(native-chat): stop rank and catalog writes from rerendering every mounted chat

useNativeChatImageRuntimeContext shallow-subscribed each chat root to
worktree rows, runtime environments, SSH state and other owner maps, then
resolved the context in render. A worktree rank patch or a host catalog
timestamp refresh replaced one of those maps and re-rendered the whole
NativeChatStructuredSession of every mounted chat, hidden ones included (57 of
57 probes per write in the subscription benchmark). The selector now resolves
the context itself and keeps the previous identity while the result is
shallow-equal, so chats re-render only when their route or path changes.

* Optimize hidden chat subscriptions and release closed tab state

* Share layout diffs across tab bar projections

* Strengthen tab agent projection fuzz coverage

- Use a stable PRNG that exercises the full operation space
- Assert tab, agent, layout, and operation coverage
2026-10-29 12:22:50 -07:00
Neil 64c0992d2f test(wsl): pin the stopped-distro hold for a non-WSL shell in a WSL UNC folder (#35969)
* test(wsl): pin the UNC-cwd hold for a non-WSL shell on the daemon path

* test(wsl): pin the UNC-cwd hold for a non-WSL shell on the local path
2026-10-29 12:22:24 -07:00
Neil d7a33e1b12 test: use Claude flag support helper for launcher prefixes (#36052) 2026-10-29 12:21:58 -07:00
Brennan Benson 91efcc4df0 Add a per-host running terminal limit setting (#31396)
* feat: configure the running terminal limit for each host

* fix: bound terminal policy saves through fresh confirmation

* Fix truncated zero-size system file reads

* Load actual filesystem fixtures once per test module

* Preserve slept terminal ownership through capacity retries

* Fix terminal limit CI quality checks

* Correct slept terminal resume test types

* Move the slept terminal Resume fix to its own pull request

The Resume correction fixes a bug that already exists at the default limit,
so it now lives in #35401 and this change only adds the terminal limit
setting.

* Keep terminal limits effective when saved settings cannot be read

* Require a numeric edit before repairing terminal limits

* Derive terminal default from startup host capacity

* Apply terminal policy reads when validated results settle

* Align terminal limit tests with static analysis gates

* Inject daemon startup errors at the publication boundary

* Format terminal capacity using the app language
2026-10-29 12:18:02 -07:00
Brennan Benson 6d76f5a77b Keep a sleeping conversation resumable when the terminal limit is reached (#35401)
* Keep a sleeping conversation resumable when the terminal limit is reached

Resuming a slept pane while the host terminal limit was reached could drop
the Resume screen and fall back to a plain spawn. Route capacity refusals back
into the deferred sleep state, retry through the main-owned resume, and keep
the original session and provider until space frees up. A later Sleep or
cancellation still wins.

* Retain sleeping pane retries after transient owner failures

* Verify sleeping pane retry lookup bounds at scale

* Correct sleeping pane retry test fixture types

* Use transport attach contract in terminal test fixture

* Construct complete terminal transport test fixture
2026-10-29 12:17:37 -07:00
Brennan Benson 98f5d13689 A kill that reached the agent ends it, so the next message after Stop goes through (#34653)
* fix(native-chat): a kill that reached the agent ends it, so the next message goes through

After Stop, tab close, idle rest or workspace sleep, Orca force-kills the
agent. It used to accept the old agent as gone only when it saw the exit
report within about a second; otherwise every later message re-ran the kill
and was refused with "Couldn't stop {agent} from before." A kill delivered to
the agent itself now ends it and releases the chat with kill-delivered
evidence; the refusal remains only when the kill could not reach the agent.

When writing the chat's journal fails and the following kill can't be
confirmed, recovery now records the close with its fault instead of silently
returning, so the turn no longer stays Working and later sends retry the stop.

Tracked in STA-12354 and STA-12355.

* Preserve provider kill evidence across cleanup retries

* Exercise ACP setup gate with real managed teardown

* fix: preserve Claude writer termination evidence through settlement

* test: consolidate termination evidence contracts

* fix: restore Pi connection exit listener contract

* test: load actual ACP teardown before timed cases

* fix: correct lifecycle contract typing and test boundaries

* test: make Claude piped fixture mock types portable

* test: expect supervised OpenCode probe teardown

* test: align remaining supervised teardown expectations

* fix: align Stop feedback with terminal writer evidence

* test: remove redundant mocked Codex continuation case

* fix: keep adapter declaration and Stop fixture checks portable

* test: keep Stop fixture clock unchanged

* test: read canonical provider handle when reopening Stop journal
2026-10-29 12:15:56 -07:00
Jinjing 21cb9ebb78 perf(terminal): send typed keys to the PTY before publishing activity; split echo latency phases (#36008)
* perf(diagnostics): split terminal echo latency into queueing, round-trip, parse and paint phases

The typing diagnostic started timing at its own capture handler and lumped the
PTY round trip, renderer output scheduling and xterm parse into one interval, so
a stalled renderer could not be told apart from a slow PTY or TUI. Exact samples
now also report trusted-event input queueing, onData to first output reaching
the output scheduler, scheduler queueing, and xterm parse, plus each sample's
overlap with long animation frames. The report shape only gains fields.

* test(bench): measure terminal echo phases under accumulated workspace-update pressure

Adds a typing bench scenario that types into one real PTY while the accumulated
store receives rank-only order publications (and optional status traffic), runs
the in-app phase diagnostic beside the PTY sidecar, and moves the shared bench
knobs and report writer into a module both specs use.

* perf(terminal): send a typed key to the PTY before publishing its activity stamp

xterm fires onUserInput before onData, and the first key after a pause wrote
lastTerminalInputAtByPaneKey synchronously there, so the key waited on every
store subscriber before it was sent. Publish the stamp in a microtask instead:
the same task still records it, after the key has been handed to the transport.
At 1,620 workspaces and 2,356 store listeners, input-to-dispatch for keys after
a pause fell from p50 1.2-1.5 ms to 0.5 ms.

* Improve typing latency diagnostic accuracy

* Flush queued long tasks in live typing latency reports
2026-10-29 12:11:08 -07:00
Brennan Benson f87d68b4a4 Chat runs launcher Commands like op run -- codex for every agent (#35592)
* Support launcher command prefixes for all chat agents

* Preserve launcher path arguments and copy routing checks

* Match Japanese command guidance to the Agent settings label

* test(pi): expect version probe termination barrier

* test(chat): expect current command refusal guidance

* fix(acp): refuse copy arguments before launch preparation
2026-10-29 11:59:03 -07:00
Jinjing a4e600a663 fix(git): recognize colored stale lease rejections (#36041) 2026-10-29 11:50:37 -07:00
Jinjing d12a4b1c5c perf(sidebar): skip closed-menu catalog work and batch remote order publications (#36002)
* perf(sidebar): keep closed workspace menus and host dialogs off catalog churn

Closed row context menus subscribed to the full worktree list, worktree map
and repo map, and ran the delete-lineage traversal whenever any worktree row
changed. At 1,618 workspaces every rank-only update re-rendered each mounted
menu and rebuilt the lineage projection per menu.

- Menus now select stable empties for the catalog while closed and gate the
  lineage/sleep/delete subtree calculation on menuOpen; opening re-renders
  with the live host-qualified rows.
- Per-host HostRemoveDialog no longer resolves SSH removal scope while
  closed, retaining the last open snapshot through the exit animation.

Measured in happy-dom with 40 mounted closed menus over 1,618 rows: nine
rank bursts went from ~52 ms and 360 lineage traversals to ~2.6 ms and 0.

* perf(worktrees): batch remote order publications across repos into one commit

Hosts publish one sortOrderOnly worktreesChanged event per changed repo, and
each fast-path patch was its own store commit, so a multi-project reorder
produced back-to-back global renders (nine ~95 ms tasks in the 10-28 trace).

Published order patches now join a fixed 32 ms window and apply in a single
patchWorktreeSortOrderBatch transaction (one worktreesByRepo copy, one
sortOrderEpoch bump). Each repo handler awaits its flush, so renames and
structural refreshes queued for the same repo still run after the patch.
At flush the connection fence and host-row presence are re-checked; stale
entries fall back to the existing refetch path. Same-id host twins keep the
existing host matching.

* perf(sidebar): skip catalog index builds for closed menus

Check menuOpen before calling the catalog getters so a closed menu never
rebuilds the shared repo/worktree indexes on catalog changes.

* Prevent stale host dialog subscriptions and sort-order patches

- Unmount dialog content after exit while preserving pending removal state
- Fence batched sort updates to the submitted repository listing

* Disable host removal while its dialog closes
2026-10-29 11:47:48 -07:00
Brennan Benson e6878905be fix(wsl-host): Start connects a stopped distro once and names it when it fails (#35438)
* fix(wsl-host): Start connects a stopped distro once and names it when it fails

Start called the WSL host's connect and then the generic explicit connect, which
routes to the same WSL host again, so one click deployed and supervised the
server twice; a failure toasted main's raw text (a probe's command line).
Start now makes only the explicit connect, which still refuses a host whose
Remove is pending, and a failure says "Couldn’t start <distro>" with where to
look.

* test(wsl-host): cover moved Start admission and default failure toast

* test(wsl-host): load actual registry outside test hooks

* style(wsl-host): format admission test import

* test(wsl-host): check pending removal fixture type
2026-10-29 11:46:41 -07:00
OrcaWinandOrcaWin b3e5b9a5e0 test: remove schema inventories and redundant capability checks (#36040)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-29 11:38:24 -07:00
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