fix: offer the Anthropic API key instead of demanding it - #202
Conversation
After a successful QualityMax login, startup asked for an Anthropic key and then hard-exited with no skip, dead-ending users of the cc, codex, agy, opencode, cerebras, and ollama backends — none of which need one. Onboarding asked for the same key separately, so interactive first runs were prompted twice before being kicked out. Both prompts are now a paste-or-skip choice, asked at most once per process (startup stays quiet when onboarding already offered). Skipping enters the REPL, and a turn submitted with no inference backend prints guidance (/keys, /orch, /cerebras, /ollama) instead of failing with a raw 401. Headless one-shot runs without any inference still fail fast, now listing the keyless backend alternatives.
QualityMax ReviewVerdict: COMMENT · Confidence: evidence-backed scan Files eligible: 7 · Files reviewed: 7 · Files with findings: 0 · Findings: 0 · Inline cards: 0 Priority findings
Review gates
Important files
Change diagram — Flowgraph TD
Start[Start Startup] --> CheckInteractive{Interactive?}
CheckInteractive -- Yes --> Onboarding[RunInteractive]
Onboarding --> OfferKey{Offer Anthropic Key}
OfferKey -->|Skip| Continue[Continue to REPL]
OfferKey -->|Paste| SaveKey[Save Key]
SaveKey --> Continue
CheckInteractive -- No --> Headless{Headless?}
Headless -- Yes --> CheckInference{Inference Available?}
CheckInference -- No --> Exit[Exit with Error]
CheckInference -- Yes --> Run[Run Turn]
Continue --> CheckInference
Review lifecycleUse the inline cards to inspect evidence and suggested remediation. Re-run the QualityMax review after pushing a fix; unchanged cards are identified by their stable finding marker. Dismiss with a reason through the existing QualityMax/GitHub review feedback flow. 0 prior card(s) are stale/resolved on this head. Proof legend: VERIFIED independently judged patch · REPRODUCED verified finding · GROUNDED deterministic evidence · MODEL-ONLY model judgment. QualityMax project results are available in the configured project. Receipt · commit |
|
| Gate | Result |
|---|---|
| 🔍 AI diff review | ✅ Clean · gemini-3.1-flash-lite · completed · 6 eligible / 6 reviewed · gemini-3.1-flash-lite |
| 🔍 SAST | completed · 7 eligible / 7 reviewed · qwen3.7-plus |
| 🔍 Canonical PR review delivery | completed · 0 eligible / 0 reviewed · exact-head review #5210608812 and overview #5680954116 confirmed |
| 🧪 Repo Tests | ✅ 839/839 passed (go) |
Powered by QualityMax — AI-Powered Test Automation
Summary
After logging in to QualityMax, qmax-code demanded an Anthropic API key before it would start: the startup prompt had no skip, and answering it empty hard-exited the process. The key is now offered, never demanded — skipping is a supported state that lands in the REPL, where inference can be configured at any time.
Why now
User-reported: after first login and later re-authorization, the CLI kept asking for an Anthropic key with no ability to skip. Every alternative backend (Claude Code, Codex, Antigravity, opencode, Cerebras, Ollama) runs without one, so the demand dead-ended exactly the users who didn't need it. Onboarding also asked for the key separately from the startup prompt, so first runs were asked twice and then kicked out.
Key changes
embeddedInferenceAvailable): a turn with no inference backend is refused with actionable guidance instead of failing mid-request with a raw 401shouldOfferAnthropicKey/shouldExitWithoutInferencewith table tests; onboarding keychain writes go through a test seamRisks / notes
internal/update.TestExtractBinaryZipfails on current main independent of this change; expect that one red in CIReview instructions
Start with the offer/exit block in
main.go(shouldOfferAnthropicKey/shouldExitWithoutInferenceand their call site), thenpromptAnthropicKeyininternal/setup/interactive.go, then the turn guard +embeddedInferenceAvailableininternal/repl/repl.go. The predicates carry the behavior contract; the table tests inmain_validation_test.go,interactive_test.go, andbackend_switch_test.gopin each branch.