Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ with category `"model"`. Clients can switch models by calling `session/set_confi
Unknown model values and unsupported reasoning efforts return an error from
`session/set_config_option`. If `AGY_MODEL` is set to an unknown value, the wrapper
logs a warning and falls back to the catalog default (preferring
`google/gemini-3.6-flash`, then `google/gemini-3.5-flash`).
`google/gemini-3.8-flash`, then `google/gemini-3.7-flash`, then `google/gemini-3.6-flash`).

## Supported ACP Methods

Expand Down
5 changes: 4 additions & 1 deletion internal/agy/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ type ModelCatalog struct {
}

var fallbackModelIDs = []string{
"gemini-3.8-flash-high",
"gemini-3.8-flash-medium",
"gemini-3.8-flash-low",
"gemini-3.7-flash-high",
"gemini-3.7-flash-medium",
"gemini-3.7-flash-low",
Expand Down Expand Up @@ -447,7 +450,7 @@ func pickDefaultEffort(native map[string]string) string {
}

func pickDefaultModel(profiles []ModelProfile) string {
for _, preferred := range []string{"google/gemini-3.7-flash", "google/gemini-3.6-flash", "google/gemini-3.5-flash"} {
for _, preferred := range []string{"google/gemini-3.8-flash", "google/gemini-3.7-flash", "google/gemini-3.6-flash", "google/gemini-3.5-flash"} {
for _, profile := range profiles {
if profile.CanonicalID == preferred {
return preferred
Expand Down
42 changes: 34 additions & 8 deletions internal/agy/models_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func TestModelCatalogFallback(t *testing.T) {
if err := catalog.EnsureLoaded(context.Background()); err != nil {
t.Fatal(err)
}
if got := catalog.DefaultModelID(); got != "google/gemini-3.7-flash" {
if got := catalog.DefaultModelID(); got != "google/gemini-3.8-flash" {
t.Fatalf("fallback default = %q", got)
}
}
Expand Down Expand Up @@ -121,7 +121,6 @@ func TestModelCatalogRetryAfterTransientFailure(t *testing.T) {
}
}


func writeModelsScript(t *testing.T, output string) string {
t.Helper()
dir := t.TempDir()
Expand All @@ -139,11 +138,14 @@ func writeModelsScript(t *testing.T, output string) string {
return path
}
path := filepath.Join(dir, "agy-models.sh")
content := "#!/bin/sh\n"
for _, line := range lines {
content += "echo " + line + "\n"
}
if err := os.WriteFile(path, []byte(content), 0755); err != nil {
var b strings.Builder
b.WriteString("#!/bin/sh\ncat <<'EOF'\n")
if output != "" {
b.WriteString(strings.TrimSuffix(output, "\n"))
b.WriteString("\n")
}
b.WriteString("EOF\n")
if err := os.WriteFile(path, []byte(b.String()), 0755); err != nil {
t.Fatal(err)
}
return path
Expand Down Expand Up @@ -175,4 +177,28 @@ func TestModelCatalogDiscoverTSVWithPreamble(t *testing.T) {
}
}


func TestModelCatalogDiscoverGemini38Flash(t *testing.T) {
output := "Fetching available models...\ngemini-3.8-flash-high\tGemini 3.8 Flash (High)\ngemini-3.8-flash-medium\tGemini 3.8 Flash (Medium)\ngemini-3.8-flash-low\tGemini 3.8 Flash (Low)\n"
script := writeModelsScript(t, output)
catalog := NewStrictModelCatalog(script)
if err := catalog.EnsureLoaded(context.Background()); err != nil {
t.Fatalf("EnsureLoaded failed: %v", err)
}
models := catalog.Models()
if len(models) != 1 {
t.Fatalf("expected 1 canonical model, got %d: %#v", len(models), models)
}
if got := catalog.DefaultModelID(); got != "google/gemini-3.8-flash" {
t.Fatalf("expected default model google/gemini-3.8-flash, got %q", got)
}
for _, effort := range []string{"low", "medium", "high"} {
want := "gemini-3.8-flash-" + effort
if got, err := catalog.ResolveNative("google/gemini-3.8-flash", effort); err != nil || got != want {
t.Fatalf("ResolveNative(google/gemini-3.8-flash, %s) = %q, %v", effort, got, err)
}
}
efforts := catalog.SupportedEfforts("google/gemini-3.8-flash")
if len(efforts) != 3 {
t.Fatalf("expected 3 supported efforts, got %#v", efforts)
}
}