Repository navigation
Fix/remote skill install floating terminal - #6816
Conversation
…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.
…stall-floating-terminal
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughA 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)
✅ Passed checks (4 passed)
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. Comment |
…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
left a comment
There was a problem hiding this comment.
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-terminalsentinel at the single runtime-selector point, so a remoteorca serveopens 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 lintall 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).
…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]>
* 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]>
…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]>
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
filesystem paths, shell invocation, or Electron haves identically on all three.
still works.
assumptions added.
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
Before and after