Skip to content

Fix/remote skill install floating terminal - #6816

Merged
Jinwoo-H merged 3 commits into
stablyai:mainfrom
vladmesh:fix/remote-skill-install-floating-terminal
Jun 30, 2026
Merged

Jinwoo-H merged 3 commits into
stablyai:mainfrom
vladmesh:fix/remote-skill-install-floating-terminal

Conversation

@vladmesh

@vladmesh vladmesh commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #6789 — installing a skill from Settings fails with selector_not_found when the client is connected to a remote orca serve.

Cause. Inline setup terminals (skill installers, feature tips) open a PTY under a synthetic per-panel worktree id. On a remote runtime the PTY transport forwarded it as id: to terminal.create; the runtime has no such worktree, so it returns selector_not_found. Locally it worked only because the IPC spawn uses cwd directly — a local-only assumption leaking into remote mode.

Fix (client-side only). These are ephemeral floating terminals with no backing worktree. We brand their id and resolve it — for the runtime selector only — to the existing sentinel id:global-floating-terminal, which every runtime already maps to the home dir. Local tab identity keeps the per-panel id. The server is unchanged. Single resolution point, so all setup terminals benefit.

Files (+116/−4): src/shared/ephemeral-setup-terminal-worktree-id.ts (new — brand + predicate), OnboardingInlineCommandTerminal.tsx (brands the id), runtime-worktree-selector.ts (toRuntimeTerminalWorktreeSelector → sentinel), remote-runtime-pty-transport.ts (uses it), plus 3 test files.

