Skip to content

feat(ports): add a setting to turn off port detection - #2

Open
decrypted wants to merge 6 commits into
mainfrom
feat/port-detection-setting
Open

decrypted wants to merge 6 commits into
mainfrom
feat/port-detection-setting

Conversation

@decrypted

@decrypted decrypted commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

What

New Settings → Advanced → Background activity group with a Detect ports switch (portDetectionEnabled, default on).

When off:

  • WorkspacePortScanner runs no scans, local or remote: no 30 s interval, no visibility or focus listeners, no advertised-URL listener. Results are cleared from the store.
  • The status bar Ports item and its entry in the visibility menu are hidden.
  • The right-sidebar Ports panel shows "Port detection is off" with a button to turn it back on.
  • The browser new-tab page doesn't start its own scan.

Turning it back on scans every host at once, then continues at the normal cadence.

Why

The 30 s port scan was the largest periodic cost left in the main process on Linux (see #1). Users who don't use the Ports UI had no way to turn it off; hiding the status bar item didn't stop the scanning.

Testing

  • oxlint, oxfmt, pnpm tc, localization checks and tests on box: ports, status bar, settings, browser new-tab, shared/workspace, loading-store.
  • Performance review: with the setting off, nothing periodic runs for ports. With it on, the cadence is unchanged from upstream, and toggling never duplicates a timer.

Risk

Low. Default on = upstream behaviour.

  • Direct SSH hosts' "Detected" ports come from the relay and stay as they are, because that panel also manages port forwards.
  • Localhost worktree labels don't resolve while detection is off.

🤖 Generated with Claude Code

Files Added Deleted Net
Test 0 0 0 0
Prod 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​234 $\color{#cf222e}{\Huge{\mathbf{−}}}$​15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​219

@decrypted
decrypted force-pushed the feat/port-detection-setting branch 2 times, most recently from f714b3b to 14f67a6 Compare November 18, 2026 08:42
decrypted added a commit that referenced this pull request Nov 18, 2026
Upstream 8abbc91..2f5abbc (245 commits). Branches rebased onto it:
fix/linux-port-scan-inode-cache (#1; now on upstream's linux-proc-net-listeners
parser, which gained a uid field), feat/port-detection-setting (#2),
feat/remote-autoconnect-setting (#3), feat/reduce-motion-setting (#4),
feat/keep-awake-timed (#5), feat/sleep-project-and-group (#6),
feat/project-group-filter (#7; group hider composed over upstream's
folder-nested exemption), fix/worktree-create-missing-base-hint (#8), ci/fork-build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@decrypted
decrypted force-pushed the feat/port-detection-setting branch from 14f67a6 to 098b448 Compare November 19, 2026 08:18
decrypted added a commit that referenced this pull request Nov 19, 2026
Upstream 2f5abbc..7bc705a (345 commits). Branches rebased onto it:
#1 fix/linux-port-scan-inode-cache, #2 feat/port-detection-setting, #3 feat/remote-autoconnect-setting,
#4 feat/reduce-motion-setting, #5 feat/keep-awake-timed, #6 feat/sleep-project-and-group,
#7 feat/project-group-filter, #8 fix/worktree-create-missing-base-hint; plus ci/fork-build.

- #2: upstream stablyai#43836 took the refreshing flag away from the background scanner; the
  detection-off reset no longer clears it.
- #4: upstream's HoverScrollText and the composer glow use the motion-safe / motion-reduce
  variants; the bot activity list scrolls with motionSafeScrollBehavior.
- #7: kept upstream's bot-listed workspace exclusion next to the project-group scope.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@decrypted
decrypted force-pushed the feat/port-detection-setting branch 3 times, most recently from 4cc6ddd to c7554ae Compare November 24, 2026 08:13
decrypted added a commit 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.
@decrypted
decrypted force-pushed the feat/port-detection-setting branch from c7554ae to 3b0811f Compare November 25, 2026 08:11
decrypted added a commit that referenced this pull request Nov 25, 2026
Rebase conflicts were sibling additions only: locale blocks (#2 en.json,
#5 tr.json), main.css next to upstream's forced-colors plugin icon rule (#4),
and #3's launch hold next to upstream's retireStateOfRemovedEnvironments.
#4 keeps routing BotItemReplyJump through readPrefersReducedMotion().

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@decrypted
decrypted force-pushed the feat/port-detection-setting branch from 3b0811f to e76327e Compare November 26, 2026 08:08
decrypted added a commit that referenced this pull request Nov 26, 2026
Upstream 2bd7ae3 -> 0fce80c (284 commits). Drops the stablyai#48819 carry
(fix/upstream-48819-mcp-sdk-bundle): upstream merged it as 346447d.

- #4: native-chat-markdown.css word fade split upstream (color vs
  opacity), Reduce motion guard on both rules; BotItemReplyJump.tsx
  removed by upstream's revert of stablyai#48081, our edit dropped; new raw
  prefers-reduced-motion block in terminal.css moved onto motion-reduce.
- #2 en.json sibling union; global-settings-base.ts import union (#2/#3
  vs #4).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@decrypted
decrypted force-pushed the feat/port-detection-setting branch from e76327e to 943cb05 Compare November 27, 2026 08:13
decrypted added a commit that referenced this pull request Nov 27, 2026
Upstream 0fce80c..a788fad (404 commits). Conflicts: lazyZodSchema
wrapping (#2, #7), main.css spinner rule (#4), ko/ru locales (#5);
#4's pane-title fade fix dropped (upstream removed that block), outage
nudge moved onto motion-reduce. Fork CI: Azure apt mirror for the
node-pty floor smoke.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
decrypted and others added 6 commits November 30, 2026 11:52
Orca scans listening ports on every execution host (local and remote
runtimes) every 30 s while the window is visible, and hiding the status
bar Ports item does not stop it. Users who do not need the Ports UI had
no way to stop the background scans or the remote RPCs they cause.

Add `portDetectionEnabled` (default on) in a new "Background activity"
group in Settings > Advanced, built to hold more background rows.
When off:
- WorkspacePortScanner stops all scans and clears published results
  so no stale ports stay on screen; turning it back on scans at once
- the status bar Ports item and its visibility menu entry are hidden
- the Ports panel shows "Port detection is off" with a button to turn
  it back on (managed-server SSH forwards stay listed)
- the browser new-tab page no longer triggers its own scan

Direct SSH hosts keep their relay-pushed detected ports and forwards UI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
isPortDetectionEnabled() treats an absent value as on, so the explicit
default added nothing but a line to default-global-settings.ts, which
other settings branches push over its max-lines limit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The background scanner ignores its own late results, but one-off
refreshes (new browser tab, status bar refresh, Ports panel, the rescan
after Stop) published whatever they got back. A scan in flight when
detection was turned off put its ports back on worktree cards, the jump
palette and localhost link labels, and they stayed there.

replaceWorkspacePortScans, the store action every scan result is
published through, now keeps the state as it is while detection is off.
Clearing goes through setWorkspacePortScan(null) and is not affected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only this window's renderer checked portDetectionEnabled, so the
machine kept scanning whenever a paired web client (every 30 s),
another desktop using it as its Orca server, or any other runtime
client asked.

The workspacePorts.scan and workspacePorts.scanHost runtime methods and
the workspacePorts:scan IPC handler now read this computer's own
setting and, when it is off, return an unavailable scan with the reason
"Port detection is off on this computer.", which existing clients
already show in the Ports panel and status bar.

`orca ports` stays an explicit command: it passes
ignorePortDetectionSetting on scanHost and still scans. Older runtimes
drop the unknown param.

The setting's description now says detection stops for connected
clients too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Settings > Browser: "Localhost worktree labels" is disabled and says
  it needs port detection, since labels attach only to detected ports
- Sidebar "Show properties" and "Card display" hide Ports; the saved
  choice is kept and returns when detection is turned back on
- Browser new tab: the empty state no longer promises dev servers and
  offers the same "Turn on port detection" button as the Ports panel
- PortsPanel: correct the comment, direct SSH has no port detection

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Upstream moved the SSH forward dialog out of SshForwardedPortsSection into
the panels that render it (stablyai#43733). The detection-off view renders the
section on its own, so it now owns the dialog state too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@decrypted
decrypted force-pushed the feat/port-detection-setting branch from 943cb05 to 9da53f1 Compare November 30, 2026 11:09
decrypted pushed a commit that referenced this pull request Nov 30, 2026
…e share a name (stablyai#52701)

Check runs were keyed by suite and name, so two same-named runs in one
suite shared one saved row. Every poll one of them carried a different run
id than the saved row and read as a rerun, posting a new "CI green" line
for the same head. Sort observed runs by run id and suffix repeated names
(#2, #3) so each run keeps its own row and an unchanged read compares equal.

Fixes stablyai#52700

Co-authored-by: Neil <[email protected]>
decrypted added a commit that referenced this pull request Nov 30, 2026
Upstream a788fad..9fa1d98 (1236 commits). Branches: #2 port detection,
#3 remote auto-connect, #4 reduce motion, #5 keep-awake (squashed to one commit), #6 project sleep,
#7 project-group filter, #8 base-branch hint, #9 mouse history buttons (new in local/build), ci/fork-build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant