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

@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: a7992d2

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
Comment thread src/utils/session-store.ts
Comment thread src/utils/session-store.ts
Comment thread src/utils/xcodebuild-pipeline.ts
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
…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.
The header fallback now reads derivedDataPath from the session store
so the displayed path matches the actual build location when using
workspace-scoped DerivedData.
… 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.
@codeman9 codeman9 force-pushed the feat/per-workspace-derived-data branch from f8e5036 to a7992d2 Compare April 20, 2026 22:08
@codeman9
Copy link
Copy Markdown
Contributor Author

codeman9 commented Apr 21, 2026

@cameroncooke Warden seems to be failing on a get secrets step. Not sure if there is anything I need to do.

@cameroncooke
Copy link
Copy Markdown
Collaborator

@codeman9 yeah, that's a known issue. You can ignore it. I will merge it in at the next available opportunity. I'm just doing a large refactor, so there's a merge freeze at the moment.

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

2 participants