gateway: Claude Desktop's catalog-named rows say their provider in the description (4 v5)
4 v5 on Discord: with Provider in model names on, Claude Desktop's picker listed four relays' Opus 5.5 (老林夕, 新林夕, 百德, chatflowsai) all as "Opus 5.5 (…7922287072.anthropic.claude-opus-5-5)", told apart only by the id's tail. Cause: a Claude model with reasoning levels is listed as magpie-<n>.anthropic.<model> so Desktop gives it the effort picker (claudeLooking). Desktop 4.4212 labels a picker row by labelOverride, then its signed catalog's name, then display_name (ngn in index.chunk-m4oMImJ-.js), so our display_name "Opus 5.5 · 老林夕" is never shown for those ids; Qhn then appends the differing id tail to rows of one name. labelOverride comes only from an admin inferenceModels list in Desktop's profile (static, read at start, sealed at rest in 4.4212, and it can't say DesktopLongest's "[1m] only"), so magpie doesn't write it. Turning the catalog off would lose the effort picker for opus/sonnet 5.5 (Kfn lacks them). Change: Desktop shows the gateway's description under the name, before the catalog's (which has none for these models). desktopModels now puts the provider there for a catalog-named row (DesktopNumber != "") when the Provider in model names setting puts it after the name (desktopSaidBy): on, every one; own, every vendor-named one; off, only two of one name. A DesktopLongest 1M row says "1M context window · <provider>". Ids are unchanged, so saved sessions and picks still resolve. Rows Desktop names by display_name are unchanged. agent-wiring.md updated. Run on mote. At based24be3c25with this change: go test -count=1 -timeout 45m ./internal/gateway ./internal/gui ./internal/agent: agent ok; gateway red on TestCompactionOverByteCapEveryTime (new, filed #4862) and TestCodexPoolSaysTheClientsVersion (#4807), both ok alone at origin/main4fc34828eand at this head; gui red on TestMainWindowCorners/macOS_26_SDK (#3949), red the same alone at origin/main4fc34828e. At the pushed head (rebased on4fc34828e): gofmt -l clean; go vet ./internal/gateway ./internal/gui darwin and windows ok, GOOS=linux ./internal/gateway ok (./internal/gui doesn't cross-vet for linux: wails needs cgo, the same at origin/main); -run 'Desktop|Science|KeyModels|Decider|CallerKey' over ./internal/gateway ./internal/gui ok, plus the two gateway reds above ok. Broken by hand: desktopSaidBy always "" made TestClaudeDesktopCatalogNamedSaysProvider red (14 rows undescribed and the 1M row "1M context window" alone); dropping the label check made it red under Off (the lone Sonnet 5.5 said "chatflowsai"). Not tried: the real Claude Desktop picker. Desktop 4.4212 on mote in a sandbox HOME refused --remote-debugging-port, stalled at start before asking /v1/models (likely a Keychain prompt), and screencapture fails over ssh, so the row text under the name is read from its bundle, not seen. Desktop's own added 1M variant of a row can't take a description from the gateway (it always gets "1M context window"); it keeps the id tail Desktop gives it. Reported by 4 v5 on Discord.
This commit is contained in:
@@ -125,7 +125,7 @@ something else shows up as drift.
|
||||
- Claude Desktop's 3p mode runs in a userData of its own (`Claude-3p`), whose `config.json` (Desktop's own settings, not `claude_desktop_config.json`) starts with no `locale`, so Desktop on magpie came up in the system's language rather than the one picked signed in with Anthropic (memory and Osal on Discord). Turning Desktop onto magpie copies that one key, `locale`, from the signed-in userData's `config.json` (`Claude`, `%APPDATA%\Claude` on Windows, the first set's before the others) into `Claude-3p/config.json` when that file is missing or a JSON object without one (`desktopCarryLocale` in [`claudedesktop.go`](../../internal/agent/claudedesktop.go)); only a name Desktop takes for a catalog is carried. A `locale` already in `Claude-3p`, Desktop's or set by hand, is never written over, and no other key of that file is ever written. Off removes the file only when magpie made it and it still holds nothing but the language carried (`TestClaudeDesktopCarriesTheLanguage`, `TestClaudeDesktopKeepsThe3pLanguage`, `TestClaudeDesktopUserEditsThenReapply`). Desktop shows the language only where its 3p window has that catalog: the window is Desktop's bundled UI (`Resources/ion-dist`, 11 catalogs and no Chinese in 2.7032, 2.9939, 3.6556.2 and 4.4212.0 (packed as `Resources/ion-dist.asar` there), while 3.6556.2's main process has `zh-Hans` and `zh-Hant` for the signed-in window). On every start that window asks the main process for its own pick (`requestLocaleChange`: its localStorage, else `navigator.languages` mapped onto its 11, else `en-US`), and the main process writes it into `Claude-3p/config.json`. So a Chinese `locale` there, carried or set by hand, is `en-US` again after each start, written by Desktop and not by magpie (Dx25 on Discord, Windows); nothing magpie writes can keep it. So the GUI says it to a Chinese reader: Claude Desktop's opened row on Agents has a line that Desktop on magpie is Anthropic's gateway window, with no Chinese, and that its Chinese comes back once disconnected, and the switch-on notice says the same in Chinese (GZXYMH on X, `desktop-lang.test.cjs`).
|
||||
- Claude Desktop's sessions (Code and Cowork, `claude-code-sessions` and `local-agent-mode-sessions`) are kept in the userData Desktop runs in, keyed by account and organization (the claude.ai login signed in; in 3p the install id in `ant-did` and the profile's organization, both stable). So on magpie, in `Claude-3p`, the sessions made signed in with Anthropic are out of sight but untouched in `Claude`, and they show again when Desktop is switched back (lambdua on X: "切换账号,对话都不见"); claude.ai chats live on Anthropic's servers and 3p never shows them. magpie never writes or removes a session. Desktop imports them itself (Settings → Import: the signed-in userData, `~/.claude/projects`, other `Claude*` folders), copying under new ids and leaving the originals, but in 3p only when the profile's policy `claudeAiImport.enabled` is true (off by default, 3p only, from 1.28929.0). magpie's profile gets `"claudeAiImport":{"enabled":true,"bannerBehavior":"detect"}` once per folder set (`desktopSeedImport`, marked in the stash as `claude-desktop.import`): on the switch on and, for a Desktop already on magpie, from `Sync` at magpie's start. A `claudeAiImport` already there is kept, and one the user removes is not written again (`TestClaudeDesktopOffersItsSessionImport`).
|
||||
- Claude Desktop's 3p mode reads its MCP servers (Settings → Developer, its connector list) from `Claude-3p/claude_desktop_config.json`, a file of its own, so on magpie the servers the user added signed in with Anthropic, in `Claude/claude_desktop_config.json`, were gone from the list (aa86222 on Discord: connectors didn't sync). Turning Desktop onto magpie copies each of those `mcpServers` entries that `Claude-3p` has none of the same name for (`desktopCarryMCP` in [`claudedesktop.go`](../../internal/agent/claudedesktop.go)); one of that name already there, the user's or the Library's (which writes both files), stays. `Sync` does it once for a Desktop already on magpie (`claude-desktop.mcp-seen`), so a server the user takes out in 3p isn't brought back. What was copied is stashed (`claude-desktop.mcp`), and off takes back each one still as copied; one the user changed since stays (`TestClaudeDesktopCarriesTheMCPServers`, `TestClaudeDesktopMCPKeepsThe3pServers`, `TestClaudeDesktopSyncCarriesTheMCPServersOnce`). Claude's file is never written. A claude.ai account's connectors can't come along: Desktop calls them through claude.ai with that account (`/api/organizations/<org>/mcp/servers/<id>/tools/call`, refused with `no_active_org` without one, Desktop 2.7032), and 3p mode has no account; Anthropic's docs say "Made by Anthropic" connectors are only in standard Desktop, and others reach 3p through `managedMcpServers` or plugins (claude.com/docs/third-party/claude-desktop/extensions).
|
||||
- Claude Desktop names a Claude model with reasoning levels after its own catalog ("Opus 5.5"), not by the `display_name` magpie lists, because magpie lists it as `magpie-<number>.anthropic.<model>` to keep its effort picker (`claudeLooking` in [`desktop.go`](../../internal/gateway/desktop.go)). Two providers' rows of one model then differ in Desktop's menu only by that number, so the provider editor shows it on the model's chip (`gateway.DesktopNumber`, `desktopNumbers` in [`providers.go`](../../internal/gui/providers.go), #2578). The chip shows it only while Claude Desktop is installed and is shown that model. Every other model Desktop is shown carries no number on the chip: Desktop names it by `display_name`, which already says the provider, or by its own id.
|
||||
- Claude Desktop names a Claude model with reasoning levels after its own catalog ("Opus 5.5"), not by the `display_name` magpie lists, because magpie lists it as `magpie-<number>.anthropic.<model>` to keep its effort picker (`claudeLooking` in [`desktop.go`](../../internal/gateway/desktop.go)). Desktop 4.4212 labels a picker row by its catalog's name before `display_name` (only an admin's `inferenceModels` list, which magpie doesn't write, carries the `labelOverride` that beats it), so two providers' rows of one model read alike and Desktop adds the tail of the id, "Opus 5.5 (…7922287072.anthropic.claude-opus-5-5)". Desktop shows the gateway's `description` under the name, before the catalog's, so such a row's description names its provider when the Provider in model names setting puts it after the name (`desktopSaidBy`: on, every one; off, only two of one name), and a 1M row listed by its `[1m]` id says "1M context window · <provider>" (4 v5 on Discord, `TestClaudeDesktopCatalogNamedSaysProvider`). The id stays as it was. The provider editor shows the number too on the model's chip (`gateway.DesktopNumber`, `desktopNumbers` in [`providers.go`](../../internal/gui/providers.go), #2578). The chip shows it only while Claude Desktop is installed and is shown that model. Every other model Desktop is shown carries no number on the chip: Desktop names it by `display_name`, which already says the provider, or by its own id.
|
||||
- Codex's `spawn_agent` tool names only the first five models of its catalog to the lead (codex-rs `MAX_SPAWN_AGENT_MODEL_OVERRIDES` in `child_config.rs`, `spawn_agent_models_description`), Codex's own ahead of magpie's, though it takes any catalog model by name (`find_spawn_agent_model_name`). So a lead could put its subagents on none of magpie's models (Gearclickist on Discord). The gateway adds the rest of the catalog Codex was handed to that tool's description, after Codex's own list, at most 200 (`spawnAgentModels` in [`codex_spawn_models.go`](../../internal/gateway/codex_spawn_models.go)). A model that can search tools (`supports_search_tool`) isn't handed it in the request's tools: Codex defers its multi-agent V1 tools behind `tool_search` (codex-rs `core/src/tools/spec_plan.rs`), and the lead gets `spawn_agent` in the `tool_search_output` Codex puts in the conversation and sends again every turn, so that one is widened too. That text goes upstream with the prompt, to OpenAI too for a ChatGPT lead, so its header (`spawnMore`) stays neutral: it names neither magpie nor Codex's limit. At `CodexPath` that is Codex's own listed models less the hidden ones, then `CodexListed` unless Codex is held to its own. At `/v1` it is `CodexCatalog` under the key's allowance. A lead the ChatGPT backend answers in multi-agent V2 seals its subagents' tasks for a ChatGPT account (#619), so it gets Codex's own only. The model catalog Codex puts in context under `model_catalog_in_context` (under development, off by default) is capped at five too, and isn't widened.
|
||||
- Snow CLI runs on one profile at a time (`profiles/<name>.json` in `~/.snow` or `$SNOW_CONFIG_DIR`, named in `active-profile.json`) and copies the active one over `config.json` at every start, `snow --ask` too ([`snow.go`](../../internal/agent/snow.go)). magpie writes a `magpie` profile, makes it the active one, and copies it to `config.json` itself, so a Snow already running and Snow App's "Sync Snow CLI API config" see the same. It is made from the profile the user was on, their settings kept and its OAuth sign-in left out. A vision model of that profile comes along only with an endpoint and key of its own (`snowOwnVision`), since one on the profile's would now go to the gateway. `maxContextTokens`, `maxTokens` and `supportsVision` follow the model from the catalog (`snowSynced`; `supportsVision` as every agent is told, true while magpie's Vision describes images); what magpie last wrote of them is stashed, and one the user changed since in Snow's own settings is kept through later picks and syncs. The small field is magpie's profile's `basicModel`, Snow's light model for summaries, compaction and file search: empty while it follows the main model, a model through magpie of its own kept through new main models and syncs; on a profile of the user's it offers nothing and is hidden. The thinking field is magpie's profile's `chatThinking` (`{enabled: true, reasoning_effort}`), the only thinking setting Snow reads on the chat protocol; empty deletes it, Snow's default, which sends thinking disabled. A chatThinking the user brought from their profile is shown, not written over. The profile they were on (or that there was no `active-profile.json`) and a `magpie.json` of their own are stashed and put back by Disconnect. A Snow from before profiles (`config.json` alone) gets the `default.json` Snow itself would have made of it, so its next start doesn't take magpie's for the user's. Picking a model of another of the user's profiles switches Snow to that profile. On magpie's profile, a value that is neither a model through magpie nor the model of one of the user's profiles is refused and changes nothing (#1457: `magpie snow --help` used to take magpie out and write `--help` as the model of the profile it went back to). Gemini CLI's auth field refuses an auth it doesn't know before it unroutes, for the same reason. On the CLI, `-h`/`--help` after any command or agent only prints its usage, before `run` reads or moves anything, and any other flag given to `magpie <agent> …` is refused (`help_cli.go`; `TestHelpOnEveryCommandDoesNothing` walks `run`'s switch and every agent).
|
||||
- omp's `enabledModels` in `config.yml` is the list it holds its default role to: a model left out of it isn't used, whatever `modelRoles.default` says (#1769). So a model picked for the default role is added to a list that is there and doesn't take it in already, by name or by one of omp's globs (`*` not crossing `/`, as `Bun.Glob`), and once nothing in `config.yml` is on magpie its plain `magpie/…` entries are taken out (a list left empty goes, never `[]`); a renamed provider's entries are renamed once, and folder-scoped entries are left alone (`ompScope*` in [`omp_scope.go`](../../internal/agent/omp_scope.go)). No list, no change: omp then takes every model. A list that leaves the default role's model out is drift, which Reapply mends.
|
||||
|
||||
@@ -187,7 +187,8 @@ func DesktopID(e provider.Entry) string { return claudeLooking(e) }
|
||||
// display_name, which carries the provider already. Only a Claude model
|
||||
// with reasoning levels, listed as magpie-<number>.anthropic.<model>
|
||||
// (claudeLooking), is named after Desktop's own catalog ("Opus 5.5"), so
|
||||
// two providers' rows read alike and the menu tells them apart by that id.
|
||||
// two providers' rows read alike and the menu tells them apart by that id
|
||||
// and by the provider in its description (desktopSaidBy).
|
||||
// Every other id is the model's own (no number) or an alias Desktop
|
||||
// doesn't know (mythos-magpie-<n>, anthropic/magpie-<n>), named by
|
||||
// display_name.
|
||||
@@ -208,7 +209,8 @@ func DesktopNumber(e provider.Entry) string {
|
||||
// it keeps (claudeLooking), named as the agents' lists name models
|
||||
// (desktopNames: the Provider in model names setting, so its menu reads
|
||||
// like Codex's, #1746). Desktop shows the name, not the id, and its
|
||||
// description after it, so none is given but a 1M entry's (desktop1M); it
|
||||
// description after it, so none is given but a 1M entry's (desktop1M) and
|
||||
// the provider of a row Desktop names after its catalog (desktopSaidBy); it
|
||||
// folds rows of one name into one entry, so no two of one name read the
|
||||
// same (desktopNames). A model of 1M or more is listed by its "[1m]" id
|
||||
// under settings.DesktopLongest, described as Desktop's own 1M entry is
|
||||
@@ -233,6 +235,7 @@ func desktopModels(entries []provider.Entry, knowsMythos bool) []map[string]any
|
||||
}
|
||||
}
|
||||
longest := settings.Load().DesktopLongest
|
||||
labels := provider.Labels(entries)
|
||||
data := make([]map[string]any, 0, len(entries))
|
||||
for i, e := range entries {
|
||||
m := modelObject(e)
|
||||
@@ -242,9 +245,16 @@ func desktopModels(entries []provider.Entry, knowsMythos bool) []map[string]any
|
||||
id = aliasFor(e.ID)
|
||||
}
|
||||
m["id"] = id
|
||||
var said []string
|
||||
if desktopListed1M(e, longest) {
|
||||
m["id"] = m["id"].(string) + "[1m]"
|
||||
m["description"] = desktop1MSaid
|
||||
said = append(said, desktop1MSaid)
|
||||
}
|
||||
if by := desktopSaidBy(e, labels[i]); by != "" {
|
||||
said = append(said, by)
|
||||
}
|
||||
if len(said) > 0 {
|
||||
m["description"] = strings.Join(said, " · ")
|
||||
}
|
||||
if t := tierOf[e.ID]; t != "" {
|
||||
m["anthropic_family_tier"], m["is_family_default"] = t, true
|
||||
@@ -287,6 +297,28 @@ func DesktopListed1M(e provider.Entry) bool {
|
||||
// adds (WLt in its app.asar, 2.7032).
|
||||
const desktop1MSaid = "1M context window"
|
||||
|
||||
// desktopSaidBy is the provider Claude Desktop's menu says under e, where
|
||||
// the name it shows can't: "" but for a row Desktop names after its own
|
||||
// model catalog (DesktopNumber), whose label, by the Provider in model
|
||||
// names setting, has its provider after it.
|
||||
//
|
||||
// Desktop 4.4212 labels a picker row by its catalog's name before the
|
||||
// gateway's display_name (ngn in its app.asar: labelOverride, then the
|
||||
// catalog's name, then display_name; only an admin's inferenceModels list
|
||||
// has labelOverride), so every provider's claude-opus-5-5 read "Opus 5.5"
|
||||
// and the menu told them apart only by the tail of the id, "(…7922287072
|
||||
// .anthropic.claude-opus-5-5)" (4 v5 on Discord: 老林夕, 新林夕, 百德 and
|
||||
// chatflowsai's alike). The row's description is the gateway's before the
|
||||
// catalog's, which has none for these models, and Desktop shows it under
|
||||
// the name, so the provider goes there. The id stays as it was, for a
|
||||
// session or a pick saved on it.
|
||||
func desktopSaidBy(e provider.Entry, label string) string {
|
||||
if DesktopNumber(e) == "" || e.Provider.Name == "" || !strings.HasSuffix(label, " · "+e.Provider.Name) {
|
||||
return ""
|
||||
}
|
||||
return e.Provider.Name
|
||||
}
|
||||
|
||||
// Claude Desktop's Code tab runs Claude Code with ANTHROPIC_DEFAULT_<TIER>_MODEL
|
||||
// set to "" for every tier, unless the gateway's /v1/models tags a model
|
||||
// with anthropic_family_tier (shortnameIdentityOverrides in its app.asar,
|
||||
|
||||
@@ -99,14 +99,26 @@ func TestClaudeDesktopLongestOnly(t *testing.T) {
|
||||
t.Errorf("on: %s listed as %q, want %q", id, r.ID, want)
|
||||
}
|
||||
}
|
||||
// a row Desktop names after its catalog says its provider as well
|
||||
// (desktopSaidBy)
|
||||
said := func(r row, oneM bool) string {
|
||||
var s []string
|
||||
if oneM {
|
||||
s = append(s, "1M context window")
|
||||
}
|
||||
if strings.Contains(r.ID, ".anthropic.") {
|
||||
s = append(s, "Vend")
|
||||
}
|
||||
return strings.Join(s, " · ")
|
||||
}
|
||||
for id, r := range on {
|
||||
if want := map[bool]string{true: "1M context window"}[strings.HasSuffix(r.ID, "[1m]")]; r.Said != want {
|
||||
if want := said(r, strings.HasSuffix(r.ID, "[1m]")); r.Said != want {
|
||||
t.Errorf("on: %s (%s) described %q, want %q", id, r.ID, r.Said, want)
|
||||
}
|
||||
}
|
||||
for id, r := range off {
|
||||
if r.Said != "" {
|
||||
t.Errorf("off: %s described %q", id, r.Said)
|
||||
if want := said(r, false); r.Said != want {
|
||||
t.Errorf("off: %s (%s) described %q, want %q", id, r.ID, r.Said, want)
|
||||
}
|
||||
}
|
||||
if r := on["vend/exo-free"]; r.MaxInput != 872_000 {
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/yetone/magpie/internal/provider"
|
||||
"github.com/yetone/magpie/internal/settings"
|
||||
)
|
||||
|
||||
// Claude Desktop's model menu lists the models picked for it on the Agents
|
||||
@@ -305,3 +306,107 @@ func TestDesktopNames(t *testing.T) {
|
||||
t.Fatalf("desktopNames (names plain) = %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
// Claude Desktop names a Claude model with reasoning levels after its own
|
||||
// catalog ("Opus 5.5"), not by display_name, so four relays' claude-opus-5-5
|
||||
// read alike and its menu told them apart only by the id's tail,
|
||||
// "Opus 5.5 (…7922287072.anthropic.claude-opus-5-5)" (4 v5 on Discord:
|
||||
// 老林夕, 新林夕, 百德 and chatflowsai, Provider in model names on). Such
|
||||
// a row says its provider in the description Desktop shows under the
|
||||
// name, by the same setting the name follows: on, every one; off, only
|
||||
// two of one name, as display_name keeps their provider then. Its id stays
|
||||
// as it was, and a row Desktop names by display_name says nothing more.
|
||||
func TestClaudeDesktopCatalogNamedSaysProvider(t *testing.T) {
|
||||
setup(t, provider.Anthropic, &fake{})
|
||||
levels := []string{"low", "medium", "high", "max"}
|
||||
for _, p := range []provider.Provider{
|
||||
{ID: "laolin", Name: "老林夕", Key: "k", Anthropic: "http://127.0.0.1:1", Models: []string{"claude-opus-5-5"}},
|
||||
{ID: "xinlin", Name: "新林夕", Key: "k", Anthropic: "http://127.0.0.1:1", Models: []string{"claude-opus-5-5"}},
|
||||
{ID: "baide", Name: "百德", Key: "k", Anthropic: "http://127.0.0.1:1", Models: []string{"claude-opus-5-5"}},
|
||||
{ID: "chatflowsai", Name: "chatflowsai", Key: "k", Anthropic: "http://127.0.0.1:1", Models: []string{"claude-opus-5-5", "claude-sonnet-5-5", "glm-5.3"}},
|
||||
} {
|
||||
if err := provider.Save(p); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, m := range p.Models {
|
||||
if err := provider.SetModelEfforts(p.ID+"/"+m, levels); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
list := func() map[string]desktopRow {
|
||||
t.Helper()
|
||||
req := httptest.NewRequest("GET", "/v1/models?limit=1000", nil)
|
||||
req.Header.Set("x-api-key", TokenFor("claude-desktop"))
|
||||
rec := httptest.NewRecorder()
|
||||
New().Handler().ServeHTTP(rec, req)
|
||||
var out struct {
|
||||
Data []desktopRow `json:"data"`
|
||||
}
|
||||
if err := json.Unmarshal(rec.Body.Bytes(), &out); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
got := map[string]desktopRow{}
|
||||
for _, d := range out.Data {
|
||||
got[DesktopCatalogID(strings.TrimSuffix(d.ID, "[1m]"))] = d
|
||||
}
|
||||
return got
|
||||
}
|
||||
opus := map[string]string{"laolin/claude-opus-5-5": "老林夕", "xinlin/claude-opus-5-5": "新林夕", "baide/claude-opus-5-5": "百德", "chatflowsai/claude-opus-5-5": "chatflowsai"}
|
||||
ids := map[string]string{}
|
||||
for _, c := range []struct {
|
||||
mode string
|
||||
sonnet string // what the lone Sonnet 5.5 says
|
||||
}{
|
||||
{provider.SuffixOn, "chatflowsai"},
|
||||
{provider.SuffixOwn, "chatflowsai"},
|
||||
{provider.SuffixOff, ""},
|
||||
} {
|
||||
if err := provider.SetSuffixMode(c.mode); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
got := list()
|
||||
for ref, by := range opus {
|
||||
r := got[ref]
|
||||
if !regexp.MustCompile(`^magpie-\d{10}\.anthropic\.claude-opus-5-5$`).MatchString(r.ID) {
|
||||
t.Fatalf("%s: %s listed as %q, not one Desktop names after its catalog", c.mode, ref, r.ID)
|
||||
}
|
||||
if r.Description != by {
|
||||
t.Errorf("%s: %s described %q, want %q", c.mode, ref, r.Description, by)
|
||||
}
|
||||
if ids[ref] == "" {
|
||||
ids[ref] = r.ID
|
||||
} else if ids[ref] != r.ID {
|
||||
t.Errorf("%s: %s's id moved from %s to %s", c.mode, ref, ids[ref], r.ID)
|
||||
}
|
||||
}
|
||||
if r := got["chatflowsai/claude-sonnet-5-5"]; r.Description != c.sonnet {
|
||||
t.Errorf("%s: the lone Sonnet 5.5 described %q, want %q", c.mode, r.Description, c.sonnet)
|
||||
}
|
||||
// named by display_name (mythos-magpie-<n>), which says it already
|
||||
if r := got["chatflowsai/glm-5.3"]; r.ID == "" || r.Description != "" {
|
||||
t.Errorf("%s: glm-5.3 (%s) described %q, want nothing", c.mode, r.ID, r.Description)
|
||||
}
|
||||
}
|
||||
|
||||
// a 1M row listed by its "[1m]" id says both
|
||||
if err := provider.SetSuffixMode(provider.SuffixOn); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
now, err := provider.Find("baide")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := provider.SetContext(*now, "claude-opus-5-5", 1_000_000); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
s := settings.Load()
|
||||
s.DesktopLongest = true
|
||||
if err := settings.Save(s); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
r := list()["baide/claude-opus-5-5"]
|
||||
if r.ID != ids["baide/claude-opus-5-5"]+"[1m]" || r.Description != "1M context window · 百德" {
|
||||
t.Errorf("1M: listed as %s, described %q", r.ID, r.Description)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user