You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Move the Linux port scan's per-file process lookup off Orca's main process - #47943
While Orca's window is open, it checks every 30 seconds which local servers are running so it can show them in the Ports panel. On Linux, Orca did that by looking through every open file of every program itself, which kept its main process busy for most of a second each time. Now one small system command does the same look, outside Orca's main process, and gives the same answer.
Files
Added
Deleted
Net
Test
1
$\color{#1a7f37}{\Huge{\mathbf{+}}}$76
0
$\color{#1a7f37}{\Huge{\mathbf{+}}}$76
Prod
8
$\color{#1a7f37}{\Huge{\mathbf{+}}}$280
$\color{#cf222e}{\Huge{\mathbf{−}}}$51
$\color{#1a7f37}{\Huge{\mathbf{+}}}$229
What Changed
On Linux, the socket-to-process lookup runs in the existing port-scan worker. The worker execs one ls -ln /proc/[0-9]*/fd (LC_ALL=C, one argument per process), and filters its output line by line. It keeps only the holders of the listening sockets being looked up and counts every well-formed fd -> socket:[N] row. Electron main no longer awaits one readlink per open fd on the machine.
The answer is the same as before: Orca still lists /proc itself, and when several processes hold a socket it keeps the one that comes last in that listing, exactly as the old walk did.
The listing is a single process tracked with the worker's other scan children, so a timeout or quit kills it.
Falls back to the old walk if the listing fails, times out, or shows no well-formed socket rows; after a failure it uses the old walk for the next 9 scans instead of paying for both each time.
Stopping a port's process and the localhost label allow-list keep the exact old walk (each link read with readlink), because ls prints raw paths.
macOS and Windows paths are unchanged.
Why
The old walk ran on Electron main and cost one async readlink per open fd on the machine: 405–1,010 ms of main-process CPU per scan on a ~900–1,100-process Linux box, every 30 s while the window is visible.
With the change, the same box spends 32–58 ms in Node (including the filter, which runs in the worker in the app) plus 90–110 ms in the ls child, about 3× less CPU overall and almost none of it on main, with identical ports and owners. Other editors detect Linux ports the same way, with one directory listing in a child process rather than a per-fd walk inside the app.
Caching owners between scans was tried first and dropped. A socket handed between two running processes can't be seen without a full look, and a stale owner can drop a workspace's advertised URL.
Visual Proof
N/A: no UI change; the Ports panel shows the same rows.
Testing
Ran the real scanner on Linux (commands and worker code executed for real), same box, before and after: before 405–567 ms CPU per scan; after 32–58 ms Node plus 90–110 ms in ls; ports and owners identical on every scan. Earlier sessions on a busier box: before up to 1,010 ms. Timed listers alone: ls -ln 70–100 ms, find -printf 40–50 ms, ss -ltnp 30–40 ms. ls was kept because busybox systems have it and find -printf/ss may be missing.
linux-socket-owners.test.ts feeds an ls -ln listing through the worker's filter in small chunks. It checks that only wanted holders are kept, that look-alike rows (a file named x -> socket:[N], extra fields) are ignored, and that the owner is the last holder in /proc order (not text or numeric order). It also checks that an unreadable layout is told apart from no wanted holders.
pnpm check:changed passes.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Performance
Less work, almost all of it off Electron main: the Linux 30 s visible-window port scan drops from ~400–1,000 ms of main CPU to a /proc listing plus a short parse on main, and total CPU drops about 3×. New cost: on Linux the existing port-scan worker thread now starts with the first scan and retires after 5 idle minutes, as it already does on macOS and Windows. No new timers, polls or IPC.
The blocking-helper ratchet rows for the scanner and linux-socket-owners.ts rise by one. Both come from the worker client's single existsSync when it lazily starts the worker, the same path the macOS and Windows scans already take.
Risk
Level: Low
The riskiest part is reading ls -ln output. Only exact 11-field fd -> socket:[N] rows count. A listing with no such rows, an error or a timeout falls back to the old walk, so an unexpected ls costs CPU, not attribution. A process that can open files with newlines in their names could still forge a row in the Ports panel. Stop and the allow-list don't use the listing, so it can't redirect a kill. Back out with a plain revert.
AI Disclosure
Review
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Remote Linux hosts run the same scanner and benefit the same way.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
…unchanged
The 30 s workspace port scan read every fd link of every process on the
machine to map listening sockets to pids. Reuse the last map while the set
of listening inodes and each owner's start time are unchanged; ownership
checks that authorize a kill still walk fresh.
No actionable comments were generated in the recent review.
Walkthrough
Linux port scanning now passes scan options to scanLinuxProcPorts. The scanner uses resolveLinuxSocketOwners to map socket inodes to PIDs. The resolver can use a worker-based socket-holder listing or walk /proc, based on scan options and listing availability. The previous local inode-to-PID mapping function was removed.
Merge Risk: Minimal · up to a2f5d
Linux port scanning now resolves socket owners with one listing in the worker instead of many file reads in the main process. It falls back to the previous method if the listing fails. No outstanding defects were found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title says the Linux port scan's per-file process lookup moved off Orca's main process. The changeset does this: the socket-to-process lookup now runs as an ls child inside the existing port-scan …
Description check
The description follows the repository template and covers ELI5, What Changed, Why, Visual Proof (N/A with reason), Testing, Performance, Risk with level, and the checklist. It explains the mechanism,…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title says the Linux port scan's per-file process lookup moved off Orca's main process. The changeset does this: the socket-to-process lookup now runs as an ls child inside the existing port-scan worker, and the per-fd readlink walk in main is replaced by a fallback path. The title names the main change, though it does not mention the ls-based listing or the fallback.
Full details: Description check
Explanation
The description follows the repository template and covers ELI5, What Changed, Why, Visual Proof (N/A with reason), Testing, Performance, Risk with level, and the checklist. It explains the mechanism, the fallback behavior, the alternatives considered (caching was dropped), and the rollback path (plain revert). Gaps: the Linked Issue section reads 'Fixes #' with no issue number, the AI Disclosure section is empty, and the Review section has no content. The template requires an issue link for outside contributors, so the author should confirm whether one applies.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 65b1cddf-324f-482f-b7c1-717beaadff45
Commits
Reviewing files that changed from the base of the PR and between 2426acd and a2f5d7e.
Files selected for processing: 2
src/main/ports/linux-socket-owners.test.ts
src/main/ports/linux-socket-owners.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
…e our own sockets mapped
A socket handed to a child while its parent lives, or a root socket later
inherited by a user process, kept its inode and the cached owner. Walk again at
least every 10th scan and whenever one of our own sockets has no owner.
… a live pid
A supervisor that handed its socket to a child and closed its copy stayed the
cached owner, so the port showed as external and its advertised URL was
dropped. On reuse, check that each cached owner still holds its socket and walk
processes started since the last walk, keeping the full walk's last-holder rule;
walk everything again after 10 scans or 5 minutes.
…rker
Replace the reuse cache with exact full-walk semantics: one ls -ln /proc/*/fd
in the port-scan worker lists every socket holder, and the owner is the last
holder in /proc's listing order, as the node walk picked. Falls back to the node
walk if the command fails.
brennanb2025
changed the title
Stop the Linux port scan from re-reading every open file when nothing changed
Move the Linux port scan's per-file process lookup off Orca's main process
Nov 24, 2026
Printing every socket fd could pass the worker's 2 MiB output limit on a large
machine, failing every scan into the main-thread walk. awk now prints only the
listener inodes plus a count of well-formed socket lines, which tells an
unreadable ls layout apart from listeners Orca can't see; holder lines must end
in ' -> socket:[N]'.
…nux socket owners
The sh | ls | awk pipeline left ls and awk running when a timeout or quit killed
sh, and awk's list search grew with sockets x listeners. The worker now execs a
single ls (LC_ALL=C), tracks it with the other scan children, and filters rows
line by line with a Set: only exact 11-field 'fd -> socket:[N]' rows count.
… an over-long line
TIME_STYLE or QUOTING_STYLE in Orca's environment changed ls's layout and
disabled the listing; an over-long path line split across chunks cleared the
current pid and lost that process's later sockets.
Scope:origin/main...2426acd7f28, traced by reading source. Hosts are local Linux and orcad on Linux. macOS and Windows dispatch are unchanged, and direct SSH remains unsupported.
Path: the visible-window 30 s poll or a manual scan reaches scanLinuxProcPorts (local-workspace-platform-port-scanner.ts:168), then resolveLinuxSocketOwners. That calls runPortScanCommand, which goes through a serial queue (cap 8, 30 s deadline) to the worker. The worker runs /bin/sh -c 'exec ls -lnq /proc/[0-9]*/fd' (4 s timeout) and filters the output as it streams. Only the matching holder lines are copied back to main, where pickLastHolders picks the owner.
Cost per scan:
Thread
Cost
Main
One readdir('/proc') plus an O(pids + holders) rank map. The payload back from the worker is 18.8 KB at 1k processes and 208 KB at 10k.
Worker (filter, my Mac)
17–28 ms at 1k processes × 50 fds (4 MB). 161–175 ms at 10k processes (40 MB). Cost grows linearly.
Child
One ls per scan.
Batch overhead: the -q replacement and the discarding flag add O(1) work per character or line and buffer nothing extra.
Author's figures: 405–567 ms of main CPU before, and after 32–58 ms of node CPU including the filter, plus 90–110 ms in the ls child, with identical owners. I did not reproduce these on Linux, but my filter timings are consistent with them.
At 10× fleet: about 1 s of ls plus about 0.17 s of filter, both off main and under the 4 s timeout. Past the timeout, the code kills ls and falls back to the base walk; no orphans are left.
Regression class
Disposition
Subprocess per item
Disproved: one ls per scan, not one per process or fd.
Sync fs on main
Disproved: only the existing lazy existsSync in the worker client (baseline entry, once per worker spawn).
Fixed-cadence poll / new idle wakeups
Disproved: no new timer. The listing timer is one-shot per request. Extra wakeups at idle stay at 0/s on main and on the worker.
Hidden owners keep working
Disproved: hidden windows don't poll, and the worker shuts down after 5 min idle.
Hot-path rescans
Disproved: one Set.has per socket row, and linear time measured at 1k and 10k.
Expensive code newly reachable through a failure fallback
Disproved: the environment-triggered seen 0 is gone. A real failure retries the listing only every 10th scan.
Unbounded queues
Disproved: one request per scan, queue cap 8.
Six questions:
Unused work before the skip gate: reviewed. Only wanted holders cross the thread boundary.
Ownership multiplies work: reviewed. One shared worker and one listing per scan per host.
Which thread pays: reviewed. The filter runs on the worker (measured above); main pays O(pids).
What grows, does the next attempt advance: reviewed. Cost is linear in fds. The over-long-line and environment causes of seen 0 are fixed.
Execution host: reviewed by source for GNU, busybox and uutils ls. Not run on Linux.
Obsolete work stops: reviewed. exec leaves one process, it is tracked in activeChildren, and it is killed on timeout or shutdown.
Gaps I could not close: no real Linux timing of ls or of the whole scan, and the worker's memory on Linux is unmeasured.
Problem: on Linux, the Ports panel's 30 s scan (visible window only) mapped listening sockets to processes by awaiting one readlink per open fd of every process, all on Orca's main process. That cost ~400–1,000 ms of main CPU per scan on a busy machine.
Change: one ls -lnq /proc/[0-9]*/fd runs in the existing port-scan worker (one process, PATH + LC_ALL=C only), filtered line by line there. Owner choice is the same as before (last holder in /proc order). Stop and the localhost label allow-list keep the exact readlink walk. A failed or unreadable listing falls back to the old walk and retries the listing every 10th scan. macOS and Windows unchanged.
Earlier run (superseded below), head 2426acd: real scanner on Linux (~1,000 processes, 49 listeners), same box, before → after: 405–567 ms CPU per scan, all on main → 24–58 ms in Node (incl. the worker-side filter) + 60–110 ms in the ls child; ports and owners identical on every scan.
Fixed during review (7 blinded Codex audits, 7 Claude passes):
A reuse cache was tried and dropped. It couldn't see a socket handed between two running processes, and a stale owner could drop an advertised URL.
A newline-forged path, an over-long line, TIME_STYLE/QUOTING_STYLE, the pipeline leaving ls/awk behind after a timeout, and output growing with every socket on the machine.
The pid-order rule for shared sockets.
Verified:
Final blinded Codex audit: SAFE. Claude review: CLEAN. Fresh perf-scan: clean (comment above).
linux-socket-owners.test.ts (filter, forgery, long lines, owner order).
ls -q forgery check on GNU coreutils 9.12.
pnpm check:changed; remote-check pnpm tc PASS on this head.
Deferred / needs sign-off:
Two blocking-helper ratchet rows rise by one. Both come from the worker client's lazy existsSync, the same path macOS and Windows scans already use.
New on Linux: the port-scan worker thread now runs while scans happen, and retires after 5 idle minutes.
QA: qa=tests. There's no UI change, and the only allowed Linux GUI host can't run our test copies. The benchmark and tests above stand in.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
What runs per scan. Trigger: the 30 s visible-window scan, Linux only, with requireMetadata false. Kill and allow-list scans keep the exact walk.
Main thread:readdir('/proc'), a request carrying the inode list, a small response (holder lines plus seen), and a pid→rank map (~1k–30k entries).
Port-scan worker thread: one /bin/sh -c 'exec ls …' child per scan, plus the line filter.
Old Linux fast path: an awaited readdir per process plus a readlink per fd on main, ~400–570 ms per scan (author's figure).
Filter cost on the worker (verbatim copy of LinuxSocketHolderFilter, fed 64 KB chunks, run with node 26 on macOS):
Processes
fds
Listing size
Worker CPU
1,000
50k
3.4 MB
25 ms
3,000
300k
20.8 MB
105 ms
30,000
3M
208.8 MB
878 ms
Cost grows linearly. The per-chunk pending += chunk and .slice pattern does not go quadratic.
Price at fleet scale
Reference fleet (~3k processes, ~300k fds): about 3.5 ms/s of worker CPU, off main, plus the ls child. I couldn't measure the child here because I'm on macOS.
10× fleet:ls probably exceeds the 4 s PORT_SCAN_COMMAND_TIMEOUT_MS. The scan then falls back to the old main-thread walk for 9 scans and retries the listing on the 10th. The extra cost is about one wasted 4 s ls every 300 s (~13 ms/s on the child, none on main), next to a 10× main walk that the old code paid on every scan. The 10× scaling cost was already there before this PR.
Listener census (all in src/main/ports/linux-socket-holder-listing.ts, registered by runLinuxSocketHolderListing on the port-scan worker thread, one set per fast-path scan, lifetime = one ls child):
Line
Listener or timer
Rate per scan
Removal
:114
child.once('error')
0 normally
goes with the child
:116
child.stdout.on('data')
once per pipe chunk: ~55 at 3.4 MB, ~320 at 20.8 MB
not removed explicitly; ignored after settle (settled check), freed when the child closes
:121
child.stdout.on('error')
0 normally
goes with the child
:123
child.once('close')
1
fires once
:110
setTimeout 4 s
0 normally
cleared in settle
The child is added to the worker's activeChildren (port-scan-command-execution.ts:35-37) and removed in settle. It is killed on timeout, on error, and at worker exit.
The PR adds no listeners on main or in the renderer.
Existing machinery the PR now uses on Linux:
The worker's port.on('message').
The per-call deadline timer in WorkerThreadRequestQueue (30 s, cleared on reply).
The idle-teardown timer in LazyWorkerThreadHost (5 min, re-armed after each call, cleared by the next).
The global 60 s heap sampler, which now also queries this worker while it is alive.
Idle wakeups
Hidden, after the 5-min teardown: 0 before and after.
After hiding, before teardown: one teardown timer fire, and up to 5 heap-sample queries to the worker.
Visible: main wakes at the same moments as before (scan every 30 s, heap sampler every 60 s). The worker thread is new on Linux and wakes at those same moments. It adds no new timer, poll or IPC source.
Regression classes touched
Class
Disposition
Subprocess per item or event
Disproved: one child per scan whatever the process or fd count; it replaces per-fd main-thread work.
Sync fs on main
Disproved: the only new one is the worker client's single existsSync per lazy worker spawn (baseline 7→8, plus a new entry). That is at most once per visibility cycle of 5 min or more.
Hot-path rescans (per-chunk concat/slice)
Disproved: linear by the numbers above.
New idle wakeups
Disproved as above.
Fixed-cadence poll that never settles
Disproved: no new poll; the retry-every-10th-scan counter rides the existing visible cadence and needs no timer.
Per-entity state outlives the entity
Disproved: activeChildren is cleaned up in settle; scansUntilListingRetry is one number.
The six questions
Work paid before the skip gate: the filter drops non-wanted rows in the worker, so only matches cross threads.
Ownership: one shared lazy worker. A single process-wide singleton makes the call, so no per-row or per-workspace multiplication.
Which thread pays: the ls child and the filter run off main. Main keeps readdir('/proc'), a small clone, and the rank map.
Growth and progress: linear in fds; on failure it retries every 10th scan and falls back to the walk.
Execution host: Linux only; macOS and Windows are untouched. Remote hosts and folder workspaces aren't affected. I did not run anything on Linux.
Obsolete work stops: the timeout kills ls (the exec leaves no orphaned process); worker exit kills active children; hidden windows stop scanning and the worker is torn down after 5 min.
Evidence types
Reproduced: the batch test, and the filter benchmark above.
Source-proven: spawn and listener counts, wakeup timing.
Author-reported, not reproduced: on a ~1,000-process box, 405–567 ms per scan before; 24–58 ms node plus 60–110 ms ls after; identical owners.
Not measured: how ls child CPU and memory grow with fd count, and the Linux worker's resident memory.
Problem: on Linux, the Ports panel's 30 s scan (visible window only) mapped listening sockets to processes by awaiting one readlink per open fd of every process, all on Orca's main process. That cost ~400–1,000 ms of main CPU per scan on a busy machine.
Change: one ls -lnq /proc/[0-9]*/fd runs in the existing port-scan worker (one process, PATH + LC_ALL=C only), filtered line by line there. Owner choice is the same as before (last holder in /proc order). Stop and the localhost label allow-list keep the exact readlink walk. A failed or unreadable listing falls back to the old walk and retries the listing every 10th scan. macOS and Windows unchanged.
Benchmark: head=a2f5d7e7338526c7e0cc3b68089b17649638c011 gate=PASS real scanner on Linux (~1,000 processes, 41 listeners), same box, origin/main → this head: 517–595 ms CPU per scan, all on main → 59–86 ms in Node (incl. the worker-side filter) + 210–230 ms in the ls child (busier box than earlier runs: 24–58 + 60–110 ms); ports and owners identical within each run, one port whose process restarted between the runs.
Fixed during review (8 blinded Codex audits, 8 Claude passes):
A reuse cache was tried and dropped. It couldn't see a socket handed between two running processes, and a stale owner could drop an advertised URL.
A newline-forged path, an over-long line, TIME_STYLE/QUOTING_STYLE, the pipeline leaving ls/awk behind after a timeout, and output growing with every socket on the machine.
The pid-order rule for shared sockets, and a process forked after the /proc listing (CodeRabbit).
Verified:
Final blinded Codex audit: SAFE. Claude review: CLEAN. Fresh perf-scan: clean (comment above).
linux-socket-owners.test.ts (filter, forgery, long lines, owner order).
ls -q forgery check on GNU coreutils 9.12.
pnpm check:changed; remote-check pnpm tc PASS on this head.
Deferred / needs sign-off:
Two blocking-helper ratchet rows rise by one. Both come from the worker client's lazy existsSync, the same path macOS and Windows scans already use.
New on Linux: the port-scan worker thread now runs while scans happen, and retires after 5 idle minutes.
QA: qa=tests. There's no UI change, and the only allowed Linux GUI host can't run our test copies. The benchmark and tests above stand in.
…ation going after the picker closes (#46245)
* feat(bots): inset the avatar description field and keep picture generation going after the picker closes
* fix(bots): an outfit pick is a newer choice than a picture still being generated
Rebased onto main's avatar outfits. An outfit-only pick now notes a choice in the
picture ledger and holds it open until its save is acknowledged, and the host bumps
avatarRevision on an outfit write, so a running Generate can no longer overwrite a
picked outfit. The color and outfit saves share main's useBotLookSave queue.
Also: the Generating tooltip stays controlled, "Close anytime" wraps inside the
tile, a failed Create no longer reopens New bot's picture popover, and Create's
picture handoff is one helper shared by New bot and Import.
* fix(bots): a look picked during a generated upload keeps its mascot, and a lost profile save no longer strands fresh uploads
A color or outfit pick made while a generated picture is uploading now sends the
mascot shown again, so the look wins whichever write the host takes first.
Before its bots are first listed, the host raises any record whose avatar revision is
behind its home's bot.json (a profile that lost its last save). A fresh read then
anchors a new Generate at the real revision, while a request made before the crash
is still refused.
* fix(bots): keep newer picture choices across import and settings
* Remove chat filter from group items (#47851)
* Remove group item chat filter
* Remove retired runtime catalog entries
* Fix phone group item refresh and paging
* Fix phone test array style
* Keep group asks fresh during phone refresh
* Clear departed group member reads
* feat(app-rail): space rail buttons out to a 40px rhythm (#48049)
Rail buttons sat on a tight 32px pitch. A 12px gap puts each 28px button in a
40x40 cell, matching the right activity bar, and the overflow slot follows.
Co-authored-by: m4air <[email protected]>
* fix(agent-permissions): show permission descriptions as tooltips (#42557)
* fix(agent-permissions): show permission descriptions as tooltips
Permission menus rendered a description line under every choice, which made
them tall. Rows are now one line; the description is a hoverable side tooltip
and always the row's accessible description. It renders inline on touch-only
screens, in narrow or zoomed windows, and on rows tapped in a mouse-opened
menu (first tap reveals, second selects). Disabled choices stay focusable so
their description can be read, and one Escape closes the tooltip and menu.
* fix(agent-permissions): comply with primitive style and test gates
* fix(agent-permissions): fit composer picker within zoomed viewport
* fix(agent-permissions): retain inherited permission row primitive
* fix(agent-permissions): constrain settings choices to viewport
* fix(items): read answers and drafts written with the pre-#47963 question line (#48041)
* fix(items): read answers and drafts written with the pre-#47963 question line
* fix(items): prefer this build's question heads before older ones across all questions
* fix(items): a longer old question head keeps its line over a shorter current one
* perf(items): work out each ask's question heads once, and skip head matching for a reply whose label does not end the line
* fix(i18n): translate English terms left in 64 Simplified Chinese strings (#48040)
Replace English terms that were left inside Simplified Chinese values
(Chat UI, API key, API token, issue, merge request, Linear ticket, Agent,
SSH config and 17 one-off terms) with the Chinese term zh.json already
uses for the same thing elsewhere, so one feature no longer has two names
in the Chinese UI. Only catalog values in zh.json change.
Fixes#48042
Co-authored-by: Neil <[email protected]>
* fix(dock): re-check Stop and Retry against the live dock, cancel held presses across a feed drop (#47951)
Follow-up to #47774. Before Stop is sent, including from Retry, it is checked against the live dock: same party, same dispatch, not settled, and stoppable by the same rule the row renders with. Settled retries read "Already stopped". Held mouse, touch and key presses on Stop are cancelled by a feed loss during the press, and each click activates as the press that produced it. Stop and Clear draw an inset focus ring that stays visible at 360px. Focus on the failure line passes to the next line or the dock toggle.
* test: clarify the agent-home guard error and run the reclaim test on Node on macOS (#47538)
Co-authored-by: jiang3ye <[email protected]>
* perf(browser): stream Save to this computer as binary frames so memory stays flat (#48059)
* perf(browser): stream a server download's copy as binary frames with acks
Save to this computer read the file as base64 JSON replies, so desktop
main's heap swung by hundreds of MB of short-lived strings on a big copy.
The host now sends the file as binary frames on the stream's own socket,
from a fixed set of buffers, at most a 2 MiB window ahead of the desktop's
acks; the desktop writes each frame and acks it. Memory no longer depends
on file size, and the copy is about five times faster.
* fix(browser): mark copy frames, refuse odd-sized ones, stop with the server's transport
* fix(browser): give up on a copy whose file stops arriving for a minute
* fix(browser): stop a copy whose file changes in place; finish short reads
* fix(mobile): make item thread comments, description and questions selectable on iOS (#48068)
Item thread comment bodies, the item description and ask question text
rendered MobileMarkdown without rangeSelectable. Inside the OTA shell
(react-native-web), a paragraph Text with selectable=false gets
user-select:none, so a long press did nothing. These call sites now pass
rangeSelectable={INLINE_TEXT_SELECTION}, matching the native-chat
transcript. A native (non-shell) Android render gets false and keeps
main's block selection.
Fixes#48039
* fix(bots): to stay silent a bot writes only NO_REPLY; any other words are its reply (#47962)
* fix(bots): to stay silent a bot writes only NO_REPLY; any other words are its reply
* fix(bots): only a tool that answered whoever waits stands in for the reply; every quiet note names the marker
* fix(bots): a thread request already answered with bot reply needs only the marker; leave the signed-off wait prompt as it was
* fix(bots): item-only silence only when no thread waits, and silence drops a memory's status line
* fix(bots): an item comment's silence also waits for any chat or thread still owed an answer
* fix(bots): a silent turn whose answer stays in Orca may keep one owner note before NO_REPLY
Turns answering a Slack, GitHub, Linear or Discord thread stay exactly NO_REPLY.
* fix(bots): the Home Chat owner note holds only when the turn answers no outside message; mail silence also waits for chat
* feat(shell): app rail destinations fill the whole page (#48045)
* feat(app-rail): rail destinations fill the whole page
With the experimental app rail on, Tasks, Automations, Artifacts, Skills
and Orca Mobile now fill the page beside the rail. The workspace list
collapses to zero width (its rows unmount; the saved open state and
width are never written), while the sidebar root stays in one keyed slot
so its dialogs, an unsaved Workspace details draft and the Workspace
Board keep their state across view switches.
On a rail page the sidebar toggle, Cmd+B, Open Workspace Board and the
Agent Dashboard shortcut return to Workspaces with the list showing,
then act. Settings keeps its current behavior.
Keyboard focus never drops to the page body: a page opened while a list
row had focus, or an overlay that closes back to a removed element,
hands focus to the page once it has loaded, unless something newer took
it. The titlebar controls keep focus when they move between the column
header and the page titlebar.
With the rail off, nothing changes.
* fix(app-rail): keep the hidden workspace list mounted on rail pages
A rail page used to unmount the workspace list rows. That dropped
unsaved edits in the list (the detected setup command, the Rename
group dialog), closed a row's open context menu under keyboard focus,
and made returning to Workspaces revalidate the Smart Sort order and
write it again.
The rows now stay mounted while a rail page hides the list: the list
keeps zero width and is inert and hidden from assistive technology.
Only collapsing the list yourself unmounts the rows, as before. Focus
inside the list when it hides moves into the page once it loads.
* fix(app-rail): keep the hidden workspace list out of keyboard handling
On a rail page the workspace list stays mounted but hidden, and two
keyboard paths still reached it:
- Its global shortcuts (focus worktree list, next/previous workspace,
collapse all projects) acted on the hidden rows, for example unfolding
Projects while Tasks stayed on screen. They now do nothing while a
rail page hides the list, and still work on Workspaces.
- Escape from a nested context-menu item (Copy > Path) left focus on the
page body, because the submenu is portaled apart from its menu. A
close now also counts when the last focused element left the DOM, so
focus moves into the page as it does for top-level items.
* fix(app-rail): recover focus only from a menu or dialog that owned it
Focus recovery on a rail page treated any focused element that had left
the page as stranded by the next overlay close. Clicking a control
outside an open, nonmodal menu could focus that control and remove it
before the menu reported its close, and focus then jumped into the
page.
Recovery now records which menus and dialogs own focus whenever focus
moves, including the parent menu of a portaled submenu, and acts on a
close only when the closing one owned it.
* fix(connectors): a bot's words before a trailing NO_REPLY post in every Slack conversation (#47896)
* perf(ipc): build the desktop runtime RPC registry once instead of per call (#47917)
* Check agent CLI updates after launch settles, a few at a time (#47923)
* perf(agent-cli-update): defer the startup CLI check and run at most three --version probes at once
* fix(agent-cli-update): give the update check a budget that covers queued version probes
* fix(agent-cli-update): cover the worst-case probe queue and let a failed check retry
* fix(i18n): translate 48 missing Korean strings for team-managed updates, plugins, and settings (#48053)
Korean users saw English in the team-required update card and restart
dialog, the install-on-quit prompt, required-plugin warnings, the plugin
catalog's team labels, the Orca account console row, and the settings
that a team turns off (Relay, Computer Use, artifacts, development
folders, bots). These keys existed in en.json but not in ko.json.
Each value is inserted after its preceding en.json sibling so the diff
is additions only, and every value keeps the English placeholder set.
A theme port uses 포팅 버전 so it does not read as a network port (포트),
and botsOffByTeam uses 이 실행 to match its botsOff and botPaused siblings.
Fixes#48054
Co-authored-by: Neil <[email protected]>
* Move the Linux port scan's per-file process lookup off Orca's main process (#47943)
* perf(ports): skip the Linux /proc fd walk when listening sockets are unchanged
The 30 s workspace port scan read every fd link of every process on the
machine to map listening sockets to pids. Reuse the last map while the set
of listening inodes and each owner's start time are unchanged; ownership
checks that authorize a kill still walk fresh.
* fix(ports): bound the Linux socket-owner cache to 10 scans and require our own sockets mapped
A socket handed to a child while its parent lives, or a root socket later
inherited by a user process, kept its inode and the cached owner. Walk again at
least every 10th scan and whenever one of our own sockets has no owner.
* fix(ports): revalidate cached Linux socket owners instead of trusting a live pid
A supervisor that handed its socket to a child and closed its copy stayed the
cached owner, so the port showed as external and its advertised URL was
dropped. On reuse, check that each cached owner still holds its socket and walk
processes started since the last walk, keeping the full walk's last-holder rule;
walk everything again after 10 scans or 5 minutes.
* perf(ports): list Linux socket owners with one ls in the port-scan worker
Replace the reuse cache with exact full-walk semantics: one ls -ln /proc/*/fd
in the port-scan worker lists every socket holder, and the owner is the last
holder in /proc's listing order, as the node walk picked. Falls back to the node
walk if the command fails.
* fix(ports): fall back to the node walk when the socket listing has no holders
* fix(ports): print only wanted socket holders from the Linux listing
Printing every socket fd could pass the worker's 2 MiB output limit on a large
machine, failing every scan into the main-thread walk. awk now prints only the
listener inodes plus a count of well-formed socket lines, which tells an
unreadable ls layout apart from listeners Orca can't see; holder lines must end
in ' -> socket:[N]'.
* fix(ports): retry a failed Linux socket listing every 10th scan instead of every scan
* fix(ports): keep the exact readlink walk for Linux kill and allow-list ownership checks
* fix(ports): stream one ls process through a worker-side filter for Linux socket owners
The sh | ls | awk pipeline left ls and awk running when a timeout or quit killed
sh, and awk's list search grew with sockets x listeners. The worker now execs a
single ls (LC_ALL=C), tracks it with the other scan children, and filters rows
line by line with a Set: only exact 11-field 'fd -> socket:[N]' rows count.
* fix(ports): run the Linux socket listing with only PATH and drop just an over-long line
TIME_STYLE or QUOTING_STYLE in Orca's environment changed ls's layout and
disabled the listing; an over-long path line split across chunks cleared the
current pid and lost that process's later sockets.
* fix(ports): list Linux fds with ls -q so a path with newlines can't forge a holder row
* fix(ports): ignore Linux socket holders that the /proc listing never saw
* fix(i18n): translate 64 missing Korean strings for skills, settings, the status bar, and the activity bar (#48057)
Add Korean translations for keys that were missing from ko.json, covering
skill replace/backup notices, shared Codex servers settings, usage status
bar rows, the activity bar reorder controls, and other recently added UI
strings, so Korean users no longer see English fallbacks there. Also add
the missing _one plural forms for counts.
Co-authored-by: Neil <[email protected]>
* Keep workspace deletion review at a stable size (#48065)
* Keep workspace deletion review at a stable size
* Animate workspace deletion file details
* Preserve disclosure panel links while collapsed
* fix(i18n): translate 36 missing Korean strings for browser cookies, server downloads, and port forwarding (#48055)
Korean users saw English in Settings > Browser's "Clear cookies" row and
its confirmation dialog, the download and print notices of pages
streamed from a paired server, browser-tab open failures, the paired
server port-forward toasts, the SSH session-host detail, and the
terminal link popover's refusal message. These keys existed in en.json
but not in ko.json, so i18next fell back to English.
Each value is inserted after its preceding en.json sibling and keeps the
English placeholder set. The SSH port-forward toast names the Ports
panel ("포트 패널") so it points to where forwarding is done.
Fixes#48056
Co-authored-by: Neil <[email protected]>
* fix(codex): never write a WSL distro's Codex config; regenerate the managed copy from it (#45247)
* fix(codex): never write a WSL distro's Codex config; regenerate the managed copy from it
* fix(codex): treat mapped-drive and drvfs distro configs as the distro's, write the baseline atomically, and recover a held config before the history pass
* fix(codex): recognize the extended spelling of a mapped distro drive, and leave the baseline and history writers as on main
* chore: drop an unrelated lockfile change
* test(codex): an unchanged WSL regeneration leaves the managed config untouched
* fix(codex): drop a held-back conflict for a ~/.codex linked or mapped into a distro
* fix(codex): skip the promotion write when a linked ~/.codex folder can't be resolved
* fix(cli): save downloads beside an older file of the same name instead of refusing (#48067)
* fix(cli): save downloads without --out next to, not instead of, an older file of the same name
* fix(cli): name a nameless or path-like download by its id, without Windows-dropped trailing dots
* fix(codex): summarize every file of one multi-file apply_patch in native chat (#48038)
A completed Codex fileChange that touched several files was saved as one
headerless join under a "N files" path, and the client refused to name any
file from a count, so the turn showed no changed-files summary.
Each file of a multi-file change now gets its own diff --git section
(whole-file hunks for add/delete, rename destinations kept). The Diff call
carries body.paths, and a "N files" patch is summarized only when it arrives
whole with exactly N git-headed sections whose paths match. Larger patches,
header-unsafe names and older journals keep the raw "Edited N files" row.
Refs #48025
Co-authored-by: Neil <[email protected]>
Co-authored-by: bbingz <[email protected]>
* feat(checks): show skeletons while checks and comments load (#47812)
Show layout-matched placeholders on the first checks and comments reads. Keep loaded results visible during refresh, distinguish unread from empty, and respect reduced motion.
* feat(app-rail): tighten rail button gap to 10px (#48084)
Keep the overflow slot height in step (28px button + 10px gap).
Co-authored-by: m4air <[email protected]>
* perf(bots): keep settled linked workers' reads between item views (#47911)
* perf(bots): keep settled linked workers' reads between item views
Item views and the usage-limit pass re-walked every linked Dispatch's
lineage on the main thread each read. Settled workers' reads are now kept
and dropped by the orchestration database's own row notices for any
Dispatch the walk read, so a refresh reads only running workers and
lineages written since.
* perf(bots): index a lineage's kept reads once, not per linked ref
* fix(bots): never keep a linked worker read whose Task or follow-ups couldn't be read
* perf(bots): keep only short reports with kept linked-worker reads
* fix(bots): batch insert lookups, copy kept values, and re-read hits a write dropped mid-read
* fix(bots): one status snapshot per linked-worker read, a report budget, and drops on another connection's writes
* fix(bots): keep only linked workers off a live pane, cap kept reports, and catch mid-read follow-ups
* perf(bots): validate kept linked workers with one fingerprint read per pass instead of tracking row events
* perf(bots): budget kept linked-worker reports, not entries, and skip long worker reads
* perf(bots): skip the fingerprint read when no write has landed since the last check
* fix(bots): drop a kept linked worker on its own Dispatch's notice, and check for writes after the fingerprint read
* fix(bots): drop kept linked workers on a deletion, copy reports only within the budget, and show reports written during a read
* fix(bots): re-read kept linked workers dropped during a read, keep finished workers after the reply, and allow long worktree paths
* fix(bots): drop kept linked workers on another connection's commit, and never restore one a failed re-read dropped
* fix(bots): re-check kept linked workers after each recovery read, not once
* fix(bots): re-check kept linked workers after a read awaits, keep only after the reply, and bound pending reports
* fix(bots): keep only plain follow-up chains, re-read a whole batch a write changed, and queue kept workers once
* fix(bots): re-check kept linked workers by fingerprint before a read replies, and never throw while keeping
* perf(bots): skip long terminal histories unparsed, and take keep slices off the queue's iterator
* fix(bots): read the database version once per linked-worker check
* fix(bots): check a linked-worker reply against the stamp its kept workers were checked at
* Preserve avatar choices across generation and repair revisions per bot
* Restored browser tabs load after a restart when an extension is installed (#47262)
* fix(browser): restored tabs wait for the profile's extensions before their first load
* fix(browser): a navigation during the held first load keeps the restored back list
* fix(browser): hold navigations made during the first-load wait and replay the newest
* fix(browser): keep the held page loading after its stop; restore only onto an empty page
* fix(browser): queue loads asked for during the first-load wait instead of stopping them
* fix(browser): keep a queued load's request options; reject it when the page closes
* fix(browser): replay any queued load with options directly
* fix(browser): a held page always waits until its profile's extensions are in the session
* fix(browser): closing a held page ends its hold and settles queued loads
* fix(browser): a navigation started outside loadURL during the hold still supersedes it
* test(browser): a held first load starts nothing until ready; move it to its own module
* test(browser): settle before the negative check; cover the load-ended fallback
* fix(browser): record startup extension ids at attach, so page-start needs no session registry import
* test(browser): note why the fake page and session casts are sound
* fix(browser): bound the in-session wait; a held load's deadline counts from its release
* fix(browser): one presence listener per profile, ended by the give-up; Stop cancels a held load
* fix(browser): the desktop attach passes the extension wait in, so the orcad bundle doesn't pull in extension code
* fix(browser): Stop ends the hold and stops real loads; failed extension loads end the wait; keep only a wait that gave up
* fix(browser): Stop with nothing loading settles the page load; later waits skip failed extensions; a wait is shared per profile attach
* perf(browser): every startup load's end, skipped or cancelled too, ends the page wait; keyed startup set
* fix(browser): Stop on a held restore keeps its history; a cancelled route initialization stops waiting for extensions
* perf(browser): a page's extension wait ends when the page closes; goto reports the closed tab
* fix(browser): don't hold a route page's blank bootstrap, which must finish within its mount deadline
* fix(browser): route navigations wait for extensions too; the attach's load deadline counts from attach again
* fix(browser): a route navigation rechecks live authority after waiting for extensions
* perf(browser): a cancelled route navigation stops waiting for extensions and doesn't load
* fix(browser): loads after Stop still wait for extensions; an overtaken route navigation doesn't load
* fix(browser): after Stop the saved history goes back only once ready; a waiting route navigation yields to a newer one
* refactor(browser): defer a page's guest until its profile's extensions are ready, instead of holding its first load
As a browser restores tabs only after the profile's extensions load: desktop tabs get their attach
marker, and This-device pages mount, only once the page's session has started its extensions. The
first-load hold on an attached guest (loadURL/stop overrides, queued loads, Stop and history
handling, route navigation waits) is removed.
* fix(browser): a waiting tab attaches after a remount, shows loading, keeps an address entered meanwhile; registration waits extend only on timeout; a failed This-device creation releases its extensions
* fix(browser): registration waits cover a wait that ended in their window and keep listening; closing a waking page cancels its wake; the newest address wins; Stop is a no-op while waiting
* fix(browser): cap the extension wait at 5 s, inside the deadlines around page creation; a page opened at the cap loads again once if its first load stalled; a closed waiting tab doesn't re-prepare
* fix(browser): the late-start retry keeps only live pages, yields to Stop and newer navigations, and is desktop-only; Stop during the wait keeps the page closed until Reload
* fix(browser): the late retry ends once the extensions are in the session and reloads a restored entry; Stop's marker yields to Reload or a new address
* perf(browser): no partition lookup with extensions off or for attached profiles; a refused This-device mount releases its extensions; any Reload undoes a waiting Stop; Stop-then-type reuses the deferred attach
* fix(browser): trim to the desktop defer: no Stop state while waiting, This-device keeps main's 3 s wait at navigation, and only restoring tabs load again
* fix(browser): a restoring tab loads again only if an extension loaded while its first request was in flight; no validation or Stop while a tab waits
* fix(browser): This-device blank first pages wait for extensions again (at most 3 s, as on main); no extra loading update before a tab's page exists
* fix(browser): retry only after the load that resets a session's loaders; an address typed during the wait opens without a second wait; partition lookup by index
* perf(browser): the late-retry extension listener is on only while a page still waits on it
* perf(browser): a routed page's session finds its source profile by its route, without scanning saved profiles
* refactor(browser): drop the one-time retry past the extension wait's bound; a stalled page keeps the existing notice and manual reload
* perf(browser): the extension presence observer ends with the startup load or the wait's bound
* Regenerate the avatar RPC parameter catalog
* Give New bot picture arrows room and keep the Generate draft (#47173)
Static analysis fails only on browser-session-registry.ts (301 lines), which already fails on main since #47262 and isn't touched by this PR. CI otherwise green; code review and UX-I passed on this head.
* Recover damaged avatar histories without blocking other bots
* Use the reviewed bot picture recovery messages
* Keep pristine bot manifests compatible with earlier homes
* Reject repaired picture histories missing their revision
---------
Co-authored-by: orca-remote-automation[bot] <359726236+orca-remote-automation[bot]@users.noreply.github.com>
Co-authored-by: m4air <[email protected]>
Co-authored-by: Jinwoo Hong <[email protected]>
Co-authored-by: Yohan <[email protected]>
Co-authored-by: Neil <[email protected]>
Co-authored-by: jiang3ye <[email protected]>
Co-authored-by: Kelvin Amoaba <[email protected]>
Co-authored-by: Neil <[email protected]>
Co-authored-by: Brennan Benson <[email protected]>
Co-authored-by: 2SinceJuly <[email protected]>
Co-authored-by: bbingz <[email protected]>
decrypted
added a commit
to decrypted/orca
that referenced
this pull request
Nov 24, 2026
Retires fix/linux-port-scan-inode-cache (#1): upstream stablyai#47943
moved the Linux socket-owner lookup off the main process (one ls in the
port-scan worker), which covers what #1 was for.
#2 follows upstream stablyai#47994's forward owners (SSH or paired server) in the
detection-off panel; its one-off scan guard moved into the store's
replaceWorkspacePortScans (workspace-port-actions.ts hit max-lines).
#4 routes the new BotItemReplyJump reveal through the Reduce motion helper.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
While Orca's window is open, it checks every 30 seconds which local servers are running so it can show them in the Ports panel. On Linux, Orca did that by looking through every open file of every program itself, which kept its main process busy for most of a second each time. Now one small system command does the same look, outside Orca's main process, and gives the same answer.
What Changed
ls -ln /proc/[0-9]*/fd(LC_ALL=C, one argument per process), and filters its output line by line. It keeps only the holders of the listening sockets being looked up and counts every well-formedfd -> socket:[N]row. Electron main no longer awaits onereadlinkper open fd on the machine./procitself, and when several processes hold a socket it keeps the one that comes last in that listing, exactly as the old walk did.readlink), becauselsprints raw paths.Why
The old walk ran on Electron main and cost one async
readlinkper open fd on the machine: 405–1,010 ms of main-process CPU per scan on a ~900–1,100-process Linux box, every 30 s while the window is visible.With the change, the same box spends 32–58 ms in Node (including the filter, which runs in the worker in the app) plus 90–110 ms in the
lschild, about 3× less CPU overall and almost none of it on main, with identical ports and owners. Other editors detect Linux ports the same way, with one directory listing in a child process rather than a per-fd walk inside the app.Caching owners between scans was tried first and dropped. A socket handed between two running processes can't be seen without a full look, and a stale owner can drop a workspace's advertised URL.
Visual Proof
N/A: no UI change; the Ports panel shows the same rows.
Testing
Ran the real scanner on Linux (commands and worker code executed for real), same box, before and after: before 405–567 ms CPU per scan; after 32–58 ms Node plus 90–110 ms in
ls; ports and owners identical on every scan. Earlier sessions on a busier box: before up to 1,010 ms. Timed listers alone:ls -ln70–100 ms,find -printf40–50 ms,ss -ltnp30–40 ms.lswas kept because busybox systems have it andfind -printf/ssmay be missing.linux-socket-owners.test.tsfeeds anls -lnlisting through the worker's filter in small chunks. It checks that only wanted holders are kept, that look-alike rows (a file namedx -> socket:[N], extra fields) are ignored, and that the owner is the last holder in/procorder (not text or numeric order). It also checks that an unreadable layout is told apart from no wanted holders.pnpm check:changedpasses.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Performance
Less work, almost all of it off Electron main: the Linux 30 s visible-window port scan drops from ~400–1,000 ms of main CPU to a
/proclisting plus a short parse on main, and total CPU drops about 3×. New cost: on Linux the existing port-scan worker thread now starts with the first scan and retires after 5 idle minutes, as it already does on macOS and Windows. No new timers, polls or IPC.The blocking-helper ratchet rows for the scanner and
linux-socket-owners.tsrise by one. Both come from the worker client's singleexistsSyncwhen it lazily starts the worker, the same path the macOS and Windows scans already take.Risk
Level: Low
The riskiest part is reading
ls -lnoutput. Only exact 11-fieldfd -> socket:[N]rows count. A listing with no such rows, an error or a timeout falls back to the old walk, so an unexpectedlscosts CPU, not attribution. A process that can open files with newlines in their names could still forge a row in the Ports panel. Stop and the allow-list don't use the listing, so it can't redirect a kill. Back out with a plain revert.AI Disclosure
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Remote Linux hosts run the same scanner and benefit the same way.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)