Onboarding follows the vision provider

The wizard's fresh config.toml now carries both [vision.*] blocks, and
its credential pass reads the ACTIVE provider before prompting: an
anthropic setup asks for ANTHROPIC_API_KEY as before, a keyed
openai-compatible endpoint asks for its configured key_env instead,
and a keyless local runtime says so and asks for nothing. Doc sweep
for the same: README's stage list and knobs line, CLAUDE.md's config
summary (which still claimed username lived there), the Help flow's
"Claude vision" wording, and .env.example's ANTHROPIC_API_KEY note.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016jXZFSTZQKzAC8fqpWSz9g
This commit is contained in:
Eric Wagoner
2026-08-03 18:48:22 -04:00
co-authored by Claude Fable 5
parent 118503e4e0
commit 15d3120029
6 changed files with 89 additions and 6 deletions
+43
View File
@@ -147,3 +147,46 @@ def test_env_file_is_owner_only_from_creation(tmp_path, monkeypatch):
_clear_env(monkeypatch)
_run(tmp_path, answers={"BGG_API_TOKEN": "tok-123"})
assert _os.stat(tmp_path / ".env").st_mode & 0o777 == 0o600
def test_vision_key_prompt_follows_the_configured_provider(tmp_path, monkeypatch):
_clear_env(monkeypatch)
monkeypatch.delenv("MY_VISION_KEY", raising=False)
# a local, keyless openai-compatible setup: no Anthropic prompt at all
(tmp_path / "config.toml").write_text(
"""
vision_provider = "openai-compatible"
[vision."openai-compatible"]
base_url = "http://localhost:11434/v1"
model = "qwen2.5vl:7b"
key_env = ""
"""
)
report = _run(tmp_path, interactive=False)
assert "ANTHROPIC_API_KEY" not in report.keys_missing
# a keyed endpoint prompts for ITS env var instead
(tmp_path / "config.toml").write_text(
"""
vision_provider = "openai-compatible"
[vision."openai-compatible"]
base_url = "https://openrouter.ai/api/v1"
model = "some/vision-model"
key_env = "MY_VISION_KEY"
"""
)
report = _run(tmp_path, interactive=False)
assert "MY_VISION_KEY" in report.keys_missing
assert "ANTHROPIC_API_KEY" not in report.keys_missing
def test_fresh_config_template_carries_both_vision_blocks(tmp_path, monkeypatch):
_clear_env(monkeypatch)
_run(tmp_path, interactive=False)
from bggpipe.config import load_config
cfg = load_config(tmp_path / "config.toml")
assert cfg.vision_provider == "anthropic"
assert cfg.model == "claude-sonnet-5" # active block applied cleanly