Skip to content

fix(runtime): resolve folder workspaces wherever a command can be given one - #35223

Merged
nwparker merged 5 commits into
mainfrom
fix/sta-12562-folder-aware-selectors
Oct 28, 2026
Merged

nwparker merged 5 commits into
mainfrom
fix/sta-12562-folder-aware-selectors

Conversation

@nwparker

@nwparker nwparker commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 35 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​294 $\color{#cf222e}{\Huge{\mathbf{−}}}$​83 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​211
Prod 40 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​62 $\color{#cf222e}{\Huge{\mathbf{−}}}$​56 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6

ELI5

Some Orca commands looked up a workspace with a lookup that only knows Git worktrees. Given a folder workspace, they said "not found". The same mistake broke Sleep in STA-12562. Every command that can be handed a folder workspace now uses the lookup that understands both. The Git-only lookup is renamed so it can't be picked up by mistake again.

What Changed

  • Before: project-group folder workspaces (folder:<uuid>, with no repo row) failed with selector_not_found in these commands: orca worktree show, worktree.sleep from the CLI or a phone, terminal list by folder key, the active-terminal fallback, scrollback reads, plugin workspace context, Linear --current from a folder terminal, browser tab list/target/close and Kitty image reads.
  • After: those callers go through resolveWorkspaceSelector, the shared resolver from fix(runtime): sleep and stop resolve project-group folder workspaces #35082: folder workspace first, then Git. Explicit-id shortcuts are kept where they were correct.
    • The mobile session-tab fallbacks are converted too, so there is one rule. Mobile already took the explicit-id path there.
  • Kept Git-only, on purpose: Git operations, removal, hosted review, activation, worktree metadata updates and automation launch. They need a repo row or Git metadata.
  • Rename: the Git-only resolver is now resolveGitWorktreeSelector, with a doc line pointing to resolveWorkspaceSelector. No call to the old name remains.
  • Folder existence: browser commands still require the folder to exist. Listing, reading and teardown don't.
  • Guards:
    • Skill install's worktree path refuses folder ids. Folders must come through folderWorkspaceId, which applies the folder's own host fence.
    • Linear --current writes no stray worktree metadata for a folder.

Why

STA-12562 was one case of a general problem: a Git-only resolver receiving folder ids. Fixing only Sleep would have left the same failure in a dozen other commands. Renaming the Git-only resolver makes the choice explicit at every call site.

Linked Issue

Refs STA-12562 (follow-up to #35082). Thanks to toshi-brain for the report that exposed the class.

Visual Proof

N/A. This is runtime resolution only; the commands above now succeed for folder workspaces instead of returning selector_not_found.

Testing

  • Automated tests added/updated: project-group-folder-workspace-selectors.test.ts (9 cases), orca-runtime-read-kitty-file.test.ts (2) and a skill-install authority case. All fail on main and pass with this change.
  • pnpm check:changed --maxWorkers=2: 20/20 passed before the rebase.
  • After rebasing onto current main: pnpm tc:node is clean, and every test related to the 75 changed files passes (598 files, 7838 tests).
  • Codex review: clean. Independent Opus review: no P0–P2. Its two P3s, the skill-install fence and the Linear backfill, are fixed here.

Notes

Host fencing is unchanged. A folder workspace takes its host from executionHostId, then connectionId, then local, so SSH, runtime and WSL folders resolve only to their own host. No RPC schema changed, and the renamed ports are in-process only, so mixed versions are unaffected.

Follow-up: Linear --current run by working directory inside a folder workspace still matches Git rows only. Many folder workspaces can share one path, so that needs its own ambiguity rule.

…folder id can arrive

The Git-only selector resolver never matches project-group folder
workspaces (no repo row), so worktree show/sleep, terminal list by
workspace key, the active-terminal fallback, scrollback reads, Kitty file
reads, Linear --current, browser commands, plugin context and the session
tab fallbacks failed with selector_not_found for them. Route those
callers through resolveWorkspaceSelector and rename the Git-only resolver
to resolveGitWorktreeSelector so it reads as the repo-backed catalog only.

Refs STA-12562
… the Linear meta backfill

Skill installs fence a worktreeId by repo rows, so a folder id there must
come through folderWorkspaceId, where its own host fence applies. Linear
--current answers a folder's legacy link without writing a worktreeMeta
row keyed by the folder id.

Refs STA-12562
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7f09b818-b995-41df-a980-6d8419c0727c
Commits

Reviewing files that changed from the base of the PR and between 08ff67a and 0ff7a1d.

Files selected for processing: 75
  • src/main/ipc/pty/pty-launch-parity.test.ts
  • src/main/orcad/electron-serve-browser-process.test.ts
  • src/main/orcad/external-chromium-browser-process.integration.test.ts
  • src/main/orcad/external-chromium-tab-registry.test.ts
  • src/main/orcad/orcad-browser-provider.test.ts
  • src/main/orcad/orcad-browser-startup.test.ts
  • src/main/runtime/agent-detection-host-resolution.test.ts
  • src/main/runtime/agent-terminal-launch-host.test.ts
  • src/main/runtime/browser-tab-create-caller-navigation.test.ts
  • src/main/runtime/browser-tab-create-folder-workspace.test.ts
  • src/main/runtime/browser-tab-create-publication.test.ts
  • src/main/runtime/browser/browser-command-contracts.ts
  • src/main/runtime/browser/browser-command-targets.ts
  • src/main/runtime/browser/browser-tab-close.ts
  • src/main/runtime/construction/runtime-construction-services.ts
  • src/main/runtime/construction/runtime-file-command-state.ts
  • src/main/runtime/construction/runtime-host-services.ts
  • src/main/runtime/construction/runtime-service-state.ts
  • src/main/runtime/files/file-command-host.ts
  • src/main/runtime/integrations/linear/linear-commands.ts
  • src/main/runtime/launch-agent-terminal-followup.test.ts
  • src/main/runtime/linear-save-markdown.test.ts
  • src/main/runtime/orca-runtime-browser-client-hosted.test.ts
  • src/main/runtime/orca-runtime-browser-ghost-session-row-close.test.ts
  • src/main/runtime/orca-runtime-browser-headless.test.ts
  • src/main/runtime/orca-runtime-browser.test.ts
  • src/main/runtime/orca-runtime-files-artifact-facade.test.ts
  • src/main/runtime/orca-runtime-files-test-harness.ts
  • src/main/runtime/orca-runtime-files-watch.test.ts
  • src/main/runtime/orca-runtime-migration-catalog.ts
  • src/main/runtime/orca-runtime-read-kitty-file.test.ts
  • src/main/runtime/orca-runtime-read-kitty-file.ts
  • src/main/runtime/orca-runtime-terminal-create-idempotency.test.ts
  • src/main/runtime/project-group-folder-workspace-selectors.test.ts
  • src/main/runtime/queued-terminal-graph-exit.test.ts
  • src/main/runtime/runtime-created-worktree-terminal-target.test.ts
  • src/main/runtime/runtime-file-target-execution-host.test.ts
  • src/main/runtime/runtime-git-target-execution-host.test.ts
  • src/main/runtime/runtime-linear-command-base.ts
  • src/main/runtime/runtime-linear-comment-edit.test.ts
  • src/main/runtime/runtime-linear-read-commands.test.ts
  • src/main/runtime/runtime-linear-team-write-commands.ts
  • src/main/runtime/runtime-skill-install-authority.test.ts
  • src/main/runtime/runtime-skill-install-authority.ts
  • src/main/runtime/session-graph/session-graph-authority.ts
  • src/main/runtime/session-graph/session-graph-reload-lifecycle.ts
  • src/main/runtime/session-lifecycle/close/close-mobile-session-tab.ts
  • src/main/runtime/session-lifecycle/projection/perform-mobile-session-pty-records-refresh.ts
  • src/main/runtime/session-tabs/headless-pane-move-to-new-tab.ts
  • src/main/runtime/session-tabs/headless-tab-properties.ts
  • src/main/runtime/session-tabs/headless-terminal-tab-close.ts
  • src/main/runtime/session-tabs/session-tab-prototype-dispatch.test.ts
  • src/main/runtime/session-tabs/session-tabs-change-publication.ts
  • src/main/runtime/session-tabs/session-tabs-inventory.ts
  • src/main/runtime/session-tabs/structured-session-tab-restoration.ts
  • src/main/runtime/single-page-browser-commands-host-test-double.ts
  • src/main/runtime/structured-worker-mail-routing.test.ts
  • src/main/runtime/terminal/adoption/adopt-terminal-orphans-from-inventory.ts
  • src/main/runtime/terminal/driver/terminal-driver-resources.ts
  • src/main/runtime/terminal/launch/mobile-terminal-create.ts
  • src/main/runtime/terminal/launch/terminal-create-deduplication.ts
  • src/main/runtime/terminal/launch/terminal-workspace-scope.ts
  • src/main/runtime/terminal/layout/terminal-resize-listeners.ts
  • src/main/runtime/terminal/output/terminal-orchestration-authority.ts
  • src/main/runtime/terminal/stop/exact-terminal-stop-liveness.test.ts
  • src/main/runtime/terminal/wait/terminal-interactive-wait.ts
  • src/main/runtime/workspaces/managed-workspace-operations.ts
  • src/main/runtime/workspaces/workspace-activation.ts
  • src/main/runtime/workspaces/workspace-file-session-targets.ts
  • src/main/runtime/workspaces/workspace-metadata.ts
  • src/main/runtime/workspaces/workspace-query-prototype.test.ts
  • src/main/runtime/workspaces/workspace-removal-target.ts
  • src/main/runtime/workspaces/workspace-selectors.ts
  • src/main/runtime/worktree-scan-admin-fingerprint-gate.test.ts
  • src/main/wsl-move-incidental-writes.test.ts
Files with no reviewable changes: 5
  • src/main/runtime/files/file-command-host.ts
  • src/main/runtime/orca-runtime-files-test-harness.ts
  • src/main/runtime/orca-runtime-files-watch.test.ts
  • src/main/runtime/orca-runtime-files-artifact-facade.test.ts
  • src/main/runtime/construction/runtime-file-command-state.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Walkthrough

The changes separate workspace selector resolution from repo-backed Git worktree selector resolution. Runtime browser, session, terminal, workspace, and integration paths now use the corresponding resolver. File-command construction no longer receives a worktree selector callback. Added tests cover project-group folder workspaces, including terminal operations, Linear issue lookup, browser tab listing, and skill-install worktree resolution.

Priority: Normal

Merge Risk: Minimal · up to 0ff7a

This change routes folder workspaces through the shared workspace resolver in more commands and keeps Git-only paths Git-only. No new merge-blocking issue was found in the reviewed changes.

Pre-merge checks: Passed 3 · Failed 1 · Inconclusive 1

Failed Failed checks: 1 warning · 1 inconclusive

Check name Status Explanation Resolution
Description check Warning The description is detailed and covers the change, rationale, testing, visual proof, compatibility, and remaining follow-up. The Linked Issue section is incomplete because it provides only “Refs STA-1… Add a direct link to the issue, preferably using the required “Fixes #” format. Include the required remaining template sections, or explicitly mark them as not applicable, including AI Disclosure, Review, Agent skill upstream…
Docstring Coverage Inconclusive Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: resolving folder workspaces for commands that accept workspace selectors.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is detailed and covers the change, rationale, testing, visual proof, compatibility, and remaining follow-up. The Linked Issue section is incomplete because it provides only “Refs STA-12562” instead of an actual linked issue in the required Fixes format. Several checklist sections are also omitted.

Resolution

Add a direct link to the issue, preferably using the required “Fixes #<issue-number>” format. Include the required remaining template sections, or explicitly mark them as not applicable, including AI Disclosure, Review, Agent skill upstream boundary, and Checklist.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 11 functions across 50 files. (20 skipped: 20 over the file limit.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • 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.

❤️ Share

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

@nwparker
nwparker merged commit 121eb3b into main Oct 28, 2026
53 checks passed
DominionZA2 added a commit to DominionZA2/orca that referenced this pull request Oct 30, 2026
main (stablyai#35223) now resolves Folder Workspace selectors for browser
commands, terminal listing and worktree show, so this commit keeps only
what that change left out: help text naming folder:<id> for the
workspace-scoped --worktree flags (commands that stay git-only keep the
old text), and runtime coverage that browser snapshot and explicit-page
targeting stay on the named Folder Workspace.
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