Repository navigation
fix(mobile): fall back to current checkout for non-git projects - #7927
andybergon wants to merge 4 commits into
Conversation
A project that is not a git repository cannot host a worktree, yet the mobile new-task flow kept the New worktree default and disabled Start because no base branch exists. Desktop already resolved this to local in resolveSendEnvMode. Move that rule into @t3tools/shared so both clients share it, apply it to the mobile draft, send, and outbox paths, and hide the branch control when the project is not a repository. A connected worktree send now waits for the project's git status instead of trusting the provisional repo default, a non-repository clears stale branch and worktree metadata, and the outbox drain re-checks the repository before replaying a queued worktree task so it drains as local. Closes pingdotgg#7926
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1664926. Configure here.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — The PR is a focused mobile bug fix that enables existing task creation for non-git projects, with conditional VCS checks and outbox safeguards. Existing defaults and ordinary git/local paths remain intact, and the supporting behavior is covered by targeted tests. Notes:
You can add or adjust custom eligibility rules. Learn more. |
Treat the skipped VCS query for a queued-task stand-in as complete so an existing branch selection does not leave Start disabled forever.
Prevent a stalled repository query from blocking the global mobile outbox and cover queued mode fallback for known non-repositories.
|
Note 🤖 GPT-6 Astra (preview) responding on behalf of Theo This note is part of an automated cleanup pass. Preserving these details from items reviewed in the cleanup pass. Preserve the offline display behavior from #8791 at its head commit. Its unfiltered Carryover from #5907 at b42e30c422: once status establishes that a project is not a Git repository, disable its |
|
Note 🤖 GPT-6 Astra responding on behalf of Theo We're closing this as part of a cleanup of stale PRs. Thank you for the time and care you put into this contribution. A local merge check found conflicts in 10 files against the current target branch. The latest implementation commit is from 2026-08-24, and there has been no contribution update in over a week. At this point, regenerating a focused patch against the current intended base would be easier to review and maintain than updating this PR. We appreciate the work and will keep this thread as a reference. If you revisit it, please check the current direction with us and link the fresh PR back here. |

Closes #7926
Android before and after
Problem
With the default thread env mode set to New worktree, the mobile new-task flow cannot start a task for a project that is not a git repository: the branch control shows
Choose branchwith nothing to choose and Start stays disabled. Desktop already resolves this case to Current checkout throughresolveSendEnvMode; mobile resolved its default without looking at the project's git status.Fix
resolveSendableThreadEnvModeto@t3tools/shared/threadEnvModeand make the webresolveSendEnvModedelegate to it, so both clients apply the same rule.new-task-flow-provider.tsxreads the project'svcs.statusbefore resolving the workspace mode, exposesisGitRepoandgitStatusSettled, and clears stale branch and worktree metadata for a non-repository.NewTaskDraftScreen.tsxapplies the same fallback on the send path, disables the workspace toggle with a matching accessibility hint, and hides the branch control when the project is not a repository. A connected worktree send waits for the git status to settle instead of trusting the provisional default; offline queueing still works.use-thread-outbox-drain.tsre-checks repository status before replaying a queued worktree task, bounds that query to 10 seconds so one hung read cannot block the global outbox, preserves worktree mode when status is unknown, routes known non-repositories through the shared fallback, and re-confirms the exact queued payload plus edit lock after the await so a saved edit cannot dispatch stale text or attachments.Verification
vp test run packages/client-runtime/src/state/runtime.test.ts apps/mobile/src/state/thread-outbox.test.ts packages/shared/src/threadEnvMode.test.ts apps/mobile/src/features/threads/projectThreadCreationValidation.test.ts: 4 files and 55 tests passed. After the latest review,vp test run apps/mobile/src/state/thread-outbox.test.ts: 1 file and 22 tests passed.packages/shared,apps/web, andapps/mobilefor the original fix. Mobile and client-runtime typechecks passed again after the bounded-query review follow-up. Mobile typecheck, targeted lint, and format passed again after the stale-payload guard.Claude Fable 5 in Claude Code, with three Codex review passes.
🤖 Generated with Claude Code
Note
Medium Risk
Touches thread creation and outbox drain: worktree tasks can be rewritten to local after a VCS check, and query timeouts now interrupt atom queries. A hung status read can delay a queued worktree send by up to 10s.
Overview
Mobile new-task no longer gets stuck in worktree mode for projects that are not git repos. Shared
resolveSendableThreadEnvModeforceslocalwhenisGitRepois false; webresolveSendEnvModenow uses the same helper.The composer reads VCS status, treats repo as true until status settles (to avoid a checkout flash), then hides the branch picker and disables the workspace toggle. Connected worktree sends wait for status; offline queueing still works. Stale branch/worktree metadata is cleared for non-repos.
Queued worktree creations re-check repo status on drain (10s query timeout). Known non-repos drain as local; unknown status keeps the queued mode. After the await, drain re-confirms the payload so an in-flight edit is not sent.
executeAtomQuerygains optionaltimeoutMs.Reviewed by Cursor Bugbot for commit 4933663. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix mobile worktree mode to fall back to local for non-git projects
resolveSendableThreadEnvModewhich coerces worktree mode tolocalwhenisGitRepois false; web and mobile clients route send paths through this single decision pointNewTaskFlowProviderqueries VCS status for the selected project, exposesisGitRepoandgitStatusSettledto consumers, and clearsselectedBranchName/selectedWorktreePathfor non-reposNewTaskDraftScreenhides the branch picker and disables the workspace toggle for non-repo projects, and blocks sending when git status is unsettled while connecteduseThreadOutboxDrain) reads VCS status with a 10s timeout before sending queued worktree messages, coercing to local and clearing branch/worktree for known non-repos; skips dispatch if the message enters edit state during the awaitexecuteAtomQuerygains optionaltimeoutMsthat interrupts the query viaEffect.interrupton timeoutexecuteAtomQuerynow maps timeouts to interrupted failures — callers checking for interruption may see timeout-induced interrupts; the new 10s VCS status timeout inuseThreadOutboxDraincould delay queued worktree sends by up to 10s before fallback📊 Macroscope summarized dd7f915. 4 files reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted
🗂️ Filtered Issues