mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-15 19:52:50 +03:00
The unified Kimi Code card's API-key branch posted provider: "kimi-coding" to POST /api/providers. "kimi-coding" is an OAuth-primary managed id, not an admitted API-key/dual-auth connection id, so the backend correctly rejected it with 400 "Invalid provider" even though key validation passed. Add resolveApiKeySaveProviderId() in useApiKeySave.ts to remap the posted provider id to the dedicated, admitted managed API-key id "kimi-coding-apikey" for the API-key save flow only. The OAuth flow (handleOAuthSuccess in ProviderDetailPageClient.tsx) never calls this hook and keeps posting "kimi-coding" unchanged. Regression test: tests/unit/bug-10096-kimi-coding-apikey-save.test.ts