Skip to content

fix(desktop): new session inherits settings from active tab (#4019, #4088)#4097

Merged
esengine merged 2 commits into
main-v2from
fix/4019-new-session-inherit
Jun 12, 2026
Merged

fix(desktop): new session inherits settings from active tab (#4019, #4088)#4097
esengine merged 2 commits into
main-v2from
fix/4019-new-session-inherit

Conversation

@esengine

Copy link
Copy Markdown
Owner

Lands @JesonChou's fix from #4087 (via origin so required checks run on the protected branch) plus a regression test.

Fix (by @JesonChou, #4087)

Clicking "New Session" / the "+" tab button created a blank tab with hardcoded defaults instead of carrying over the active tab's model, effort, mode, tool-approval, and MCP state.

  • EnsureBlankTab now inherits model / effort / mode / toolApprovalMode / disabledMCP / mcpOrder from the active tab, falling back to the old defaults only on first launch (no active tab).
  • The indexed-blank-topic reuse path builds the tab inline instead of delegating to OpenProjectTab / OpenGlobalTab, which carried their own hardcoded defaults — so that bypass no longer drops the inherited settings.
  • Fork gained the missing toolApprovalMode carry-over (forks previously reverted to "ask").

Added test

desktop/new_session_inherit_test.go asserts a blank tab opened from an active session inherits effort, mode, tool-approval, and MCP state instead of falling back to defaults. Mutation-checked — disabling the inherit block fails the test.

Closes #4087
Closes #4019
Closes #4088

JesonChou and others added 2 commits June 12, 2026 09:12
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.
Regression for #4019/#4088: a blank tab opened from an active session
must inherit effort, mode, tool-approval, and MCP state instead of
falling back to hardcoded defaults. Mutation-checked — disabling the
inherit block fails this test.
@esengine esengine requested a review from SivanCola as a code owner June 12, 2026 02:14
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) labels Jun 12, 2026
@esengine esengine merged commit 8f59fe1 into main-v2 Jun 12, 2026
14 checks passed
@esengine esengine deleted the fix/4019-new-session-inherit branch June 12, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 设置默认模型不生效 [Bug]: 新会话没有使用默认模型

2 participants