Opus finding
detectProviders() inconsistently validates the anthropic key (skips sk-ant- prefix check used by getAnthropicKey)
lowapi-contracthigh
- src/config.ts:180-192
detectProviders reads ANTHROPIC_API_KEY directly with trim(), while openai/deepseek call their helpers. validateProviderKeys uses getAnthropicKey() which enforces the 'sk-ant-' prefix. So a status UI that calls detectProviders will report anthropic 'configured' even when the value is invalid; then validateProviderKeys will throw at runtime. UI/runtime disagreement is a contract gap. Easy fix: also call getAnthropicKey() but wrap to swallow throws into null (since detection is intentionally non-throwing).
Recommendation
Implement detectProviders().anthropic via a try/catch around getAnthropicKey() so the status UI reflects 'unset OR malformed → null'.