groups: WorkBuddy AI's deepseek-v4.1-flash-sg merges with WorkBuddy's deepseek-v4.1-flash (Kts6M2fwWN43967 on X)

Qoder, Qoder CN and Trae merge by one model id: a found group is every
model more than one provider serves under the same id (autoGroups,
mergeKey), with no pairing of editions anywhere. WorkBuddy AI's account
lists deepseek-v4.1-flash under its paid id, deepseek-v4.1-flash-sg (the
owner's plugin-providers.json has only that one), so the two editions'
one model stayed two rows. mergeKey now reads a small table of editions'
twins (editionTwins) after the user's own same-as; it holds that one pair.

Run: TestAutoGroupsEditionTwins (red with the table entry removed, green
with it), TestAutoGroups*, TestGroupImages* through mote-run.
Not tried: a real WorkBuddy AI account's picker. The other id gaps in the
owner's lists (WorkBuddy kimi-k3-1 vs AI kimi-k3, auto vs default-model)
are not known to be one model and are left.
This commit is contained in:
yetone
2026-11-11 05:42:37 +08:00
parent 87dfc0d0b8
commit 9522288b13
2 changed files with 37 additions and 0 deletions
+15
View File
@@ -828,9 +828,24 @@ func mergeKey(pid, model string, same map[string]string) string {
if v := same[pid+"/"+model]; v != "" {
return sameModel(v)
}
if v := editionTwins[pid+"/"+model]; v != "" {
return sameModel(v)
}
return sameModel(model)
}
// editionTwins are the models a vendor's international edition lists
// under another id than its China edition does, which are the same model:
// the found groups merge each with its twin, as they merge Qoder's and
// Trae's two editions by their one id (Kts6M2fwWN43967 on X: WorkBuddy and
// WorkBuddy AI stayed two rows). The user's own "same as" (ModelSameAs)
// is read first. WorkBuddy AI lists deepseek-v4.1-flash under its paid
// id, -sg, which the product config names as the free id's paid id
// (allowPaidSwitch), so a signed-in account may list that one alone.
var editionTwins = map[string]string{
"workbuddy-ai/deepseek-v4.1-flash-sg": "deepseek-v4.1-flash",
}
// AutoStandIn is the model a request for a group magpie found goes to while
// such groups are off (SetAutoGroups), or once the providers the user keeps
// out of them (SetAutoGroupSkip) took it away: its model, from the first
+22
View File
@@ -138,3 +138,25 @@ func TestGroupSharesKimiFacts(t *testing.T) {
t.Errorf("got %+v, want %+v", got, want)
}
}
// WorkBuddy AI lists deepseek-v4.1-flash under its paid id, -sg, so the
// two editions' one model merged by id alone stayed two (Kts6M2fwWN43967
// on X). The twin joins the group; another vendor's -sg id, and WorkBuddy
// AI's other models, are unchanged.
func TestAutoGroupsEditionTwins(t *testing.T) {
e := func(p, m string) Entry {
return Entry{ID: p + "/" + m, Model: m, Name: "DeepSeek-V4.1-Flash", Provider: Provider{ID: p}}
}
gs := autoGroups([]Entry{e("workbuddy", "deepseek-v4.1-flash"), e("workbuddy-ai", "deepseek-v4.1-flash-sg")}, nil)
if len(gs) != 1 || gs[0].ID != "auto-deepseek-v4-1-flash" || len(gs[0].Members) != 2 {
t.Fatalf("groups: %+v", gs)
}
if gs := autoGroups([]Entry{e("workbuddy", "deepseek-v4.1-flash"), e("other", "deepseek-v4.1-flash-sg")}, nil); len(gs) != 0 {
t.Errorf("another vendor's -sg model merged: %+v", gs)
}
// the user's own "same as" is read first
same := map[string]string{"workbuddy-ai/deepseek-v4.1-flash-sg": "deepseek-v4.1-flash-sg"}
if gs := autoGroups([]Entry{e("workbuddy", "deepseek-v4.1-flash"), e("workbuddy-ai", "deepseek-v4.1-flash-sg")}, same); len(gs) != 0 {
t.Errorf("the user's own same-as lost: %+v", gs)
}
}