Skip to content

Revert "#14868 feat(workspace): set project location from the create-worktree host picker" - #14912

Merged
AmethystLiang merged 1 commit into
mainfrom
revert-14868-nwparker/project-location-not-set
Aug 16, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
revert-14868-nwparker/project-location-not-set

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

This reverts #14868 because it introduced a launch-blocking regression.

Setting a project location can change the selected folder path before Orca uses it.

We will reland with a fix: https://linear.app/stably/issue/STA-4547/reland-14868-set-project-location-from-create-worktree-host-picker

@coderabbitai

coderabbitai Bot commented Aug 16, 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 Plus

Run ID: 0cf5f5c5-af8a-42b9-a781-31def5753345

📥 Commits

Reviewing files that changed from the base of the PR and between 1da1bdc and 12594a9.

📒 Files selected for processing (18)
  • src/main/persistence/tracking-repos/project-host-compatibility.test.ts
  • src/main/persistence/tracking-repos/project-host-compatibility.ts
  • src/renderer/src/components/NewWorkspaceComposerCard.set-location.test.tsx
  • src/renderer/src/components/NewWorkspaceComposerCard.test.tsx
  • src/renderer/src/components/NewWorkspaceComposerCard.tsx
  • src/renderer/src/components/NewWorkspaceComposerModal.tsx
  • src/renderer/src/components/new-workspace/RunTargetCombobox.tsx
  • src/renderer/src/components/new-workspace/RunTargetComboboxRow.tsx
  • src/renderer/src/components/new-workspace/SetProjectLocationDialog.test.tsx
  • src/renderer/src/components/new-workspace/SetProjectLocationDialog.tsx
  • src/renderer/src/components/new-workspace/SetProjectLocationForms.tsx
  • src/renderer/src/components/new-workspace/pick-local-project-folder.ts
  • src/renderer/src/hooks/useComposerState-host-retarget.test.ts
  • src/renderer/src/hooks/useComposerState.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/project-host-setup-options.test.ts
  • src/renderer/src/lib/project-host-setup-options.ts
  • src/shared/project-host-setup-projection.ts
💤 Files with no reviewable changes (10)
  • src/renderer/src/components/new-workspace/pick-local-project-folder.ts
  • src/main/persistence/tracking-repos/project-host-compatibility.test.ts
  • src/renderer/src/components/new-workspace/SetProjectLocationForms.tsx
  • src/renderer/src/components/NewWorkspaceComposerCard.set-location.test.tsx
  • src/renderer/src/components/new-workspace/SetProjectLocationDialog.test.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/project-host-setup-options.ts
  • src/renderer/src/components/new-workspace/SetProjectLocationDialog.tsx
  • src/renderer/src/components/new-workspace/RunTargetComboboxRow.tsx
  • src/main/persistence/tracking-repos/project-host-compatibility.ts

Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Removed the Set Location dialog, forms, picker helper, controls, callbacks, locale entries, and related tests. Needs-setup project host options no longer expose canSetLocation; the run-target picker now provides only connection actions. Composer host retargeting accepts ready memoized options and uses option.id. Compatibility filtering retains independent setups, and fallback project identity generation uses the repo: prefix directly.

Merge Risk: ⚪ Minimal · up to 12594

