ultraworkers-claw-code/rust/crates/api/src
YeonGyu-Kim 0530c509a3 fix(api): route openai/ and gpt- model prefixes to OpenAi provider
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.
2026-04-08 05:33:47 +09:00
..
providers fix(api): route openai/ and gpt- model prefixes to OpenAi provider 2026-04-08 05:33:47 +09:00
client.rs chore: additional AI slop cleanup and enforcer wiring from sessions 1/5 2026-04-03 18:35:27 +09:00
error.rs fix(api): Windows env hint + .env file loading fallback 2026-04-07 14:22:41 +09:00
http_client.rs feat: b6-openai-models — batch 6 2026-04-07 15:52:30 +09:00
lib.rs feat: b6-pdf-extract-v2 follow-up work — batch 6 2026-04-07 16:11:51 +09:00
prompt_cache.rs fix: cover merged prompt cache behavior 2026-04-02 11:31:53 +09:00
sse.rs fix(api): enrich JSON parse errors with response body, provider, and model 2026-04-07 14:22:05 +09:00
types.rs fix(api): add serde(default) to all usage/token parse paths in SSE stream 2026-04-07 13:44:22 +09:00