Files
X-Financial/document/development/2026-07-18/dev-logs/bugs/settings-model-draft-reconciliation.md

15 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 设置草稿覆盖服务端模型集合
日期2026-07-18
文档路径document/development/2026-07-18/dev-logs/bugs/settings-model-draft-reconciliation.md
## 修复记录
- 16:03记录 bug 修复:设置页本地会话草稿会整体覆盖服务端模型列表,保存任一设置时可能误删服务端新增槽位,或复活已删除槽位。
- Git 提交检查:沿用本轮 15:54 拉取检查upstream `origin/main` 无新提交,本地 ahead 19 条,最新为 `07241b46 fix(docker): manage local postgres in default compose``787bc3a4 feat(platform): close AI expense value loop``242d68c3 feat(approval): add task workflow and waiver decisions`,另有 16 条。
- 原因:加载时先用 session 草稿的 `models` 整体覆盖服务端集合,后续只同步现存行的密钥状态;后端保存完整 `llmForm` 时会把缺失的自定义槽位视为删除。
- 修改:以服务端快照的模型集合为权威来源,仅按同一 slot 保留当前内存中未提交且不是掩码的 API Key 输入;服务端新增槽位自动补入,服务端删除槽位不再保留;首次异步加载也保护用户请求期间输入的密钥。
- 操作:在 `local-x-financial-linux` 容器内运行新增/删除自定义槽位、未提交输入和权威状态合并测试,并执行前端全量回归与生产构建。
- 验证:定向测试 22 项、前端全量测试 `823/823` 全部通过Vite 生产构建成功,`git diff --check` 通过。
- 影响:设置页不会因陈旧浏览器草稿静默改变服务端模型清单,降低误删模型配置和检索能力中断风险。