🤖 fix: allow non-git directories and clarify trunk branch requirement #1068
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
Two issues addressed:
1. Trunk branch warning was confusing on local workspaces
Local runtime doesn't use trunk branch at all (it works directly in the project directory). The trunk branch selector was already hidden for local runtime, but the backend still required a trunk branch value - this led to confusing validation errors.
Fix: Made
trunkBranchoptional in the API. Backend now only validates trunk branch for worktree/SSH runtimes that actually need it.2. Git repo requirement was unnecessary
Users should be able to add any directory as a project, even if it's not a git repository. Non-git directories are perfectly valid for local runtime which just runs Claude in the directory.
Fix:
validateProjectPathisGitRepositoryhelper to check git status separatelylistBranchesreturns empty array (not error) for non-git reposChanges
src/common/orpc/schemas/api.tstrunkBranchoptionalsrc/common/orpc/schemas/message.tsrecommendedTrunknullablesrc/node/utils/pathUtils.tsisGitRepositoryhelpersrc/node/services/projectService.tssrc/node/services/workspaceService.tssrc/browser/components/RuntimeIconSelector.tsxdisabledModesprop with tooltipsrc/browser/components/ChatInput/CreationControls.tsxTesting
pathUtils.test.ts- validates non-git directories passprojectCreate.test.ts- validates non-git projects work with local runtimeGenerated with
mux