Fix: Remove Hardcoded /v1 From OpenAI Provider URL Path#16
Conversation
Move /v1 into the default base URL instead of appending it in Send(). Custom base URLs (e.g. Gloo's /ai/v2 endpoint) no longer get /v1 injected, which caused 404 errors when routing through proxies that use their own version prefix. Entire-Checkpoint: e3e6eed9ea99
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe OpenAI provider's default base URL is updated from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
This fix removes the hardcoded "/v1" path segment from OpenAI provider URL construction, moving it into the default base URL instead. This prevents automatic injection of "/v1" into custom base URLs, allowing proxies and gateways with their own version prefixes to work correctly without encountering 404 errors.
Changelog
Fixed
Changed
https://api.openai.comtohttps://api.openai.com/v1baseURL + "/chat/completions"instead ofbaseURL + "/v1/chat/completions"axetoaxe*for more flexible file matchingAdded
TestOpenAI_Send_CustomBaseURL_NoV1Prefixto verify that custom base URLs (e.g., endpoints with/ai/v2) are not modified with additional/v1prefixesEntire-Checkpoint: e3e6eed9ea99