mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-08 17:14:49 +08:00
metadata_for_model returned None for unknown models like openai/gpt-4.1-mini, causing detect_provider_kind to fall through to auth-sniffer order. If ANTHROPIC_API_KEY was set, the model was silently misrouted to Anthropic and the user got a confusing 'missing Anthropic credentials' error. Fix: add explicit prefix checks for 'openai/' and 'gpt-' in metadata_for_model so the model name wins over env-var presence. Regression test added: openai_namespaced_model_routes_to_openai_not_anthropic - 'openai/gpt-4.1-mini' routes to OpenAi - 'gpt-4o' routes to OpenAi Reported and reproduced by gaebal-gajae against current main. 81 api lib tests passing, 0 failing.