The best way to control Claude Code, Codex and more from any computer or phone
fix(web): No project threads in New worktree mode send without a base branch (#37392)
Julius Marminge committed
Nov 15, 2026 at 15:25 UTC
06150a08ec7be71f6741de519cc20cfb8034cf3d
4 files changed
+15
-1
apps/web/src/components/ChatView.logic.test.ts
+7
@@ -1321,6 +1321,7 @@ describe("planComposerTurn", () => {
1321
sendEnvMode: "worktree" as const,
1322
worktreePath: null,
1323
activeThreadBranch: "main",
1324
+ isScratchProject: false,
1325
resumeCompactionTokens: null,
1326
keepFullHistory: false,
1327
phase: "ready" as const,
@@ -1341,6 +1342,12 @@ describe("planComposerTurn", () => {
1342
missingWorktreeBaseBranch: true,
1343
baseBranchForWorktree: null,
1344
});
1345
+ expect(
1346
+ planComposerTurn({ ...base, activeThreadBranch: null, isScratchProject: true }),
1347
+ ).toMatchObject({
1348
+ missingWorktreeBaseBranch: false,
1349
+ baseBranchForWorktree: null,
1350
+ });
1351
});
1352
1353
it("queues behind a compaction of a stale session, except for /compact itself", () => {
apps/web/src/components/ChatView.logic.ts
+4
-1
@@ -1343,6 +1343,8 @@ export function planComposerTurn(input: {
1343
readonly sendEnvMode: DraftThreadEnvMode;
1344
readonly worktreePath: string | null;
1345
readonly activeThreadBranch: string | null;
1346
+ /** The server launches a No project worktree request at its root, so it needs no base. */
1347
+ readonly isScratchProject: boolean;
1348
readonly resumeCompactionTokens: number | null;
1349
readonly keepFullHistory: boolean;
1350
readonly phase: SessionPhase;
@@ -1369,7 +1371,8 @@ export function planComposerTurn(input: {
1371
return {
1372
// In worktree mode, require an explicit base branch so we don't silently
1373
// fall back to local execution when branch selection is missing.
1372
- missingWorktreeBaseBranch: shouldCreateWorktree && !input.activeThreadBranch,
1374
+ missingWorktreeBaseBranch:
1375
+ shouldCreateWorktree && !input.activeThreadBranch && !input.isScratchProject,
1376
baseBranchForWorktree: shouldCreateWorktree ? input.activeThreadBranch : null,
1377
compactBeforeSend,
1378
turnDispatchMode:
apps/web/src/components/ChatView.tsx
+1
@@ -2937,6 +2937,7 @@ export default function ChatView(props: ChatViewProps) {
2937
activeThreadKey,
2938
activeThreadBranch,
2939
activeProject,
2940
+ activeProjectIsScratch,
2941
activeProjectDefaultModelSelection,
2942
activeMessageCount,
2943
isServerThread,
apps/web/src/components/chat/useComposerSend.ts
+3
@@ -176,6 +176,7 @@ interface ComposerSendInput {
176
readonly activeThreadKey: string | null;
177
readonly activeThreadBranch: string | null;
178
readonly activeProject: EnvironmentProject | null;
179
+ readonly activeProjectIsScratch: boolean;
180
readonly activeProjectDefaultModelSelection: ModelSelection | null;
181
readonly activeMessageCount: number;
182
readonly isServerThread: boolean;
@@ -276,6 +277,7 @@ export function useComposerSend(input: ComposerSendInput) {
277
activeThreadKey,
278
activeThreadBranch,
279
activeProject,
280
+ activeProjectIsScratch,
281
activeProjectDefaultModelSelection,
282
activeMessageCount,
283
isServerThread,
@@ -814,6 +816,7 @@ export function useComposerSend(input: ComposerSendInput) {
816
sendEnvMode,
817
worktreePath: activeThread.worktreePath,
818
activeThreadBranch,
819
+ isScratchProject: activeProjectIsScratch,
820
resumeCompactionTokens,
821
keepFullHistory,
822
phase,