Skip to content

feat(composer): 记忆新会话的模型和思考等级 - #712

Open
hui455 wants to merge 4 commits into
vastsa:mainfrom
hui455:feat/remember-composer-model
Open

hui455 wants to merge 4 commits into
vastsa:mainfrom
hui455:feat/remember-composer-model

Conversation

@hui455

@hui455 hui455 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

问题与改动

最近使用模型已经由主分支提供,但切换模型或新建对话时,主动选择的思考等级仍会回到默认值。现在按供应商/模型分别记住思考等级,并在切回、新建对话和重启后恢复。

沿用主分支“成功发送才更新最近模型”的规则,不改变点击模型、浏览历史会话和最近模型排序的关系。显式草稿优先;没有记忆时保留当前模型默认值,恢复时校验支持档位。已有会话及权限保持原规则,Auto 权限不会带到新会话。

失败、审批阻塞及较早请求的晚到结果不会覆盖新的记忆;运行中接受的下一轮配置会记录。偏好保存在本机 localStorage,最多 100 组,损坏或不可用时安全回退。不改变 IPC、host RPC、Plugin SDK 或数据库结构。

界面效果

截图捕获于 Windows 完整应用 0.21.0-beta.1 功能候选、独立测试配置;回复来自本机模拟服务,未调用真实付费模型。操作:选择 GPT-5.4 mini / low,切换模型往返,发送一条消息,再新建项目会话;新会话和重载后均恢复 mini / low。

完整界面:
新会话恢复模型和思考等级

修改位置特写(同一张截图裁切放大):
Composer 模型和 low 思考等级

验证

  • 基线 efef49bbe 的同一回归返回 high,功能候选恢复 low。
  • 40 项定向测试通过,覆盖偏好读取、会话创建、模型使用历史、失败/过时写入及权限隔离。
  • JS 与 Rust host-core 构建通过。
  • 完整应用已验证模型往返、真实 IPC/host/runtime 调用本机服务、新建项目会话与 renderer 重载。
  • 在合入最新 main 的最终候选上重新通过 pnpm build:js、两个 Composer E2E、Desktop typecheck、pnpm lint 和 pnpm docs:check。

未验证原生 macOS/Linux。复用 #678;本次不涉及权限记忆。

Refs #678

当前集成验证

最终提交 05c649f0b1f03f68bfed5ffe5841f6bea5b7679e 包含 main 4f9f051e54c495ac0c5164f2ef4dd687c704bc11。GitHub merge ref 9d2aff522d7a747c05c76b5814b5a3191b2e4633 与已验证候选的代码树完全一致(fb7c7f9c0cb5916a8145284c512524fe381d1299),复用相同代码树的 E2E 结果。截图保留上述捕获版本;后续上游合入未改变本 PR 的思考等级记忆逻辑。

远端“Head contains latest base”已通过,其余 CI 正在运行,最终结果以本 PR Checks 为准。

Keep explicit Composer selections available to subsequent conversations
without rewriting global defaults or propagating session permissions.
Restore reasoning preferences per provider and model, with validated
fallbacks and protection against stale configuration completions.

Refs vastsa#678
@Tioit-Wang

Copy link
Copy Markdown
Collaborator

感谢这个 PR——也抱歉让你等了一段时间。

这个改动看起来做得不错,唯一缺的是视觉证据:由于这次改动涉及界面,仅凭 diff 我们没法判断实际效果。

方便的话,请在描述中补充两张截图:

  • 完整的界面截图:展示改动在实际界面中的位置与整体效果——输入框上模型与思考等级的记忆状态。
  • 修改位置的特写截图:裁切放大改动的具体位置,便于看清新增的显示。

补充之后,我们就能看到真实效果,并放心判断是否合并。

Integrate the existing preference PR with usage-based model inheritance
without restoring a competing model-selection history. Keep reasoning
choices isolated per provider/model across new chats and restarts.

Preserve current defaults and permission boundaries, and cover accepted,
failed and superseded configuration writes.
Keep the existing PR history intact while incorporating the main update
that arrived during final validation. This synchronization changes no
reasoning-memory behavior and avoids rewriting the original PR commits.
Refresh the existing PR candidate with the latest upstream UI and release
changes before rerunning integration checks. Preserve all previously
reviewed commits without rewriting shared history.
@hui455

hui455 commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

感谢你百忙之中还抽空回看我之前提交的 PR,也谢谢你的肯定和建议!我已按建议在这个 PR 的描述中补充完整界面截图和 Composer 局部特写,展示新会话恢复模型与思考等级的效果。同时同步了最新 main 并处理冲突,沿用主分支现有的最近使用模型规则,补齐按模型记忆思考等级的部分。相关验证结果也已更新在描述中,方便时再麻烦你看一下,谢谢!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants