Fix member models incomplete - #972
Merged
xiaomakuaiz merged 2 commits intoAug 2, 2026
Merged
Conversation
服务端有、同步过来没有,查下来是三处各自静默丢条目:
1. 归属缺失即丢。后端 Model.Owner 是 omitempty,且只在模型挂着 user 边时
才填(backend domain/model.go Model::From),而会员内置模型走内部 hook,
那一层不保证带上。壳这边第一道判定就要求 owner.type ∈ {public,private,
team},否则 continue——无 note、无计数,凭空消失。改为 owner 整个缺席按
public 收(UI 的 memberCategory 早就把无 owner 归「付费」,两侧口径对齐),
只有认不出的归属类型才跳过且出 note。
2. 同批重名即丢。会员条目的名字取自 remark(后台人起的备注),重复很正常,
撞了就丢第二条。现在原样收下,靠服务端配置 id 区分(见下)。
3. 跨来源重名即丢。名字是引擎寻址键(settings.models 以名字为键),
replaceSourceGroup 跨组撞名先到先得,百智云那路往往先落地,同名的会员
条目整条跳过。而两边目录撞名是常态——同一批底座模型,remark 起的名字
往往一模一样。
后两条同一个解法:同步条目的落盘名带后缀,展示层一律剥掉。
百智云: <模型id>@baizhi
MonkeyCode: <备注名>@monkeycode#<服务端配置id>
恒定加、不按"撞了才加":后缀若取决于同批/对面组此刻有没有同名条目,名字就会
随目录增删漂移,而会话与记忆都按名引用,漂移即失联。id 由条目自身决定,既
唯一又稳定。百智云条目的 name 本就是模型 id,组内天然唯一,不再缀 id。
展示面全部走 stripSourceSuffix:设置页行名与名称输入框(剥后缀显示、写回
自动补回,不变量不靠用户维持)、选择器条目与触发器、两处 tooltip、四条报错
文案、搜索匹配。
存量引用的兜底(升级后第一次同步会重命名所有同步条目):壳侧 model_id_of
精确没中时按剥后缀比对——漏了会员条目的 `#id` 尾巴就等于所有绑会员模型的
老会话开不起来;UI 侧默认项定位、modelMenuList、modelDisplayByName、会话
模型解析、lastTaskModel 记忆同款。两侧剥法口径一致(`#` 之后放行,id 的
字符集不归壳管)。
顺带:模型清单显式要 limit=200(服务端缺省 100),还有下一页出 note;
归属不明/占位残缺各出一条计数,同步条数对不上时消息里说得清差额去哪了
(服务端标隐藏的静默跳过——那是刻意不给用户看的,报数只是噪音)。
已知:两条同名的会员模型在界面上完全一样(展示名与药丸全同),底层模型串
不同但未外显;在服务端改备注名会换掉 alias,老会话靠上面那条宽松匹配兜。
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.
No description provided.