f2eb56c6bbde1300dddc402861b59cd4e45e0215
8
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f985d6bdb6 |
provider: a Max output kept for a model no longer listed doesn't block the editor's Save (#3305, LoKi)
LoKi (#3305, Windows, v0.1.1325, Zen Free plugin 0.1.14): settings.json
held "opencode-zen-free/space-bunny-free": 65536 from when Zen Free
listed it. OutputsOf gives the editor every saved limit, the editor
sends them back as `outputs` on every Save, and SetModelOutputs refused
any positive entry for a model the provider doesn't serve, so each Save
failed with "opencode-zen-free has no model space-bunny-free", with no
model picked too.
SetModelOutputs (models.go) and its sibling SetModelCompacts
(compact.go, the editor's Compact at, same check and same round trip)
now refuse an unserved model only when its value is new or changed: an
entry sent back as it is stored is kept, and the rest of the Save goes
through. The user's value isn't deleted, since they set it and the model
may come back on the next refresh. It still shows in Max output as
model=size, and taking it out there clears it, as before. A newly typed
model the provider doesn't serve, or a changed value for a retired one,
is refused as before. SetModelOutput (the CLI's single set) is unchanged.
Siblings checked: the editor's Context window goes through provider.Save,
which never checks it against the list, so a retired model's window
already saved; Names & levels (modelPrefs) sends only the entries
changed in that editor session (modelPrefsOfDraft), so a retired one
isn't resent.
Run at
|
||
|
|
81a24cf8fe |
groups: a found group is listed as auto/<model id as the vendor spells it>
ZeroClover asked on X: Auto Group ids group/auto-<slug> can't be looked
up on models.dev. A found group is now listed and written as
auto/<model>, e.g. auto/claude-opus-5.5: /v1/models, the catalog, agent
configs, the GUI's Routing page and the CLI. Context and output limits
come from the model's metadata as before.
What stays the same:
- The internal id is still group/auto-<slug> (Group.Ref() gives the
public one). Every old form is still accepted as input forever:
provider.CanonicalRef turns auto/<model>[:level][[1m]] into it at the
gateway (validateModel), keys, stats, affinity and usage, so both ids
route to the same group and count as one.
- A key's model list allows a model by either id, group/* included
(allows() in key_models.go).
- Hand-made groups stay group/<id>.
- A provider whose stored id is "auto" keeps its models: while one
exists, found groups are listed by their old id (AutoRefsOn) and
auto/<x> means that provider's model. Documented in
docs/subsystems/gateway-routing.md.
Agent configs: SyncCatalog rewrites a field that holds a found group's
old id (renameFoundGroups), but only while the value is still what
applied.json says magpie wrote; a value the user set stays. A pick by
the old id written now is written as auto/<model> (Apply). Hidden,
picked and ordered model lists saved by the old id hold for the new one
(visible.go), and a bare model id still reaches its found group (bare.go).
Claude Code is given a dotted Claude version dashed (ClaudeSpelled), so
auto/claude-sonnet-4.5 sits in its settings as auto/claude-sonnet-4-5.
That routes to the same group, but with found groups off nothing reads
it back dotted, and Reseat took the field for changed and left the agent
on a group that was gone. Reseat now compares a group pick by its
canonical id (samePick). The old ids had no dots, so this is new with
auto/<model>.
Run at this tree (sandbox HOME, caches pinned):
- gofmt -l: clean. go vet ./...: clean on darwin, GOOS=linux -tags
nogui, GOOS=windows.
- go test -p 4 -timeout 45m ./...: every package ok except agent and
gateway, whose failures were the tests' expected ids (updated here)
and two regressions now fixed (bare ids; desktop models hiding groups
by prefix). Every failing test passes on rerun. Load average was
~210-290 from other sessions throughout.
- Reruns: provider, cli, codexcat ok. internal/gui: only
TestSetAnswersWhileDevinAndProvidersHang fails (set slow/slow-1 took
10.19s), and it fails the same in a git-archive export of
|
||
|
|
be6a74f13e |
provider: a routing group told its largest member's window runs to it when the user typed it (Osal on Discord)
Osal set the codex provider's windows to each model's most (gpt-6-astra=872k and the rest) and ran Codex on "6 Astra · routing group Ultra". Codex said "已用 114k 标记,共 258k": 95% of magpie's default working window, 272K. A group that names no size of its own is told its largest member's window (#712), but buildGroupEntries never carried whether the user typed that window (Entry.WindowSet), as it does for a group set to a size (#1809) or one following its smallest member (#2224). CompactFor then returned 0 and codexcat wrote context_window 272000, max_context_window 872000. Now the largest member's WindowSet comes along (a tie counts as typed), unless a rule of length lifted the window past it; WindowTyped says the same for Claude Code and Claude Desktop (largestWindow). A group whose largest member's window nobody typed keeps the default, and a size typed in Settings (Compact at) still comes first. TestLargestMemberTypedWindow (internal/agent): on the old code the gateway's list compacts group/ultra at 0, magpie-models.json tells it 272000 (max 872000), Claude Code gets CLAUDE_CODE_AUTO_COMPACT_WINDOW 272000 and Claude Desktop no per-model window; all four pass now, and a group whose 1M member is untyped keeps 272K. Run: gofmt -l (clean); go vet ./... on darwin, GOOS=linux -tags nogui, GOOS=windows (clean); go test -run 'TestLargestMemberTypedWindow| TestSmallestMemberTypedWindow|TestTypedWindowReaches' ./internal/agent; go test -timeout 45m ./... at |
||
|
|
8f4d091c6e |
provider: a group following its smallest member runs to that member's window when the user typed it, not magpie's 272K (#2224, Zypixh)
A group set to "smallest member" was told the smallest window, but not that it was one the user typed: groupEntries set Entry.WindowSet only for a group's own size, and WindowTyped said yes only for g.Context > 0. So a 500K typed on the provider for gpt-6.1-sol reached /v1/models, yet Claude Desktop's modelSettings.<id>.autoCompactWindow and Codex's compaction were magpie's default 272K, while the same group set to 500K itself got 500K. smallestWindow now gives the smallest window among a group's members and whether the member it comes from has a typed one (a tie counts as typed); groupEntries carries that into WindowSet (Codex, CompactFor) and WindowTyped asks it for a smallest-member group (Claude Code and Desktop). Members are already flattened through groups in groups, so an outer group passes it on. A group whose smallest member's window nobody typed, and largest/unset groups, are unchanged. Run (sandbox HOME, pinned caches): - TestSmallestMemberTypedWindow (new, internal/agent): on the old code FAIL "the gateway's list compacts group/pool at 0; want 500000" and "Claude Desktop: group/pool ... compacts at "272000"; want "500000"", same for the nested group/outer; with only compact.go reverted the Desktop lines fail. With the fix ok; group/plain (untyped) stays 272000. - go test -count=1 -timeout 30m ./internal/provider/ ./internal/agent/ ./internal/gateway/: ok (374s, 958s, 1042s on a loaded machine; a first run with the default 10m timeout timed out in gateway under load) - gofmt -l clean; go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...: clean. Not run: the full go test ./... (disk kept low); not tried with the real Claude Desktop. |
||
|
|
f94809d23e |
agent: Claude Code isn't handed 272000 for a routing group made only of Claude models (#1741, yanjieee)
writeCompact gives a Claude model its own window (no
CLAUDE_CODE_AUTO_COMPACT_WINDOW unless the user set a threshold), but
claudeModel looks only at the id's last part, so group/auto-claude-opus-5-5
or any group of Claude [1m] models was told magpie's default 272000.
provider.ClaudeGroup is true when every member of a group (nested groups
flattened, by the listed name or the wire name, Bedrock names included)
is a Claude model; writeCompact now treats such a group as it treats a
Claude model. A group with another vendor's model keeps 272000. A
threshold set on a member's provider still comes first (CompactSet), and
the user's own env, autoCompactWindow and modelSettings are untouched.
Siblings: only Claude Code has a Claude exemption. Codex (codexcat
work.Working, route.go/models.go CompactFor) applies the working window
to every model, so has no group misread. claudeOutput's claudeModel uses
are about output tokens and are left as they are. Part (b), per-model
modelSettings windows, is tracked separately.
Run: TestClaudeGroupCompactWindow (new) fails on the old writeCompact
("a group of Claude models: 272000"), passes now, with a user-owned env
500000 and autoCompactWindow 900000 kept; go test ./internal/agent
./internal/provider; gofmt -l; go vet darwin, linux -tags nogui, windows.
Not tried in a real Claude Code session.
|
||
|
|
f340aecabc |
provider, agent: a context window the user typed on a routing group or a provider is the one Codex and Claude Code run to, not magpie's default 272K (#1809)
A DeepSeek V4.1 Flash routing group set to 500K reached the catalog as Context 500000, but magpie's default working window (settings.Working, 272K, #876) cut it: Codex's magpie-models.json said context_window 272000, max_context_window 500000, and Codex runs to 95% of context_window, the ~258K in the report. Claude Code showed 500K (CLAUDE_CODE_MAX_CONTEXT_TOKENS) while magpie also wrote CLAUDE_CODE_AUTO_COMPACT_WINDOW=272000, so it compacted at 272K too and only displayed the larger number. From Codex's source (openai/codex @0c7362d, codex-cli 0.162.1): config.toml's model_context_window sets context_window to min(value, max_context_window); usable = context_window x effective_context_window_percent (95 by default); the auto-compact limit is min(model_auto_compact_token_limit, 90% of context_window). magpie writes neither config key and still doesn't, so a user's own model_context_window keeps working as before. magpie's default compaction now gives way to a window the user typed, as it already gives way to Claude Code's own autoCompactWindow ( |
||
|
|
116ca957cc |
agent: a provider's Compact at reaches Codex's on-disk catalog (#876) (#924)
Where Codex compacts a long conversation reached the gateway's /models (provider.CodexListed sets catalog.Model.Compact) and Claude Code (claude.go calls provider.CompactSet), but not the list magpie writes for Codex on disk: magpieModels left Compact unset, so codexcat fell back to the threshold for every model. A threshold the user set on a model or on its provider did nothing while Codex read that list — the case where Codex is not signed in to ChatGPT and model_catalog_json is what it reads. magpieModels now carries it, as the gateway's list and Claude Code already do. provider.CompactSetIn is compactSet for a caller holding the settings and the group finder already, as EffectivePriceIn is for prices: this loop runs for hundreds of models at magpie's start. TestCodexCatalogCompactAtReachesDisk fails without the change (204800, want 100000) and passes with it: relay's "*" and then relay/glm-4.6's own threshold reach the file, with the model's window kept as the maximum, and the whole window comes back when they are cleared. Co-authored-by: TryWorld2026 <tryworld@users.noreply.github.com> |
||
|
|
1aaac93b52 |
provider, gui: Compact at — where Codex and Claude Code compact a long conversation, set per provider or per model in its editor and to any size in Settings → Long conversations (#876, hisiling)
Until now the only choice was 272K for every model or Full window for every model. The 272K default stays as it is (
|