This change restores the previous project-location behavior and removes the problematic path; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the revert and regression, but it omits most required template sections, including the linked issue, visual proof, testing, review, and checklist. Complete the required template sections, link the Linear issue, provide visual proof or N/A, document testing, and complete the checklist.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the pull request as a revert of the change that introduced the regression.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@AmethystLiang
AmethystLiang merged commit b60df2e into main Aug 16, 2026
46 checks passed
nwparker added a commit that referenced this pull request Aug 16, 2026
… picker (#14965)

* feat(workspace): reland set project location from the create-worktree host picker

Relands #14868 (reverted by #14912) with a fix for the regression that caused the
revert: setting a project location could change the path before Orca used it.

The retarget-after-setup path read the raw store record to find a just-created
setup, because the memoized picker options had not refreshed yet:

    useAppStore.getState().projectHostSetups.find(
      (candidate) => candidate.id === setupId && candidate.setupState === 'ready'
    )

That hand-rolls a second selection path that skips every rule the option builder
applies — repo eligibility, ephemeral-VM and runtime-owned SSH host exclusion,
and the one-setup-per-host dedupe whose own comment notes that
resolveWorkspaceCreationTarget takes the first project+host match and ignores the
rest. So the composer could be retargeted at a setup other than the canonical one
for that host, pointing creation at a different location than the one chosen.

Resolves through buildProjectHostSetupOptions against fresh store state instead,
so the fallback and the steady-state picker agree by construction.

STA-4547

* fix(workspace): sanitize the clone prefill and drop an abandoned set-location

Review follow-ups on this PR.

The "Clone from URL" prefill seeded the field with the verbatim `git remote` URL,
which can embed a PAT (`https://x-access-token:ghp_...@github.com/...`). The
clone then runs on the *target* host, writing that token into its .git/config —
a credential the user never typed into this flow, now readable by anyone on a
shared host. Strip it with the same sanitizer `getProvisionedRootRecipeRepoUrl`
already applies to the ephemeral-VM recipe URL. Extracted to
resolveProjectCloneUrlPrefill so the rule is directly testable.

The dialog also stays dismissable while a submit is in flight, and an SSH clone
is unbounded. A clone the user backed out of minutes earlier still called
onReady, silently moving the run target and resetting start-from under a form
they had since pointed at another host. Drop the result if the dialog went away.

* fix(workspace): re-arm the abandoned guard on mount

StrictMode runs mount/cleanup/mount, so latching `abandoned` on the first
cleanup left it true for the rest of the session and permanently suppressed
onReady — the app wraps its root in StrictMode. Reset it on mount.
AmethystLiang added a commit that referenced this pull request Aug 17, 2026
AmethystLiang pushed a commit that referenced this pull request Aug 17, 2026
… picker (#14965)

* feat(workspace): reland set project location from the create-worktree host picker

Relands #14868 (reverted by #14912) with a fix for the regression that caused the
revert: setting a project location could change the path before Orca used it.

The retarget-after-setup path read the raw store record to find a just-created
setup, because the memoized picker options had not refreshed yet:

    useAppStore.getState().projectHostSetups.find(
      (candidate) => candidate.id === setupId && candidate.setupState === 'ready'
    )

That hand-rolls a second selection path that skips every rule the option builder
applies — repo eligibility, ephemeral-VM and runtime-owned SSH host exclusion,
and the one-setup-per-host dedupe whose own comment notes that
resolveWorkspaceCreationTarget takes the first project+host match and ignores the
rest. So the composer could be retargeted at a setup other than the canonical one
for that host, pointing creation at a different location than the one chosen.

Resolves through buildProjectHostSetupOptions against fresh store state instead,
so the fallback and the steady-state picker agree by construction.

STA-4547

* fix(workspace): sanitize the clone prefill and drop an abandoned set-location

Review follow-ups on this PR.

The "Clone from URL" prefill seeded the field with the verbatim `git remote` URL,
which can embed a PAT (`https://x-access-token:ghp_...@github.com/...`). The
clone then runs on the *target* host, writing that token into its .git/config —
a credential the user never typed into this flow, now readable by anyone on a
shared host. Strip it with the same sanitizer `getProvisionedRootRecipeRepoUrl`
already applies to the ephemeral-VM recipe URL. Extracted to
resolveProjectCloneUrlPrefill so the rule is directly testable.

The dialog also stays dismissable while a submit is in flight, and an SSH clone
is unbounded. A clone the user backed out of minutes earlier still called
onReady, silently moving the run target and resetting start-from under a form
they had since pointed at another host. Drop the result if the dialog went away.

* fix(workspace): re-arm the abandoned guard on mount

StrictMode runs mount/cleanup/mount, so latching `abandoned` on the first
cleanup left it true for the rest of the session and permanently suppressed
onReady — the app wraps its root in StrictMode. Reset it on mount.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
… picker (stablyai#14965)

* feat(workspace): reland set project location from the create-worktree host picker

Relands stablyai#14868 (reverted by stablyai#14912) with a fix for the regression that caused the
revert: setting a project location could change the path before Orca used it.

The retarget-after-setup path read the raw store record to find a just-created
setup, because the memoized picker options had not refreshed yet:

    useAppStore.getState().projectHostSetups.find(
      (candidate) => candidate.id === setupId && candidate.setupState === 'ready'
    )

That hand-rolls a second selection path that skips every rule the option builder
applies — repo eligibility, ephemeral-VM and runtime-owned SSH host exclusion,
and the one-setup-per-host dedupe whose own comment notes that
resolveWorkspaceCreationTarget takes the first project+host match and ignores the
rest. So the composer could be retargeted at a setup other than the canonical one
for that host, pointing creation at a different location than the one chosen.

Resolves through buildProjectHostSetupOptions against fresh store state instead,
so the fallback and the steady-state picker agree by construction.

STA-4547

* fix(workspace): sanitize the clone prefill and drop an abandoned set-location

Review follow-ups on this PR.

The "Clone from URL" prefill seeded the field with the verbatim `git remote` URL,
which can embed a PAT (`https://x-access-token:ghp_...@github.com/...`). The
clone then runs on the *target* host, writing that token into its .git/config —
a credential the user never typed into this flow, now readable by anyone on a
shared host. Strip it with the same sanitizer `getProvisionedRootRecipeRepoUrl`
already applies to the ephemeral-VM recipe URL. Extracted to
resolveProjectCloneUrlPrefill so the rule is directly testable.

The dialog also stays dismissable while a submit is in flight, and an SSH clone
is unbounded. A clone the user backed out of minutes earlier still called
onReady, silently moving the run target and resetting start-from under a form
they had since pointed at another host. Drop the result if the dialog went away.

* fix(workspace): re-arm the abandoned guard on mount

StrictMode runs mount/cleanup/mount, so latching `abandoned` on the first
cleanup left it true for the rest of the session and permanently suppressed
onReady — the app wraps its root in StrictMode. Reset it on mount.
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