Repository navigation
Hide workspace parent flag from worktree create CLI - #5743
Conversation
|
Ready to review this PR? Stage has broken it down into 6 individual chapters for you: Chapters generated by Stage for commit e016920 on Jun 19, 2026 12:25am UTC. |
📝 WalkthroughWalkthroughThe PR replaces 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 3c0443e3-892e-4bc2-82c9-28d14ff03f83
📒 Files selected for processing (13)
src/cli/args.tssrc/cli/format.test.tssrc/cli/handlers/worktree-create-parent-selector.tssrc/cli/handlers/worktree-lineage-summary.tssrc/cli/handlers/worktree.tssrc/cli/help.tssrc/cli/index.test.tssrc/cli/specs/core.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/errors.test.tssrc/main/runtime/rpc/methods/worktree-schemas.tssrc/main/runtime/rpc/methods/worktree.test.ts
| await main(['--help'], '/tmp/repo') | ||
|
|
||
| const rootHelp = String(logSpy.mock.calls[0][0]) | ||
| expect(rootHelp).not.toContain('--parent-workspace') | ||
| expect(rootHelp).toContain('[--parent-worktree <selector>] [--no-parent]') | ||
|
|
||
| logSpy.mockClear() | ||
| await main(['worktree', 'create', '--help'], '/tmp/repo') | ||
|
|
||
| const createHelp = String(logSpy.mock.calls[0][0]) | ||
| expect(createHelp).not.toContain('--parent-workspace') | ||
| expect(createHelp).not.toContain('checkout/workspace') | ||
| expect(createHelp).not.toContain('caller workspace') | ||
| expect(createHelp).not.toContain('current workspace') | ||
| expect(createHelp).not.toContain('active Orca workspace') | ||
| expect(createHelp).not.toContain('folderWorkspaceId') | ||
| expect(createHelp).toContain('folder:<id>') | ||
| expect(createHelp).toContain('folder:<folderId>') | ||
| expect(createHelp).toContain('worktree:<id>') | ||
|
|
||
| logSpy.mockClear() | ||
| await main(['worktree', 'set', '--help'], '/tmp/repo') | ||
|
|
||
| const setHelp = String(logSpy.mock.calls[0][0]) | ||
| expect(setHelp).not.toContain('--parent-workspace') | ||
| expect(setHelp).not.toContain('folder:<id>') | ||
| expect(setHelp).not.toContain('worktree:<id>') | ||
| expect(callMock).not.toHaveBeenCalled() | ||
| }) | ||
|
|
||
| it('distinguishes new worktrees from fresh agent terminals in command help', async () => { | ||
| const logSpy = vi.spyOn(console, 'log').mockImplementation(() => {}) | ||
| logSpy.mockClear() | ||
|
|
||
| await main(['worktree', 'create', '--help'], '/tmp/repo') | ||
|
|
There was a problem hiding this comment.
Replace hardcoded POSIX test paths with path utilities.
Several updated tests use literal /tmp/... paths, which is not cross-platform and can break on Windows runners. Use path.join/path.resolve (or a shared test-path helper) for these cases.
As per coding guidelines, "Use path.join or Electron/Node path utilities for file paths — never assume / or \ for cross-platform compatibility".
Also applies to: 1316-1383, 1609-1724
Source: Coding guidelines
Summary
orca worktree createon the public--parent-worktreepath and remove--parent-workspacefrom the CLI contract entirely.--parent-worktree folder:<id>,worktree:<id>,id:folder:<id>, andid:worktree:<id>through the existing internalparentWorkspacelineage path.--parent-worktree active/currentfrom top-level folder workspaces by resolving those folder pseudo-worktree ids back onto the internalparentWorkspacepath.parentWorktree, preserve inferredORCA_WORKSPACE_ID/ORCA_WORKTREE_IDparent behavior, and scrub public hidden-flag guidance from create/help/runtime errors.skills/orca-cli/SKILL.mdsource so installed agent-facing guidance matches the new public worktree-create flow and does not advertise stale worktree/workspace wording for lineage.Brennan YOLO Lite Evidence
.tmp/brennan-yolo-lite/cli-worktree-parent-selector-design.md(scratch only, not included in the PR).auto-design-review-fix; final design had no P0/P1 issues.worktree.tsunder max-lines.--parent-workspaceis unknown.git diff --cachedand both returned clean.skills/orca-cli/SKILL.mdand returned clean.--parent-worktree active/currentfolder-workspace edge. The edge is now fixed and covered by regression tests; Godel, Dalton, and Socrates returned clean on the updated branch.brennan-test-changes: Euler verdict wasland; validation covered CLI help, parent selector routing, runtime/schema wording, and the extracted selector module.Tests
pnpm run typecheckpnpm run typecheck:clipnpm run build:cligit diff --checkgit diff --cached --checknode config/scripts/verify-cli-bin.mjs --run-helpnode out/cli/index.js worktree create --helpconfirmed create exposes--parent-worktreewith folder/worktree context keys and no--parent-workspacenode out/cli/index.js worktree set --helpconfirmed set keeps ordinary worktree selectors and does not advertise folder/worktree context keysnode out/cli/index.js worktree create --repo id:repo-1 --name child --parent-workspace folder:folder-1 --jsonrejects--parent-workspaceas an unknown flag before runtime dispatchnode out/cli/index.js worktree create --repo id:de1c307b-d4b8-4b2d-aaa2-98f801372829 --name cli-parent-validation-1781829749 --parent-worktree active --setup skip --comment "manual compiled CLI validation; safe to remove" --jsonparentWorktreeIdandworkspaceLineage.parentWorkspaceKeypointed at the currentstargazerworktree;worktree showon the parent listed the child before cleanupnode out/cli/index.js worktree create --repo id:de1c307b-d4b8-4b2d-aaa2-98f801372829 --name cli-inferred-parent-validation-1781830062 --setup skip --comment "manual inferred-parent CLI validation; safe to remove" --jsonparentWorktreeId,lineage.capture.source: cwd-context,lineage.capture.confidence: inferred, andworkspaceLineage.parentWorkspaceKeyto the currentstargazerworktree;worktree showon the parent listed the child before cleanupnode out/cli/index.js worktree rm ... --force --json; parent child list empty afterward; validation directories and branches absentrg -n "parent-workspace|worktree/workspace|checkout/workspace|current workspace|child workspace|spawn codex/claude in a workspace|Orca worktree/workspace" skills/orca-cli/SKILL.mdreturned no matchesrg -n "hiddenFlags|--parent-workspace|parent-workspace|compatibility alias" src skills docs config tests --glob '!node_modules'returns only negative CLI tests for the removed flagpnpm exec oxlint src/cli/args.ts src/cli/format.test.ts src/cli/handlers/worktree-create-parent-selector.ts src/cli/handlers/worktree-lineage-summary.ts src/cli/handlers/worktree.ts src/cli/help.ts src/cli/index.test.ts src/cli/specs/core.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/orca-runtime.ts src/main/runtime/rpc/errors.test.ts src/main/runtime/rpc/methods/worktree-schemas.ts src/main/runtime/rpc/methods/worktree.test.ts skills/orca-cli/SKILL.mdpnpm exec vitest run --config config/vitest.config.ts src/cli/index.test.ts -t "parent-worktree"(1 file, 6 matching tests)pnpm exec vitest run --config config/vitest.config.ts src/cli/index.test.ts src/cli/format.test.ts src/main/runtime/rpc/errors.test.ts src/main/runtime/rpc/methods/worktree.test.ts src/main/runtime/orca-runtime.test.ts(5 files, 579 tests)Accepted Gaps / Notes
pnpm run lintgets past touched files, but fails on pre-existing unrelated localization catalog keys insrc/renderer/src/components/sidebar/sidebar-workspace-option-items.tsandsrc/renderer/src/components/sidebar/worktree-card-display-property-options.ts; those files have no working-tree diff in this PR.worktree list --limit 10000 --jsonreturned no folder pseudo-worktrees. The folderactive/currentedge is covered by focused CLI regression tests and manual code tracing, while the live compiled CLI smokes covered real worktree creation, linkage visibility, and cleanup for explicit and inferred normal worktree parents.brennan-test-changesaccepted this for the CLI/runtime argument-routing scope because parser/help/error behavior and runtime routing are covered directly by focused tests and CLI probes.