Skip to content

feat(session): auto-scope DerivedData per workspace/project path#341

Open
codeman9 wants to merge 4 commits intogetsentry:mainfrom
codeman9:feat/per-workspace-derived-data
Open

feat(session): auto-scope DerivedData per workspace/project path#341
codeman9 wants to merge 4 commits intogetsentry:mainfrom
codeman9:feat/per-workspace-derived-data

Conversation

@codeman9
Copy link
Copy Markdown
Contributor

When derivedDataPath is not explicitly set but workspacePath or projectPath is known in session defaults, the session store now computes a workspace-scoped subdirectory under the default DerivedData root using a <name>-<hash> scheme (e.g. MyApp-4ee6552f04c9).

This prevents concurrent MCP sessions (or CLI invocations) building different clones of the same project from colliding on a shared build directory. Previously all sessions shared a single flat ~/Library/Developer/XcodeBuildMCP/DerivedData, which caused corrupted incremental builds when multiple agents worked on separate clones in parallel.

The isolation is handled entirely in the session store's getAllForProfile() as a computed default. resolveEffectiveDerivedDataPath and all tool implementations are unchanged. An explicitly set derivedDataPath (via session defaults or env var) always takes precedence.

Closes #340

When derivedDataPath is not explicitly set but workspacePath or
projectPath is known, the session store computes a workspace-scoped
subdirectory under DerivedData using a name+hash scheme (e.g.
MyApp-4ee6552f04c9). This prevents concurrent sessions building
different clones of the same project from colliding on a shared
build directory.

Closes getsentry#340
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 15, 2026

Open in StackBlitz

npm i https://pkg.pr.new/xcodebuildmcp@341

commit: f8e5036

Comment thread src/utils/session-store.ts Outdated
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a720f17. Configure here.

Comment thread src/utils/session-store.ts
…ed state

Internal read-then-write operations (setDefaultsForProfile,
clearForProfile) now use getRawForProfile to avoid persisting the
computed derivedDataPath. This ensures the value is recomputed
when workspacePath or projectPath changes.
Comment thread src/utils/session-store.ts
The header fallback now reads derivedDataPath from the session store
so the displayed path matches the actual build location when using
workspace-scoped DerivedData.
Comment thread src/utils/session-store.ts
Comment thread src/utils/xcodebuild-pipeline.ts
… summary

Same issue as the pipeline header — formatToolPreflight falls back to
the flat default when derivedDataPath is not in the preflight params.
Now reads from the session store as a fallback.
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.

Isolate DerivedData per workspace to avoid conflicts with concurrent sessions

1 participant