Repository navigation
fix(app): name a sandbox's project after its folder, and explain the field - #223
Merged
Merged
Conversation
…field Two things about the project folder were left to be discovered. Inside a sandbox the folder is mounted at a fixed guest path, so the project read "workspace" in the sidebar, tabs and command palette — the same label for every sandbox on the machine, with nothing anywhere tying one back to the host folder it works on. Name it after that folder instead, written through client.project.update (the call behind rename-project) so the name persists in the guest and reaches every surface. Only ever when the project has no name: a name the user chose must survive the next launch. Carrying it needs the host path on the connection, so the sandbox sidecar variant gains projectDir. The Add sandbox dialog asked for a folder with no indication that it is the only part of the machine the sandbox can reach, that it cannot be changed afterwards, or that the agent edits files in it without asking. Say so above the field. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
quickbeard
force-pushed
the
sandbox-folder-clarity
branch
from
August 13, 2026 09:08
734ba04 to
e4f613e
Compare
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.
Two things about a sandbox's project folder were left to be discovered.
The
workspacelabelInside a sandbox the folder is mounted at a fixed guest path, so
displayName(project.name || getFilename(worktree)) fell back to the basename of/workspace. Every sandbox on the machine showed the same meaningless label in the sidebar, tabs and command palette, and nothing anywhere tied one back to the host folder it works on — which reads as "the sandbox ignored the folder I chose".It doesn't. Verified on a live sandbox: guest
/workspacehas the same files as its host folder, same git branch, writable. Only the label was wrong.Each sandbox now names its project after the folder it was created with, so a sandbox on
~/repos/codev-hubreads codev-hub. Written throughclient.project.update— the call behind rename-project — so the name persists in the guest and reaches every surface, rather than being patched into each of the manydisplayNamecall sites.Two rules: only when the project has no name (a name the user chose must survive the next launch), and once per run, since the rename lands back as a
project.updatedevent and the effect can re-run before it arrives. A failed rename is retried rather than swallowed.Carrying the host path needs it on the connection, so the sandbox sidecar variant gains an optional
projectDir, populated inreadySandboxConnections.The unexplained field
The dialog asked for a folder with no indication of what it commits you to: it's the only part of the machine the sandbox can reach, it's fixed for the sandbox's lifetime, and the agent edits files in it without asking (sandboxes inject
permission: "allow"). Now stated above the field,enandes.The field stays mandatory and is deliberately not prefilled — picking a folder should be a decision, not a default someone clicks past.
Verification
Five new tests in
test-browser/sandbox-projects.test.ts, on top of the six from #221: names from the host folder, takes the last segment of a Windows path (WSL sandboxes get a WindowsprojectDir), never renames over a user's name, does nothing before the server reports a project, renames once across effect re-runs, and retries after a failure.bun typecheck+bun run test:unit(657) +bun run test:browser(57) clean inpackages/app;bun typecheckclean inpackages/desktop.Note for existing sandboxes
The name is applied on next launch. Two sandboxes on this machine also carry a stale
/home/codev/.cache/codevproject row — leftovers from the picker opening on the guest home before #221 seeded the real project. Those are user data, so nothing here removes them; close the row to clear it.🤖 Generated with Claude Code