Conversation
WalkthroughThe pull request adds Claude format support to the Minimax channel adaptor by introducing format-based dispatch logic. It delegates Claude-specific request and response handling to the claude adaptor while routing other formats to the openai adaptor, and adds a corresponding endpoint switch that directs Claude requests to the Anthropic messages endpoint. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
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)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@relay/channel/minimax/relay-minimax.go`:
- Around line 17-19: The Claude-case return mistakenly uses info.ChannelBaseUrl
(bypassing the empty-string fallback) instead of the computed baseUrl; update
the switch branch in relay-minimax.go (the case for types.RelayFormatClaude) to
use the local variable baseUrl when formatting the URL so the default MiniMax
base URL is used when info.ChannelBaseUrl is empty.
| switch info.RelayFormat { | ||
| case types.RelayFormatClaude: | ||
| return fmt.Sprintf("%s/anthropic/v1/messages", info.ChannelBaseUrl), nil |
There was a problem hiding this comment.
Bug: Uses info.ChannelBaseUrl instead of baseUrl, bypassing the empty-string fallback.
Lines 13–16 compute baseUrl with a fallback to the default MiniMax base URL when info.ChannelBaseUrl is empty. However, line 19 uses info.ChannelBaseUrl directly, so when the channel has no custom base URL configured, this will produce a URL like /anthropic/v1/messages (empty host), causing the request to fail.
🐛 Proposed fix
switch info.RelayFormat {
case types.RelayFormatClaude:
- return fmt.Sprintf("%s/anthropic/v1/messages", info.ChannelBaseUrl), nil
+ return fmt.Sprintf("%s/anthropic/v1/messages", baseUrl), nil
default:📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| switch info.RelayFormat { | |
| case types.RelayFormatClaude: | |
| return fmt.Sprintf("%s/anthropic/v1/messages", info.ChannelBaseUrl), nil | |
| switch info.RelayFormat { | |
| case types.RelayFormatClaude: | |
| return fmt.Sprintf("%s/anthropic/v1/messages", baseUrl), nil |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@relay/channel/minimax/relay-minimax.go` around lines 17 - 19, The Claude-case
return mistakenly uses info.ChannelBaseUrl (bypassing the empty-string fallback)
instead of the computed baseUrl; update the switch branch in relay-minimax.go
(the case for types.RelayFormatClaude) to use the local variable baseUrl when
formatting the URL so the default MiniMax base URL is used when
info.ChannelBaseUrl is empty.
Summary by CodeRabbit
Release Notes
New Features
Chores