ScreenshotsNo visual/layout change — before/after of the syversation). Before (#6789): setup terminal neveropens, selector_not_found toast. After: terminaltime (dev@5uoc:~$). The still-Missing coveragebadges are an unrelated skill-discovery issue, o
Testing
- [x] pnpm lint- [x] pnpm typecheck- [x] pnpm test

AI Review Report

Reviewed with an AI agent across the required di

  • Cross-platform (macOS/Linux/Windows): change igic — no keyboard shortcuts, UI labels,
    filesystem paths, shell invocation, or Electron haves identically on all three.
  • SSH/remote/local: this is the fix itself — remselector; local (IPC/cwd) path is untouched and
    still works.
  • Agent/integration/git-provider compat: setup t no agent-, integration-, or provider-specific
    assumptions added.
  • Performance: O(1) prefix check on terminal cre
  • UI quality: no visual change.
  • Security: see below.
    global-floating-terminal is a pre-existing runti contract. Local tab isolation preserved and
    test-covered.

Security Audit
No new input handling, command execution, path hdency, or IPC surface. The change narrows a known synthetic id to a fixed home-dir sentinel — it cktree a terminal targets. No follow-up needed.

Attachments

Screenshot from 2026-06-30 02-33-20 Screenshot from 2026-06-30 02-32-42

Before and after

vladmesh added 2 commits June 30, 2026 02:52
…selector (stablyai#6789)

Inline setup/onboarding terminals (skill installers, feature tips) create a
PTY under a synthetic per-panel worktree id. On a remote runtime the remote
PTY transport sent that id as `id:<panel>` to `terminal.create`, which the
runtime cannot resolve, so installing a skill via Settings failed with
selector_not_found. Locally it worked because the IPC spawn uses cwd directly
and never resolves the selector.

These terminals are ephemeral floating terminals with no backing worktree, so
brand their id and resolve it to the floating-terminal selector
(global-floating-terminal), which every runtime already maps to the home dir.
Local tab isolation keeps the distinct per-panel id; only the runtime terminal
selector changes. The server is unchanged.
@coderabbitai

coderabbitai Bot commented Jun 30, 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: Pro

Run ID: fb41b7c0-e066-4360-9600-e4acba475af2

📥 Commits

Reviewing files that changed from the base of the PR and between b3181e8 and 3c9c58f.

📒 Files selected for processing (4)
  • src/renderer/src/components/onboarding/OnboardingInlineCommandTerminal.tsx
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/renderer/src/runtime/runtime-worktree-selector.ts
  • src/shared/ephemeral-setup-terminal-worktree-id.ts
✅ Files skipped from review due to trivial changes (1)
  • src/renderer/src/runtime/runtime-worktree-selector.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/renderer/src/components/onboarding/OnboardingInlineCommandTerminal.tsx
  • src/shared/ephemeral-setup-terminal-worktree-id.ts

📝 Walkthrough

Walkthrough

A new shared module defines a prefix constant plus helpers to brand and पहचान ephemeral setup terminal worktree IDs. A runtime selector now maps ephemeral terminal IDs to the global floating terminal selector, and the PTY transport uses that selector when creating terminals. The onboarding inline command terminal brands its incoming worktree ID before use. Tests were added for the shared helpers, selector mapping, transport behavior, and onboarding-related selection logic.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR fixes the remote selector_not_found path, but it does not address the issue's shell-agnostic selector or filesystem-based installed-status requests. Add the shell-agnostic or shell-detected selector handling and update skill-installed checks to read actual files in ~/.claude/skills/.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is related to the remote skill-install fix, though it is a bit awkward and abbreviated.
Description check ✅ Passed The description covers summary, screenshots, testing, AI review, security, and notes; only the formatting is rough and the Notes section is thin.
Out of Scope Changes check ✅ Passed The changes stay focused on ephemeral terminal worktree branding, selector normalization, and regression tests, with no clear unrelated additions.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.

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.

…terminal fix

Document the new ephemeral setup-terminal id helpers, the runtime terminal
selector, and the onboarding/remote-transport entry points so the changed
functions carry contract-level docstrings.
@Jinwoo-H
Jinwoo-H self-requested a review June 30, 2026 02:23

@Jinwoo-H Jinwoo-H 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.

Thanks @vladmesh — nice root-cause on this. Confirmed the fix end to end:

  • Branded ephemeral setup-terminal ids now resolve to the existing id:global-floating-terminal sentinel at the single runtime-selector point, so a remote orca serve opens the installer in the home dir instead of rejecting an unresolvable worktree id.
  • Local tab identity and real worktree selectors are unchanged; the server is untouched.
  • Verified locally: full affected-area suite + pnpm typecheck + pnpm lint all green, the regression test fails when the transport change is reverted, and live Electron validation shows every ephemeral id resolving to the floating-terminal scope (and that scope spawning a working home-dir shell).

@Jinwoo-H
Jinwoo-H merged commit e82dce4 into stablyai:main Jun 30, 2026
1 check passed
@AmethystLiang AmethystLiang added the orca-remote-server Remote Orca Server / orca serve / paired remote runtime label Jul 22, 2026
brennanb2025 added a commit that referenced this pull request Jul 29, 2026
…6887)

* fix(skills): read installed skills from the connected remote runtime

The "Not installed" badge stayed on in Settings even after a skill was
installed against a remote `orca serve`. Skill discovery always ran through
the local `skills:discover` IPC, so it scanned the client's home dir while
the install (and the skill files) landed on the server. The skills browser
had the same blind spot.

Route discovery to the runtime that owns it, mirroring git/hooks/terminal:
local IPC by default, remote runtime RPC (`skills.discover`) when an Orca
runtime environment is active. The discovery cache is now scoped per runtime
so local and remote results never collide.

Extract the discovery cache/transport into a store-free module
(`installed-agent-skill-discovery.ts`) and a shared runtime-target hook, so
the React hook stays under `max-lines` and store slices can import the
change-notifier without pulling the app store into a circular import.

Independent of the terminal selector fix (#6816); addresses the still-broken
install-status half of #6789.

* fix(skills): runtime-agnostic scan-error toast + docstrings

Address review on #6887:
- The skills-scan error toast said "Could not scan local skills", but
  discovery can now target a remote runtime; drop "local" (source + locales).
- Add short JSDoc to the discovery helpers and skill hooks to clear the
  docstring-coverage gate.

* fix(skills): route discovery through the active runtime and scope its cache

Rebuilt on the repo's standard runtime-client pattern (getActiveRuntimeTarget +
callRuntimeRpc) instead of a bespoke transport, and keeps the renderer discovery
cache keyed per runtime so a remote result never leaks into the local host's
badge after switching environments.

* fix(skills): keep the discovery cache store-free to break the import cycle

Reading the active runtime from the app store inside the hook module closed a
cycle (store -> repos slice -> hook -> store) that broke module init in three
suites. The cache/transport moves to a store-free module the repos slice can
import; only the hook itself touches the store.

* fix(skills): scan the host the install actually lands on

Reviewer round 1 found the badge could scan a different machine than the Install
button writes to: skill install terminals route through
getSingleFocusedRuntimeEnvironmentId, which declines to guess an owner while
several runtimes are saved, so a two-environment user installed locally while
discovery scanned the remote and the badge never flipped. Discovery now resolves
through that same resolver, and holds a loading state until settings and the
runtime catalog have hydrated instead of flashing 'Not installed'.

Also drops the unreachable cwd/worktreeId forwarding (no caller can produce it)
and retires three SkillsPage strings that a remote scan makes false.

* fix(skills): close the round-2 review findings

- SkillsPage had no generation guard, so a slow local scan could land after a
  newer remote scan and silently redisplay the client's skills.
- The round-2 selector took a useShallow object including runtimeEnvironments,
  whose identity churns on every status refresh; that re-fired every consumer's
  scan. Select the resolved id instead.
- A failed runtime-environment catalog read never set the hydrated flag, so
  discovery would have spun for the whole session with no retry affordance.
  An unreadable catalog is settled, which is what terminal routing assumes.
- Remote cache keys no longer fragment on a client-side target the remote call
  discards, which was issuing the same RPC once per target shape.
- Cover each hydration conjunct separately; the combined test covered neither.
- First tests for SkillsPage, which had none.

* fix(skills): settle the runtime catalog without loosening host routing

Round 3 set runtimeEnvironmentCatalogHydrated on a failed catalog read so skill
discovery would stop waiting. That flag also gates fail-closed host routing
(worktree-operation-route mayBeLegacyLocal), so flipping it on failure would have
routed ownerless legacy worktrees — including removals — to the local host off a
stale empty list. Add a separate 'settled' flag for surfaces that only need to
stop waiting, and leave 'hydrated' meaning what its doc says.

fetchSettings now probes the catalog even when the settings read fails, so a
rejected settings.get cannot strand every skill badge on a spinner.

* test(skills): pin the settings-failure runtime catalog probe

The only hunk in the review no mutation could kill.

---------

Co-authored-by: vladmesh <[email protected]>
Co-authored-by: Brennan Benson <[email protected]>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* fix(terminal): scope skill-install terminals to the floating runtime selector (stablyai#6789)

Inline setup/onboarding terminals (skill installers, feature tips) create a
PTY under a synthetic per-panel worktree id. On a remote runtime the remote
PTY transport sent that id as `id:<panel>` to `terminal.create`, which the
runtime cannot resolve, so installing a skill via Settings failed with
selector_not_found. Locally it worked because the IPC spawn uses cwd directly
and never resolves the selector.

These terminals are ephemeral floating terminals with no backing worktree, so
brand their id and resolve it to the floating-terminal selector
(global-floating-terminal), which every runtime already maps to the home dir.
Local tab isolation keeps the distinct per-panel id; only the runtime terminal
selector changes. The server is unchanged.

* docs(terminal): add JSDoc for functions touched by the skill-install terminal fix

Document the new ephemeral setup-terminal id helpers, the runtime terminal
selector, and the onboarding/remote-transport entry points so the changed
functions carry contract-level docstrings.

---------

Co-authored-by: vladmesh <[email protected]>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…tablyai#6887)

* fix(skills): read installed skills from the connected remote runtime

The "Not installed" badge stayed on in Settings even after a skill was
installed against a remote `orca serve`. Skill discovery always ran through
the local `skills:discover` IPC, so it scanned the client's home dir while
the install (and the skill files) landed on the server. The skills browser
had the same blind spot.

Route discovery to the runtime that owns it, mirroring git/hooks/terminal:
local IPC by default, remote runtime RPC (`skills.discover`) when an Orca
runtime environment is active. The discovery cache is now scoped per runtime
so local and remote results never collide.

Extract the discovery cache/transport into a store-free module
(`installed-agent-skill-discovery.ts`) and a shared runtime-target hook, so
the React hook stays under `max-lines` and store slices can import the
change-notifier without pulling the app store into a circular import.

Independent of the terminal selector fix (stablyai#6816); addresses the still-broken
install-status half of stablyai#6789.

* fix(skills): runtime-agnostic scan-error toast + docstrings

Address review on stablyai#6887:
- The skills-scan error toast said "Could not scan local skills", but
  discovery can now target a remote runtime; drop "local" (source + locales).
- Add short JSDoc to the discovery helpers and skill hooks to clear the
  docstring-coverage gate.

* fix(skills): route discovery through the active runtime and scope its cache

Rebuilt on the repo's standard runtime-client pattern (getActiveRuntimeTarget +
callRuntimeRpc) instead of a bespoke transport, and keeps the renderer discovery
cache keyed per runtime so a remote result never leaks into the local host's
badge after switching environments.

* fix(skills): keep the discovery cache store-free to break the import cycle

Reading the active runtime from the app store inside the hook module closed a
cycle (store -> repos slice -> hook -> store) that broke module init in three
suites. The cache/transport moves to a store-free module the repos slice can
import; only the hook itself touches the store.

* fix(skills): scan the host the install actually lands on

Reviewer round 1 found the badge could scan a different machine than the Install
button writes to: skill install terminals route through
getSingleFocusedRuntimeEnvironmentId, which declines to guess an owner while
several runtimes are saved, so a two-environment user installed locally while
discovery scanned the remote and the badge never flipped. Discovery now resolves
through that same resolver, and holds a loading state until settings and the
runtime catalog have hydrated instead of flashing 'Not installed'.

Also drops the unreachable cwd/worktreeId forwarding (no caller can produce it)
and retires three SkillsPage strings that a remote scan makes false.

* fix(skills): close the round-2 review findings

- SkillsPage had no generation guard, so a slow local scan could land after a
  newer remote scan and silently redisplay the client's skills.
- The round-2 selector took a useShallow object including runtimeEnvironments,
  whose identity churns on every status refresh; that re-fired every consumer's
  scan. Select the resolved id instead.
- A failed runtime-environment catalog read never set the hydrated flag, so
  discovery would have spun for the whole session with no retry affordance.
  An unreadable catalog is settled, which is what terminal routing assumes.
- Remote cache keys no longer fragment on a client-side target the remote call
  discards, which was issuing the same RPC once per target shape.
- Cover each hydration conjunct separately; the combined test covered neither.
- First tests for SkillsPage, which had none.

* fix(skills): settle the runtime catalog without loosening host routing

Round 3 set runtimeEnvironmentCatalogHydrated on a failed catalog read so skill
discovery would stop waiting. That flag also gates fail-closed host routing
(worktree-operation-route mayBeLegacyLocal), so flipping it on failure would have
routed ownerless legacy worktrees — including removals — to the local host off a
stale empty list. Add a separate 'settled' flag for surfaces that only need to
stop waiting, and leave 'hydrated' meaning what its doc says.

fetchSettings now probes the catalog even when the settings read fails, so a
rejected settings.get cannot strand every skill badge on a spinner.

* test(skills): pin the settings-failure runtime catalog probe

The only hunk in the review no mutation could kill.

---------

Co-authored-by: vladmesh <[email protected]>
Co-authored-by: Brennan Benson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

orca-remote-server Remote Orca Server / orca serve / paired remote runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

selector_not_found error when installing skills via IDE on remote server connection

3 participants