Skip to content

fix: show named Node services in Live Ports - #19131

Open
ParableTyler wants to merge 2 commits into
stablyai:mainfrom
ParableTyler:fix/named-node-port-labels
Open

ParableTyler wants to merge 2 commits into
stablyai:mainfrom
ParableTyler:fix/named-node-port-labels

Conversation

@ParableTyler

@ParableTyler ParableTyler commented Sep 6, 2026 •

Copy link
Copy Markdown

ELI5

When several Node services are running, Live Ports should say web-app or docs instead of calling every service node. This uses the name the service already gives itself.

What Changed

  • Prefer an existing short, single-identifier process title for generic node listeners.
  • Keep the executable name for arguments, paths, missing/long titles, and the reserved Electron label.
  • Add 22 regression cases. No extra process scans or API fields.

Why

On macOS, lsof reports node even when node --title=web-app changes the title returned by ps. Orca already collects that title as commandLine, but drops it from the displayed label. This fixes the projection without parsing or displaying arbitrary command lines.

Linked Issue

Fixes #19129

Visual Proof

Actual Orca Electron builds, three real Node HTTP listeners, isolated macOS workspace. Same ports before/after; the third server deliberately has no title. Captured through CDP with all windows hidden.

Theme Before After
Light Before, light After, light
Dark Before, dark After, dark

Testing

  • I manually tested these changes locally — agent-driven Electron/CDP smoke check on macOS ARM64.
  • Automated tests added/updated.

Passed with ORCA_BACKGROUND_LAUNCH=1:

  • Focused Vitest run: src/main/ports and src/main/ssh/ssh-port-scanner.test.ts — 157 tests, 10 files.
  • pnpm typecheck
  • pnpm run check:code-quality:changed -- origin/main
  • pnpm run build:electron-vite and the --mode e2e variant.

Linux, Windows, and live SSH were not manually tested. Full-repository lint/test and the native packaging build are left to CI.

AI Disclosure

Implementation, tests, local verification, and self-review used OpenAI Codex via pi (model ID: gpt-6-astra).

Review

  • Compatibility: native scanning and direct SSH relay behavior are unchanged. Workspace ownership remains shared with folder workspaces. Existing clients accept the same optional string field; no protocol change. Agent, integration, Git-provider, and mobile-specific code is untouched.
  • Security: rejects whitespace, paths, arguments, and control characters. Preserves the Electron stop-button sentinel and existing PID/ownership routing.
  • Performance/UI: bounded checks on already-collected metadata; no new subprocesses. Existing layout and tooltips, verified in both themes.

Agent skill upstream boundary

  • Not applicable; no agent-skill changes.

Notes

Only service labels change. Titles must be 1–64 ASCII letters/digits/dots/underscores/hyphens and start with a letter or digit.

Author: @ParableTyler. X/Twitter: @TylerMills.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots attached
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • Full pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass — local checks above; full CI pending

@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: fce84da8-1789-497a-a0dc-952034bd2e46

📥 Commits

Reviewing files that changed from the base of the PR and between a9167a7 and a83429d.

📒 Files selected for processing (1)
  • src/main/ports/local-workspace-port-attribution.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/ports/local-workspace-port-attribution.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

enrichPort now uses eligible Node command-line titles as process labels. It preserves Electron and falls back to the scanned process name for invalid titles. New parameterized tests cover valid, invalid, empty, long, path-based, flagged, whitespace, null-byte, multi-word, and executable-name inputs. The tests also verify unchanged raw probes, enriched port fields, and workspace lookup arguments.

Merge Risk: ⚪ Minimal · up to a8342

The change updates macOS Node Live Ports labels while retaining fallback behavior for unsupported titles. No current merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: displaying names for Node services in Live Ports.
Description check ✅ Passed The description follows the required template and includes the change, rationale, linked issue, visual proof, testing, AI disclosure, compatibility notes, and checklist status.
Linked Issues check ✅ Passed The implementation addresses issue #19129 by using safe short titles for generic Node listeners while preserving existing labels for invalid or missing titles and avoiding extra scans.
Out of Scope Changes check ✅ Passed The changes are limited to the requested label projection and focused regression tests. No unrelated code or behavior changes are identified.
  • Fix all pre-merge checks with AI

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Prefer short Node titles as Live Ports labels — enrichPort now projects port.commandLine into processName for generic node listeners when it is a single, identifier-shaped token ([a-zA-Z0-9][a-zA-Z0-9._-]*, ≤64 chars), while rejecting paths, arguments, whitespace/control characters, and the reserved Electron stop-button sentinel.
  • Regression coverage — a new 22-case it.each table asserts exact output processName for title adoption, sentinel preservation, length/charset rejection, and input immutability.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

This branch has not been deployed

No deployments
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.

[Bug]: Named Node services appear as node in Live Ports on macOS

1 participant