fix(chat): New chat always creates, on the current branch - #5231
Merged
Conversation
Two fixes to the New chat button: - It ALWAYS creates a fresh thread (removed the empty-chat reuse short-circuit from both entry points — header NewChatCrumb + sidebar handleNewThread); it no longer navigates to / reuses an existing empty "New chat". (Dropped the dead isThreadEmpty helper + its MCP client.) - The new thread inherits the branch/sandbox being viewed instead of the hardcoded staging default: createNewTask threads the branch through (panel-actions + keyboard paths). No backend change — the wire schema already accepts `branch`. "Open agent X" flows are untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 24, 2026
Merged
decocms Bot
pushed a commit
that referenced
this pull request
Jul 25, 2026
PR: #5231 fix(chat): New chat always creates, on the current branch Bump type: patch - decocms (apps/api/package.json): 4.126.3 -> 4.126.4 Deploy-Scope: web
pedrofrxncx
pushed a commit
that referenced
this pull request
Jul 27, 2026
Resolved 3 conflicts toward main's post-branch work: - use-layout-state.ts / shell-layout.tsx: keep #5231's caller-passed `branch` param over the branch's parallel readCachedTaskBranch path. main's callers already omit the branch on agent-switch, which is the same guarantee the branch's carryBranch gate provided. - connection-tools.integration.test.ts: keep userModelPreferences stub, drop agentSandboxSessions (storage class removed by the revert).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Google.Chrome.mp4
New-chat behavior fixes (split out of #5215).
NewChatCrumb+ sidebarhandleNewThread); it no longer navigates to / reuses an existing empty "New chat". Dropped the now-deadisThreadEmptyhelper + its MCP client.stagingdefault —createNewTaskthreads the branch through (panel-actions + keyboard-shortcut paths). No backend change (the wire schema already acceptsbranch). "Open agent X" flows are untouched.tsc+ oxlint clean.🤖 Generated with Claude Code
Summary by cubic
New Chat now always creates a new thread and inherits the branch you're viewing, so it opens in the same sandbox.
branchintocreateNewTask(panel actions + keyboard path); server default applies when absent.isThreadEmptyand its MCP client.Written for commit 5cfd180. Summary will update on new commits.