(t *testing.T)
| 439 | } |
| 440 | |
| 441 | func TestAutoModelFallbackError(t *testing.T) { |
| 442 | if runtime.GOOS == "windows" { |
| 443 | t.Skip("Skipping docker CLI shim test on Windows") |
| 444 | } |
| 445 | |
| 446 | tempDir := t.TempDir() |
| 447 | dockerPath := filepath.Join(tempDir, "docker") |
| 448 | script := "#!/bin/sh\n" + |
| 449 | "printf 'unknown flag: --json\\n\\nUsage: docker [OPTIONS] COMMAND [ARG...]\\n\\nRun '\\''docker --help'\\'' for more information\\n' >&2\n" + |
| 450 | "exit 1\n" |
| 451 | require.NoError(t, os.WriteFile(dockerPath, []byte(script), 0o755)) |
| 452 | |
| 453 | t.Setenv("PATH", tempDir+string(os.PathListSeparator)+os.Getenv("PATH")) |
| 454 | t.Setenv("MODEL_RUNNER_HOST", "") |
| 455 | |
| 456 | agentSource, err := config.Resolve("testdata/auto-model.yaml", nil) |
| 457 | require.NoError(t, err) |
| 458 | |
| 459 | // Use noEnvProvider to ensure no API keys are available, |
| 460 | // so DMR is the only fallback option. |
| 461 | runConfig := &config.RuntimeConfig{ |
| 462 | EnvProviderForTests: &noEnvProvider{}, |
| 463 | } |
| 464 | |
| 465 | _, err = Load(t.Context(), agentSource, runConfig, withTestProviderRegistry()...) |
| 466 | require.Error(t, err) |
| 467 | |
| 468 | var autoErr *config.AutoModelFallbackError |
| 469 | require.ErrorAs(t, err, &autoErr, "expected AutoModelFallbackError when auto model selection fails") |
| 470 | } |
| 471 | |
| 472 | func TestIsThinkingBudgetDisabled(t *testing.T) { |
| 473 | t.Parallel() |
nothing calls this directly
no test coverage detected