Repository navigation
feat(cli): configure external worktree visibility per repo - #24741
Conversation
Adapt the local CLI visibility setter from KAPUIST in PR23025 without the cross-host persistence changes. Co-authored-by: KAPUIST <thsxornjs12@gmail.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (10)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe CLI adds Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The new command can set repository worktree visibility or clear the override with inherit. No issue requiring a fix before merge was identified. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The command changes one existing repository setting through the established update interface. No introduced security issue was established, but remote access enforcement and interrupted-save behavior remain incompletely verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 8 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
|
Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings. |
|
@coderabbitai review Please review current head 4703781 after the stated review-limit reset. This is the focused local CLI parity entry point and guide registration; existing runtime persistence is unchanged. |
|
|
@coderabbitai review Please review current head 4703781 after the stated review-limit reset. This is the focused local CLI parity entry point and guide registration; existing runtime persistence is unchanged. |
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- New
orca repo setcommand — reads--repoand required--external-worktree-visibility show|hide|inherit, rejects any other value before I/O, and forwards to the existingrepo.updateRPC withupdates: { externalWorktreeVisibility }(inherit→nullclear sentinel). Selectors pass through unchanged. - Repo specs extracted — the five existing repo command specs move to
src/cli/specs/repo.ts(spread back intoCORE_COMMAND_SPECS), with the newrepo setspec added. - Discovery, help, docs —
handler-group-manifestregistersrepo set;FLAG_HELP_TEXT, both root-help arrays, andskill-guides/orca-cli.mddocument it; the generatedbundled-skill-guides.tsverifies current. - Tests —
repo-visibility.test.tspins selector pass-through (id:/name:with spaces/path:incl. a Windows path), theinherit→nullmapping, exact singlerepo.updatecall shape, and five pre-runtime validation failures.
I traced the full path CLI → RepoUpdate zod schema → RuntimeRepositorySettingsController.update → updateRepo persistence. The 'show'|'hide' enum is enforced again at the RPC boundary, null survives omitUndefined to clear the override exactly as the GUI's "Use global" does, and updateRepo bumps the local worktree scan generation so the issue's core worktree list / terminal create flows see the change. The author already documents that the running GUI sidebar needs a manual refetch; that is a pre-existing GUI-side refresh, not a regression introduced here.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
Final merge review at Pass show/hide/inherit to the existing repository visibility update. Merge risk and retained limits: Low: CLI extension through existing workspace-visibility RPC. Related proposals/changes: #23025. The contributor proposal additionally changes execution-host persistence; that extra behavior is not assumed superseded by this CLI change. Contributor authors and existing co-author credit will be preserved explicitly in the squash commit. |
|
Final review of conflict repair at
The repair retains all five moved repo command definitions and every earlier command field. It preserves #20036's linked-PR/GitLab flags and #22714's read/unread controls, plus the complete generated guides. Independent review binds all ten feature files to the actual fresh-main merge and confirms every other path is retained from that main revision. All 157 fresh focused tests pass on the final source, along with generator, format, ordinary lint, and the full changed-code-quality gate including typed analysis. Canonical CI also passes full typecheck, static analysis, five test shards, Linux and Windows packaging, and Linux/Windows/macOS native smoke checks. Required checks for this exact published head: detect changes and check repository guards, verify. Risk is low: optional CLI input to an existing setter. Source review covers persistence and precedence; mocked-runtime CLI tests do not prove a live sidebar update or native platform behavior. The isolated local typecheck limitation is recorded; canonical new-head CI is the merge gate. KAPUIST's adapted local setter from #23025 and Neil's work will retain explicit co-author credit in the squash commit. #23025 remains open because its additional execution-host persistence behavior is outside this replacement. |

ELI5
Scripts can now choose whether a project's worktrees created outside Orca are shown, using the same setting as the app.
What Changed
Before,
orca repo setwas unknown and scripts had to open the GUI to change this setting. After:The CLI validates the value and calls existing
repo.updatewith onlyexternalWorktreeVisibility;inheritsendsnullto clear the override. Repo selectors pass through unchanged. Root and command help and the generated CLI guide include the command. Existing repo specs move into their own module to stay under the file-size limit.Why
Tooling that uses plain
git worktree addcan configure visibility without opening project settings. Reusing the existing setting and update method keeps the same persistence and visibility rules, with no new preferences or runtime changes.Linked Issue
Fixes #22898
Visual Proof
Captured through CDP from a hidden macOS Orca instance with disposable home/profile and a real Git repo. One worktree is shown individually; the scripted worktree starts hidden. The after sidebar was refreshed by reopening the existing Non-Orca worktrees panel; the CLI list and GUI setting update immediately, but the existing sidebar cache needs a refetch.
Before: scripted-agent is hidden.
After
show: scripted-agent appears; the individual rule remains.GUI setting after the CLI update:
Testing
macOS acceptance: create a disposable repo and two plain Git worktrees, register it through
repo add, show one worktree individually, and run the three commands above.showlists all three checkouts;hidelists only the main and individually shown checkout.inheritclears the stored override and follows both global Hide and Show. Comparing repo results confirms only the visibility field changes; an invalid value fails before mutation. A public CLI terminal launch by the scripted worktree's path also succeeds.ORCA_BACKGROUND_LAUNCH=1 pnpm test src/cli/handlers/repo-visibility.test.ts src/cli/handler-group-manifest.test.ts src/cli/skill-guide-cli-parity.test.ts src/cli/specs/bundled-guide-flags.test.ts— 22 passed. CLI typecheck/build, scoped oxlint, formatting, changed-code-quality, generated-guide verification, andgit diff --checkpassed. The hidden dev app rebuilt main/preload successfully.Combined CLI integration with the reviewed commits for #22714, #24747, and #24755 passed 119 tests across nine files, CLI typecheck, and regenerated-guide verification. The check covered command discovery, parsing, returned results, shared types, and guides; temporary peer changes were removed and this PR remains independent.
AI Disclosure
Codex-assisted implementation, independently reviewed and verified through public CLI and hidden CDP.
Review
Independent read-only review found no issues at
47037817d82229a1959a01990c868f1d1e0b64e7, including validation, selector forwarding, existing spec preservation, generated-guide scope, and persistence reuse.Current-head CI is pending static analysis and typecheck. Fresh CodeRabbit review is blocked by the shared quota, Cursor Bugbot is disabled for this repository, and Pullfrog is still running; no actionable bot comments are outstanding.
Agent skill upstream boundary
Notes
Credit to @KAPUIST's recent #23025 for the local CLI setter approach; included as co-author. This separate PR adapts that local material to the issue's
repo setspelling and does not adopt or modify the mixed PR's cross-host changes.Merge risk is low: only CLI registration, validation, help, docs, and tests change. No new user-facing tradeoffs are expected; existing per-worktree/source rules and sidebar refresh behavior remain. Native smoke checks passed on macOS, Linux, and Windows; Linux and Windows desktop acceptance was not run; SSH/remote behavior is unchanged and untested. No mobile, global-settings, hook, or selector-diagnostic changes.
Checklist