Skip to content

Handle non-git drafts in local mode#1930

Draft
SAKETH11111 wants to merge 2 commits intopingdotgg:mainfrom
SAKETH11111:fix-non-git-draft-local-mode
Draft

Handle non-git drafts in local mode#1930
SAKETH11111 wants to merge 2 commits intopingdotgg:mainfrom
SAKETH11111:fix-non-git-draft-local-mode

Conversation

@SAKETH11111
Copy link
Copy Markdown

@SAKETH11111 SAKETH11111 commented Apr 11, 2026

Closes #1914

What was broken

Draft threads could stay in New worktree mode for directories that are not Git repositories. On the first send, that pushed users into the base-branch guard even though the project could only run locally.

Root cause

The draft env-mode resolver treated persisted worktree mode as authoritative without considering the active project's Git status, so non-git drafts kept a worktree-only send path.

What changed

  • fall back to local mode when the active project is known to be non-git
  • normalize draft thread state away from stale worktree metadata for non-git projects
  • add regression coverage for the shared env-mode resolver and the browser send flow

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 11, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b0d2da05-8f03-4040-b3e4-a5e2323a624d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Apr 11, 2026
@SAKETH11111 SAKETH11111 force-pushed the fix-non-git-draft-local-mode branch from 8f78b0a to 6aa1871 Compare April 11, 2026 15:08
@github-actions github-actions bot added size:M 30-99 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Can't launch thread in non git directory, when new worktree is set to default.

1 participant