Skip to content

sync: port duplicate workspace roots guard and record July 16 upstream ancestry (#3829) - #158

Merged
aaditagrawal merged 20 commits into
mainfrom
sync/20260716-workspace-roots
Jul 16, 2026
Merged

sync: port duplicate workspace roots guard and record July 16 upstream ancestry (#3829)#158
aaditagrawal merged 20 commits into
mainfrom
sync/20260716-workspace-roots

Conversation

@aaditagrawal

@aaditagrawal aaditagrawal commented Jul 16, 2026

Copy link
Copy Markdown
Owner

What changed

  • Ports duplicate project workspace roots prevention across orchestration, shared path helpers, client-runtime, and sidebar grouping (#3829).
  • Records upstream ancestry through July 16 so origin/main is zero behind upstream/main after merge.
  • Preserves fork: keeps fork Cursor SDK test harness (skips upstream ACP-stdio cancel hunk that does not apply).

Validation

  • vp check / vp run typecheck — pass
  • Focused server/web/shared/client-runtime tests for this slice — pass
  • git rev-list --left-right --count HEAD...upstream/main911 0
  • CI: pending

Stack: 4 of 4; depends on #157.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a9afaab1-3a70-4795-b774-601a46322bcc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/20260716-workspace-roots

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.

@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Jul 16, 2026
@aaditagrawal aaditagrawal changed the title sync: port upstream duplicate workspace roots guard (#3829) sync: port duplicate workspace roots guard and record July 16 upstream ancestry (#3829) Jul 16, 2026
@github-actions github-actions Bot added the size:L 100-499 effective changed lines (test files excluded in mixed PRs). label Jul 16, 2026
@aaditagrawal

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@aaditagrawal
aaditagrawal force-pushed the sync/20260716-workspace-roots branch from 7b3a640 to 9f5a104 Compare July 16, 2026 09:33
@aaditagrawal
aaditagrawal force-pushed the sync/20260716-mobile-desktop branch from c24c2c1 to 5c6da4e Compare July 16, 2026 09:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9f5a104857

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/web/src/sidebarProjectGrouping.ts
@aaditagrawal
aaditagrawal force-pushed the sync/20260716-workspace-roots branch from 9f5a104 to 10a8aa4 Compare July 16, 2026 09:40
@aaditagrawal
aaditagrawal force-pushed the sync/20260716-mobile-desktop branch from 5c6da4e to 34b0027 Compare July 16, 2026 09:40

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20a2420a45

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +115 to +120
yield* requireActiveProjectWorkspaceRootAbsent({
readModel,
command,
workspaceRoot: command.workspaceRoot,
exceptProjectId: command.projectId,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle normalized autobootstrap matches before create

When the web server auto-bootstrap path in serverRuntimeStartup.ts looks for an existing project, it uses ProjectionSnapshotQuery.getActiveProjectByWorkspaceRoot, which is an exact workspace_root = ... lookup. For an existing active row that differs only by formatting this guard now normalizes and rejects the project.create instead of letting auto-bootstrap reuse the existing project/thread, so databases with older /repo/ rows or Windows case variants fail to produce bootstrapped welcome targets. Normalize the lookup/reuse path or translate this duplicate into the existing project before dispatching create.

Useful? React with 👍 / 👎.

@aaditagrawal
aaditagrawal force-pushed the sync/20260716-workspace-roots branch from 20a2420 to 4a940ef Compare July 16, 2026 09:49
@aaditagrawal
aaditagrawal force-pushed the sync/20260716-mobile-desktop branch from 34b0027 to 4025f28 Compare July 16, 2026 09:49
juliusmarminge and others added 8 commits July 16, 2026 15:20
Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit b982337)
Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit 54f167e)
Cherry-pick of upstream d114e27 (Prevent duplicate project workspace
roots). Adds requireActiveProjectWorkspaceRootAbsent invariant to the
decider, normalizeProjectPathForComparison/normalizeProjectPathForDispatch
moved to packages/shared/src/path.ts, and sidebar project-grouping
dedupe-by-physical-key logic (prefers the primary environment's member,
then freshest updatedAt/createdAt, then highest id).

apps/server/src/provider/Layers/CursorAdapter.test.ts is intentionally
left unchanged: upstream's hunk there fixes an unrelated ACP-stdio
session/cancel test behavior that has no equivalent in the fork's
SDK-based Cursor adapter test harness, and is unrelated to the
workspace-root invariant this commit otherwise ports.

Co-authored-by: codex <codex@users.noreply.github.com>
@aaditagrawal
aaditagrawal force-pushed the sync/20260716-workspace-roots branch from 4a74aa1 to 7009cae Compare July 16, 2026 09:50
@aaditagrawal
aaditagrawal force-pushed the sync/20260716-mobile-desktop branch from 4025f28 to 1ced949 Compare July 16, 2026 09:50

aaditagrawal commented Jul 16, 2026

Copy link
Copy Markdown
Owner Author

Merge activity

  • Jul 16, 10:01 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 16, 10:06 AM UTC: Graphite couldn't merge this PR because it had merge conflicts.

@aaditagrawal
aaditagrawal changed the base branch from sync/20260716-mobile-desktop to graphite-base/158 July 16, 2026 10:04
@aaditagrawal
aaditagrawal changed the base branch from graphite-base/158 to main July 16, 2026 10:05
@aaditagrawal
aaditagrawal merged commit 715e170 into main Jul 16, 2026
21 of 23 checks passed
@aaditagrawal
aaditagrawal deleted the sync/20260716-workspace-roots branch August 1, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants