Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.
agent: a Claude model on Bedrock runs to its own window in Claude Code, not 272K
yetonec79400556c5b
diff --git a/internal/agent/claude.go b/internal/agent/claude.goindex 51f3d33ea..38d2c4857 100644--- a/internal/agent/claude.go+++ b/internal/agent/claude.go@@ -2390,11 +2390,13 @@ func claude1MFor(agent string) func(ref string) string {// claudeModel says a model ref (magpie/v/claude-opus-5-5[1m], or Claude// Code's own claude-opus-5-5) is one of Anthropic's Claude models, by-// whichever provider it comes.+// whichever provider it comes and by whatever name it gives it: Amazon+// Bedrock's us.anthropic.claude-opus-… too, which Claude Code knows by the+// same "opus-…" it looks for, and which a group of was already taken for+// Claude's (provider.ClaudeGroup) while the model alone was held to the+// working window (划船不靠桨 on Discord).func claudeModel(ref string) bool {- m := strings.TrimSuffix(ref, "[1m]")- m = m[strings.LastIndex(m, "/")+1:]- return strings.HasPrefix(strings.ToLower(m), "claude")+ return provider.ClaudeModel(strings.TrimSuffix(ref, "[1m]"))}// claudeOwnCompact says the settings.json at path has an auto-compactdiff --git a/internal/agent/claude_compact_test.go b/internal/agent/claude_compact_test.goindex 91836cd21..f3345084c 100644--- a/internal/agent/claude_compact_test.go+++ b/internal/agent/claude_compact_test.go@@ -269,3 +269,50 @@ func TestClaudeGroupCompactWindow(t *testing.T) {t.Fatalf("autoCompactWindow changed: %q", v)}}++// A Claude model runs to its whole window whatever name its provider gives+// it: Amazon Bedrock names Claude Opus us.anthropic.claude-…, which+// magpie's [1m] Claude Opus there was not taken for, so Claude Code was+// held to 272K on a 1M Claude model (划船不靠桨 on Discord), while a group+// of the same model ran to 1M (provider.ClaudeGroup). Another vendor's 1M+// model on the same provider is still compacted at the working window.+func TestClaudeCompactWindowBedrockClaude(t *testing.T) {+ home := t.TempDir()+ t.Setenv("HOME", home)+ t.Setenv("USERPROFILE", home)+ t.Setenv("XDG_CONFIG_HOME", filepath.Join(home, ".config"))+ t.Setenv("XDG_CACHE_HOME", filepath.Join(home, ".cache"))+ const opus, nova = "us.anthropic.claude-opus-5-5-v1", "us.amazon.nova-premier-v1"+ if err := provider.Save(provider.Provider{ID: "br", Name: "Bedrock", Chat: "https://example.test/v1", Key: "k",+ Models: []string{opus, nova}}); err != nil {+ t.Fatal(err)+ }+ if err := catalog.SaveLive("br", "https://example.test/v1", []catalog.Model{{ID: opus, Context: 1000000}, {ID: nova, Context: 1000000}}); err != nil {+ t.Fatal(err)+ }+ path := filepath.Join(home, ".claude", "settings.json")+ writeFile(t, path, `{}`)+ a := claude(home)+ compact := func() string { v, _ := edit.GetJSON(path, "env."+claudeCompactEnv); return v }+ must := func(err error) {+ t.Helper()+ if err != nil {+ t.Fatal(err)+ }+ }+ must(a.Field("model").Set("br/" + opus + "[1m]"))+ if compact() != "" {+ t.Fatalf("a 1M Claude model on Bedrock is compacted at %q", compact())+ }+ must(a.Sync())+ if compact() != "" {+ t.Fatalf("a 1M Claude model on Bedrock, synced: %q", compact())+ }+ if top, _ := edit.GetJSON(path, "autoCompactWindow"); top != "" {+ t.Fatalf("a 1M Claude model on Bedrock got autoCompactWindow %q", top)+ }+ must(a.Field("model").Set("br/" + nova + "[1m]"))+ if compact() != "272000" {+ t.Fatalf("another vendor's 1M model on Bedrock: %q", compact())+ }+}diff --git a/internal/provider/provider.go b/internal/provider/provider.goindex 6e8a7beec..5fd0acd16 100644--- a/internal/provider/provider.go+++ b/internal/provider/provider.go@@ -1542,6 +1542,10 @@ func claudeModel(model string) bool {return strings.HasPrefix(m, "claude") || bedrockClaude(m)}+// ClaudeModel is claudeModel for another package: whether model, after any+// vendor prefix, is one of Anthropic's Claude models by its name.+func ClaudeModel(model string) bool { return claudeModel(model) }+// openAIModel is whether model is one of OpenAI's own by its name: a GPT,// a Codex or an o-series model, after any vendor prefix.func openAIModel(model string) bool {