4794de398ea8337d223a91e207181c56fcf4ad76
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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 (
|