Commit Graph
4 Commits
Author SHA1 Message Date
yetone d1cdce1302 provider: the group alone keeps subscription models out of agents' lists (shaoyang.)
shaoyang. on Discord (#general, 11-03): with a routing group's Model
lists set to the group alone (its card's 成员模型不单独列出), the model
list fetched still had every model of the group.

Cause: 88e6fb9cf (v0.1.2176, 10-30) had catalogOf keep a signed-in
subscription's models (SubscriptionKept: a ChatGPT, Claude, Copilot or
plugin account's) for every agent, leaving the group alone only for a
client that is no agent (""). Over HTTP no client is "": agentOf falls
back to usage.AgentOf(User-Agent), which is "other" or the UA's name, so
every /v1/models fetch, every agent's written list and every picker
listed a subscription member beside the group. For a group made of
subscription models, as most are, the option changed nothing.

Fix: catalogOf gives every agent but Codex Catalog(), as before
88e6fb9cf; Codex keeps its ChatGPT sign-in's own models (CodexOwn,
a3ee00c05), which its app reaches on that sign-in. SubscriptionKept is
gone; Unlisted() and GroupKept() name subscription members again, so the
picker's "kept for routing groups" note and the provider editor's
"listed alone" line (3d063e34f) say where they went. The routing editor's
hint says Codex keeps its own, in en, zh, zh-TW, ja and de. Docs:
reference.md, gateway-routing.md.

Behaviour change for 士奇's case (88e6fb9cf): with "The group alone" on,
Hermes, WorkBuddy and the rest lose the group's subscription models
again; that is what the option says. Listing its models too keeps them beside
the group, which the new test checks.

Tests:
- gui TestGroupAloneKeepsSubscriptionModelsOutOfEveryAgentsList (replaces
  TestSubscriptionModelsStayInEveryAgentsListWithGroupOn): a sandbox
  ChatGPT sign-in's 5 models in a group listing alone. For every agent
  but Codex that lists the group, its Agents-page list, CatalogFor and
  model pickers leave them out; Unlisted names them; with "Its models
  too" hermes, workbuddy, claude and codex list them.
- gateway TestGroupAloneKeepsSubscriptionModelsOffAgentsModelList:
  GET /v1/models with no key, "magpie" and magpie-hermes/-claude/-opencode
  lists group/mine and not its members; /v1/models/{id} doesn't find one
  for Hermes; Codex's key lists and finds them; listed again with
  listed too.
- TestCodexOwnModelsListedOnlyThroughGroups again expects Claude Code not
  to list a group-alone member.

Run on mote at 3da80330a (rebased on origin/main c3593dc49): gofmt -l
clean; go vet (darwin -tags nogui, GOOS=linux -tags nogui at the base,
GOOS=windows) on provider, gateway, gui ok; go test -timeout 45m
internal/provider ok, internal/gui ok, internal/gateway -run
"TestGroup|TestCodex|TestUnlisted|TestModels|TestDesktop" ok. At the
base 40a287b21: internal/provider, gateway, gui and agent whole ok;
internal/cli red only in TestEveryRouteHasACommandOrIsNamed (GET
/api/context/reply, #5026, red on main since 0872bc2a0). GUI:
group-unlists (en/zh/zh-TW/ja/de, 1100 and 420px), unlisted-group-kept,
unlisted-models, agent-models-group-on, i18n-keys in chromium and webkit,
56 of 56.

Broken by hand: catalogOf back to SubscriptionKept with the new tests in
place; the gui test failed with 484 "the group alone" errors (codex/gpt-5.5
in claude's, claude-desktop's, claude-science's lists and pickers among
them) and the gateway test for every key, no key and "magpie" included.

Not tried: a real ChatGPT/Claude sign-in or the running app, and the
reporter's Docker deployment (same /v1/models path, no OS branch); which
agent fetched the list isn't known.
2026-11-03 18:23:13 +08:00
yetone 88e6fb9cf7 provider: a signed-in subscription's models stay in every agent's list with a group listing alone on
士奇 on Discord (Simplified Chinese GUI, the third report of this): with
routing groups off, Hermes Agent's and WorkBuddy's model lists had the
ChatGPT subscription's GPT models. With routing groups on, they were gone.

Cause: the user's group names those models and lists itself alone
(Group.Unlists, the routing plugin's option for that, #1783). While the
group is on, catalogKeeping drops what it names from Catalog(), and every
agent's list starts from Catalog(). With groups gated off the group's
Unlists goes away, so the models came back. a3ee00c05 kept them for the
Codex agent only; its body said other agents still didn't see them.

Fix, at the one point every agent's list starts from: catalogOf(agent)
keeps a signed-in subscription's own models (SubscriptionKept: no group
entry, Provider.Account set, the provider not kept for routing groups)
for every agent, so a group is added on top of what agents had. A client
that is no agent ("" on /v1/models) still gets the group alone, as #1783
asked. Provider.Unlisted ("Only through routing groups") still hides the
provider's models from agents other than Codex. Unlisted() no longer names
a kept subscription model, so the picker's note doesn't call it kept for
groups.

Siblings: every agent writer reaches catalogOf through CatalogFor and
ListedFor. Two gateway lookups read Catalog() directly and now use the
agent's catalog (CatalogOf): /v1/models/{id} and Claude Desktop/Science's
alias lookup. agent.go and codex.go read Catalog() only for error text or
a fallback and are left alone. The routing plugin's hint for that option
says, in every language, that a signed-in subscription's models stay in
agents' lists.

Test: TestSubscriptionModelsStayInEveryAgentsListWithGroupOn signs in a
ChatGPT account in a sandbox and switches on a group naming its 5 models
that lists itself alone. For every agent that lists the group (68,
including hermes, workbuddy, claude and codex), the agent's list and
CatalogFor have the models, and a picker offering the group offers them.
Catalog() and CatalogFor("") still don't. With the provider set to
Unlisted, Hermes doesn't list them. TestCodexOwnModelsListedOnlyThroughGroups
now expects Claude Code to keep the models under a group alone.

Run (on mote):
- Broken by hand: catalogOf reverted to a3ee00c05's Codex-only version.
  The new test went red with 340 errors across 68 agents, e.g.
  "codex/gpt-5.5 not in hermes's list map[group/mygpt:true]", and the
  same for workbuddy, claude and claude-desktop. Green with the fix back.
- gofmt -l; go vet on darwin, linux (nogui) and windows; builds: clean.
- go test -timeout 45m ./... at 035d87b80 (this change on 4a4a90c23,
  before a test comment was reworded): every package ok except
  - internal/gui TestMainWindowCorners/macOS_26_SDK: #3949, red on
    origin/main accb951ab on mote too (macOS 27);
  - internal/provider TestClaudeAccountServesModelsListedSinceItsFetch:
    #3174 (red in a full run, green alone). 5 of 5 green alone and
    green in a whole internal/provider run at that head.
- At this commit on b26fa0903: gofmt -l on the
  changed Go files, go vet of provider, gateway and gui on darwin, linux
  (nogui) and windows: clean. internal/provider whole: ok.
  internal/gui and internal/gateway with -run
  "Codex|Group|Subscription|Unlist|Catalog|AgentModel": gui ok; gateway
  red on TestAntigravityTurnsCodexsGPT5ThreadAwayOnce and
  TestCodexSpentGrokFailingIsTold, both red the same way on origin/main
  b26fa0903 (3 of 3) and filed as #4362.
- GUI files the change reaches, on b26fa0903: agent-model*, group-unlists and
  i18n-keys: every Chromium case and i18n-keys pass (46); every WebKit
  case timed out launching the browser (180s, #4125: WebKit doesn't start
  on mote right now). The same files at 035d87b80 passed in both engines
  but i18n-keys, whose one red (the new test quoted a routing-plugin
  word) is fixed here.
- Rebased on 101775657 (main had moved models.go and gateway.go): gofmt,
  go build for darwin, linux (nogui) and windows, go vet of provider,
  gateway and gui on all three: clean. go test -run
  "Codex|Group|Subscription|Unlist|Catalog|AgentModel" ./internal/gui
  ./internal/provider and -run "Model|Desktop|Alias|Catalog"
  ./internal/gateway: ok.
- The whole GUI suite (1004 files) at fd50ed116 was still running when
  this was pushed (mote shared with other sessions' suites). Reds it
  shows get their own issue unless already red on main.

Not tried: no live ChatGPT account and no real GUI app run (the test signs
in a sandbox account). No separate gateway test for /v1/models/{id} or the
Desktop alias lookup. Provider.Unlisted stays honoured, on purpose.
2026-10-30 15:38:06 +08:00
yetone a3ee00c05c codex: its own GPT models stay in Codex's list when kept for routing groups
士奇 (Discord, 10-28): with a routing group on, the Agents page's Codex
list lost its Codex provider section and models, the model dropdown still
offered GPT, but the Codex app had none; with the group off they came back.

Cause: the codex provider's "Only through routing groups" (Provider.Unlisted,
只通过路由分组使用), or a group that lists itself alone (Group.Unlists), took
the ChatGPT account's own models out of Catalog(), so out of Codex's own
list too. With no Codex section, the own options were not magpie's, so the
own-models switch showed and the picker kept offering GPT; meanwhile #1602
(125dad5cb, CodexNativeUnlisted) dropped every one of them from the list
handed to Codex (backend /models, the model_catalog_json desk file,
spawn_agent). The picker and the app disagreed.

Why the earlier fixes missed it: aa766289b only stopped the GUI folding a
provider, and 508911e43 (TestCodexOwnModelsStayWithGroupOn) only kept
Served own options in the picker. Both covered a plain group; neither
touched Catalog's unlisting for Codex or the desk list's #1602 filter, and
neither test set Unlisted or Unlists.

Fix: Codex's lists start from catalogOf("codex"), which keeps CodexOwn
entries (ListedFor/CatalogFor, CodexNativeHidden, CodexOrder), and
CodexNativeUnlisted is removed with its filters in codexMerged,
spawnChoices and the list tag. Other agents and /v1/models still don't
see unlisted GPT models (checked for Claude Code in both tests).

Behaviour change for #1602: an unlisted codex provider no longer hides GPT
from Codex. The way to hide them from Codex is Codex's own list (its Codex
section's hide / only-picked), which CodexNativeHidden still applies; the
rewritten gateway test checks that and the ETag change.

Tests:
- gateway TestCodexModelListKeepsOwnForGroups (rewrites
  TestCodexModelListUnlistedForGroups): group Unlists and provider Unlisted
  keep gpt-6-sol/gpt-5.5 in Codex's /models and spawn_agent; Claude Code
  doesn't list them; hidden in Codex's list it goes and the ETag changes.
- gui TestCodexOwnModelsListedOnlyThroughGroups: agentModelList has the
  Codex section (Own) for every model, OwnModels is false, the picker has
  them, Claude Code doesn't list the unlisted ones.

Run (mote-run, -tags nogui): go build ./...; go vet for darwin, GOOS=linux
and GOOS=windows on provider/gateway/gui/agent; gofmt -l clean; go test
./internal/provider ./internal/gateway ./internal/gui ./internal/agent: ok.
Broken by hand: the five source files reverted to f20118304 with the new
tests in place: both tests red (gateway: gpt-5.5 and every own slug gone,
spawn offers only group/mine; gui: no Codex section, own switch shown).
Real codex 0.162.1 in a sandbox CODEX_HOME: `codex debug models` with
model_catalog_json pointed at the desk file CodexDesktopCatalog wrote with
the provider Unlisted and an Unlists group lists gpt-6-sol, gpt-5.6-sol and
group/mine (the old code dropped both GPT slugs).

Not run: full suite. Not tried: GUI Playwright files (no page changed), a
live ChatGPT sign-in or the Codex desktop app itself.
2026-10-28 14:26:18 +08:00
yetone 508911e431 agent, gui: Codex's ChatGPT models stay in its picker with a routing group on and its own models switched off (shiqi_40904 on Discord)
shiqi_40904 on Discord: "开启路由组后,agent 设置页面-codex-模型列表里不会显示
codex 模型,关闭路由组后才会显示".

Cause: the switch "Show Codex's own models" (#1642, provider.
OwnModelsHidden) has agent.Picks drop every option of the agent's own
(no catalog Ref) from a picker that offers one of magpie's models. On a
ChatGPT sign-in, Codex's picker offers its own models and leaves out
magpie's codex/... (viaMagpieFor: only a hop), so with no routing group
it has no Ref option and the switch did nothing; a group gives it one
(group/mygpt) and the switch then took out every Codex model but the one
it was set to. The picker was Default, gpt-5.5 and the group; turned
off, the group took the Ref away and they were back. The list's switch
itself shows only while a group is on (OwnModels), so with the group off
nothing on screen said why.

Fix: Option.Served marks one of the agent's own that magpie's list shows
it too, on the account it is signed in to. Codex's own models a ChatGPT
account in magpie serves (codex/<model> in CatalogFor("codex")) are
marked so (codexInMagpie, live and WSL Codex), and agent.Own leaves them
out, so the switch never takes them out; the list's tick decides them
(one taken out there is the switch's again). With all of them served,
OwnModels is false and the list has no switch for Codex. The GUI's
filter on closing the list (closeAgentModels) keeps o.served the same
way. Codex on a relay of its own (model_provider of the user's) is
unchanged: those go straight to the relay, the switch's to take out.

Sibling check: Claude Code offers magpie's models on its own account as
catalog options (Same, with Ref), so the switch leaves them; DeepSeek
Harness's own are not served by magpie; the TUI and the tray panel take
their options from agent.Picks (server); WSL Codex's options marked too.

Reproduced first in a sandbox HOME (fake ChatGPT auth.json,
models_cache.json, catalog.SaveLive codex with 5 models, group MyGPT of
codex/gpt-5.5 + codex/gpt-5.4, own models switched off): agent.Picks
gave [gpt-5.5 group/mygpt] with the group, all five without it. Then
drove the real GUI (Handler on 127.0.0.1:3719, Playwright chromium):
Codex connected, its picker with the fix lists Default, Disconnect,
gpt-5.5, MyGPT, gpt-5.4, gpt-5.4-mini, gpt-5.3-codex, gpt-5.2; the list
shows Routing groups 1/1, Codex 5/5 and no own-models switch.

Run at this head (rebased on origin/main 3a89dd53c):
- go test ./internal/gui ./internal/tui: ok (202s, 38s);
  ./internal/agent: ok (406s) on a second run, the first ran out of
  disk ("no space left on device" in TempDir, the machine at 100%)
- new TestCodexOwnModelsStayWithGroupOn: red with agent.Own back to
  ignoring Served ("group on: gpt-5.4 not in Codex's picker [gpt-5.5
  group/mygpt]", the reporter's case), green with it
- GUI: agent-models-own-served.test.cjs (new; chromium + webkit, en +
  zh, 420 and 1100) red 4/4 in chromium with o.served dropped from the
  close filter, green 8/8 with it; all agent-models*, i18n-keys,
  claude-picker*, picker-rail-current, editor-picker-clicks: 66 pass
  before the rebase; at this head agent-models-own, -own-served,
  -group-on, -picker and i18n-keys: 40 pass
- gofmt -l clean; go vet ./...; GOOS=linux go vet -tags nogui ./...;
  GOOS=windows go vet ./...; go build

Not tried: a real ChatGPT account (the sign-in is faked in the sandbox),
the Windows box and WSL Codex (its options are built the same way), the
whole GUI suite (the change is the list's close filter, not the shared
picker).
2026-10-27 13:43:28 +08:00