[Bug]: Mobile keeps New worktree default for non-git projects and cannot start a task
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/mobile
Steps to reproduce
- Set the default thread env mode to New worktree (global setting, project setting, or
t3.json). - Add a project folder that is not a git repository.
- On mobile, open New task for that project and type a prompt.
Expected behavior
The draft falls back to Current checkout, the same as desktop. A worktree cannot exist without a git repository, so worktree mode should never be the resolved default for a non-git project.
Actual behavior
The workspace control stays on New worktree, the branch control shows Choose branch with nothing to choose, and Start stays disabled.
Desktop already handles this case: resolveSendEnvMode in apps/web/src/components/ChatView.logic.ts returns local when isGitRepo is false (#1914, #1936). Mobile resolves the default in apps/mobile/src/features/threads/new-task-flow-provider.tsx through resolveDefaultThreadEnvMode without checking isRepo, although it already queries vcsEnvironment.status for the project. NewTaskDraftScreen.tsx then blocks the send on workspaceMode === "worktree" && !selectedBranchName, and a task queued offline in that state stays parked in the outbox.
The comment in packages/shared/src/threadEnvMode.ts says both platforms must agree on the resolved mode. The non-git fallback only exists on web today.
Impact
Minor bug or occasional failure
Version or commit
Server: T3 Code (Nightly) 0.0.34-nightly.20260821.1147. Mobile: Android client, current build as of 2026-08-22. Source checked on main at 2c4158f87a.
Environment
macOS server, Android client
Logs or stack traces
No response
Screenshots, recordings, or supporting files
No response
Workaround
Tap the workspace toggle to Current checkout before sending, or set that project's default thread env mode to local.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/mobile/src/features/threads/new-task-flow-provider.tsx, then compare its default resolution with resolveSendEnvMode in apps/web/src/components/ChatView.logic.ts. Check the existing vcsEnvironment.status data for non-git projects and verify that NewTaskDraftScreen.tsx can start a task and queue it offline with Current checkout selected automatically.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 86/100