Skip to content

[Bug]: Mobile keeps New worktree default for non-git projects and cannot start a task #7926

Description

@andybergon

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

  1. Set the default thread env mode to New worktree (global setting, project setting, or t3.json).
  2. Add a project folder that is not a git repository.
  3. 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 2c4158f.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions