fix: new session inherits settings from active tab (#4019 & #4088)#4087
Closed
JesonChou wants to merge 1 commit into
Closed
fix: new session inherits settings from active tab (#4019 & #4088)#4087JesonChou wants to merge 1 commit into
JesonChou wants to merge 1 commit into
Conversation
EnsureBlankTab now inherits model, effort, mode, toolApprovalMode, disabledMCP, and mcpOrder from the currently active tab when creating a blank session. Previously model and effort were left empty (falling back to config defaults), mode was hardcoded to normal, and toolApprovalMode was hardcoded to ask. The indexed-topic fallback path (which used to delegate to OpenProjectTab/OpenGlobalTab and therefore bypass inheritance) now builds the tab inline so it receives the same inherited settings. Fork also now carries toolApprovalMode (the only setting missing from its carry-over set), so forked sessions preserve the same approval posture as the source. Result: clicking + on the tab bar, or forking a session, keeps the same model, effort, collaboration mode, tool-approval posture, and MCP state that the user already configured.
Closed
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.
Summary
Fixes #4019 and #4088 — clicking "New Session" (or the "+" tab button) in the desktop app created a blank tab with hardcoded defaults instead of carrying over the current session's model, effort, collaboration mode, and tool-approval posture.
Problem
When a user had model=deepseek-v4-pro, effort=max, and YOLO enabled in the current tab, clicking "New Session" would create a blank tab that did not inherit any of those settings:
Root Cause
EnsureBlankTab()indesktop/tabs.gocreated theWorkspaceTabstruct with hardcoded defaults and zero-value fields:No settings were carried over from the currently active tab. Additionally,
Fork()was missingtoolApprovalModefrom its carry-over set — every forked session silently reverted to "ask" approval.Changes
desktop/tabs.go—EnsureBlankTab(main fix)disabledMCP, andmcpOrderfrom the active tab before constructing the blankWorkspaceTab. Falls back to the previous hardcoded defaults only when no active tab exists (first launch).OpenProjectTab/OpenGlobalTab, which had their own hardcoded defaults. Both code paths share the same inherited variables, so the reuse path is no longer a gap.desktop/app.go—ForktoolApprovalModeto the carry-over set (model, effort, mode,disabledMCP, andmcpOrderwere already inherited).Affected code paths
Verification
go build ./...passes.