Coder default project_root: $TMPDIR scratch dir (cross-platform, auto-created)#174
Merged
seamus-brady merged 1 commit intomainfrom Apr 26, 2026
Merged
Conversation
Followup to the project-root self-edit hotfix. The previous fix made
`[coder] project_root` mandatory, but that's too much friction —
operators shouldn't have to write a config line just to use the
defaulted-everything-else coder.
New behaviour: when project_root isn't configured, default to
`${TMPDIR}/springdrift-coder-workspace` (auto-created on first
boot). Cross-platform:
* macOS: $TMPDIR is set per-user (e.g.
/var/folders/.../T/), kernel-managed, persistent across reboots
* Linux: $TMPDIR usually unset; fall back to /tmp/
Trailing slashes are stripped so the join produces a single
separator regardless of OS.
The temp dir is structurally disjoint from cwd, so it can never
contain the running agent's .springdrift/ data — the safety guard
from the prior hotfix still runs, but now never fires for the
default. Operators with a real project repo override via
`[coder] project_root = ...` exactly as before.
Build clean, format clean, 2190 tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to PR #173. That fix made
[coder] project_rootmandatory after dropping the cwd fallback — too much friction for the operator who's just trying to use the defaulted-everything-else coder.This PR restores the "just works" experience without the self-edit footgun:
$TMPDIR/springdrift-coder-workspace(e.g./var/folders/.../T/springdrift-coder-workspace). $TMPDIR is per-user and kernel-managed./tmp/springdrift-coder-workspace.Auto-created with
simplifile.create_directory_all. Stable across restarts of the same instance so the coder remembers previous commits inside the workspace.The safety guard from #173 (
project_root_safe) still runs and structurally still works — but the default path is structurally disjoint from cwd, so it can never contain the running agent's.springdrift/data and the guard never fires for the default.Test plan
gleam buildcleangleam formatcleangleam test— 2190 passingproject_root=/var/folders/.../T/springdrift-coder-workspaceproject_root=/tmp/springdrift-coder-workspace[coder] project_root = "/Users/x/some-project", confirm it's used🤖 Generated with Claude Code