mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-08-27 14:17:10 -04:00
fix(learn): finish gemini-flash-latest default model sweep (#532)
Google deprecated gemini/gemini-2.0-flash; headroom learn silently fails when GEMINI_API_KEY is set. PR #532 updated the default in analyzer.py but left stale references in the CLI help text and unit test assertion.
This commit is contained in:
parent
a359dae38f
commit
d7973665f4
3 changed files with 4 additions and 4 deletions
|
|
@ -87,7 +87,7 @@ Use 'auto' (default) to scan all detected agents."""
|
|||
"--model",
|
||||
type=str,
|
||||
default=None,
|
||||
help="LLM model for analysis (e.g., claude-sonnet-4-6, gpt-4o, gemini/gemini-2.0-flash). "
|
||||
help="LLM model for analysis (e.g., claude-sonnet-4-6, gpt-4o, gemini/gemini-flash-latest). "
|
||||
"Auto-detected from API keys if not specified.",
|
||||
)
|
||||
@click.option(
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ logger = logging.getLogger(__name__)
|
|||
_MODEL_DEFAULTS: list[tuple[str, str]] = [
|
||||
("ANTHROPIC_API_KEY", "claude-sonnet-4-6"),
|
||||
("OPENAI_API_KEY", "gpt-4o"),
|
||||
("GEMINI_API_KEY", "gemini/gemini-2.0-flash"),
|
||||
("GEMINI_API_KEY", "gemini/gemini-flash-latest"),
|
||||
]
|
||||
|
||||
_MAX_DIGEST_TOKENS = 80_000 # Budget for the digest (leave room for prompt + output)
|
||||
|
|
@ -94,7 +94,7 @@ def _detect_default_model() -> str:
|
|||
"No LLM API key found. headroom learn needs one of:\n"
|
||||
" export ANTHROPIC_API_KEY=sk-ant-... → uses claude-sonnet-4-6\n"
|
||||
" export OPENAI_API_KEY=sk-... → uses gpt-4o\n"
|
||||
" export GEMINI_API_KEY=... → uses gemini-2.0-flash\n"
|
||||
" export GEMINI_API_KEY=... → uses gemini-flash-latest\n"
|
||||
"Or set HEADROOM_LEARN_CLI to a coding agent CLI (claude, gemini, codex).\n"
|
||||
"Or install one of those CLIs for auto-detection.\n"
|
||||
"Or specify a model directly: headroom learn --model <litellm-model-name>"
|
||||
|
|
|
|||
|
|
@ -466,7 +466,7 @@ class TestDetectDefaultModel:
|
|||
monkeypatch.delenv("ANTHROPIC_API_KEY", raising=False)
|
||||
monkeypatch.delenv("OPENAI_API_KEY", raising=False)
|
||||
monkeypatch.setenv("GEMINI_API_KEY", "test")
|
||||
assert _detect_default_model() == "gemini/gemini-2.0-flash"
|
||||
assert _detect_default_model() == "gemini/gemini-flash-latest"
|
||||
|
||||
def test_anthropic_preferred_over_openai(self, monkeypatch):
|
||||
monkeypatch.setenv("ANTHROPIC_API_KEY", "sk-ant-test")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue