You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(relay): use mapped model for speech requests - #8527
The user asked Devin to fix MiniMax /v1/audio/speech model mapping and scan other audio adaptors for the same mistake. The user asked for a focused regression test, Go validation, and a pull request only if the issue remained open and unclaimed. The user asked Devin to treat the missing audio parameter override as out of scope unless it had a one-line consistent fix. This code is AI-generated and AI-assisted.
Summary
MiniMax and Volcengine speech conversion now send the mapped upstream model name.
OpenAI-compatible audio conversion already uses request.Model, which ModelMappedHelper updates. The scan of OriginModelName under relay/channel/ found no other implemented audio conversion path that sends the original name as the upstream model.
relay/audio_handler.go still does not call ApplyParamOverride. This pull request leaves that behavior unchanged because applying overrides after audio conversion requires generic io.Reader and payload handling rather than a one-line consistent fix.
Evidence
Before:
Issue #8500 reports new-api v1.0.0-rc.51 from the release or official image, self-deployed, with pass-through disabled. A MiniMax channel maps my-tts to speech-2.6-turbo. Every POST /v1/audio/speech request with model=my-tts sends the literal my-tts upstream and MiniMax returns 1008 insufficient balance. The same channel succeeds when speech-2.6-turbo reaches the upstream request body. The database engine is not involved in this request-serialization defect.
The new regression test failed before the fix:
$ go test ./relay/channel/minimax -run TestConvertAudioRequestUsesUpstreamModelName -count=1
--- FAIL: TestConvertAudioRequestUsesUpstreamModelName (0.00s)
adaptor_test.go:50:
Error: Not equal:
expected: "speech-2.6-turbo"
actual : "my-tts"
FAIL
FAIL github.com/QuantumNous/new-api/relay/channel/minimax 0.015s
FAIL
After:
$ gofmt -d relay/channel/minimax/adaptor.go relay/channel/minimax/adaptor_test.go relay/channel/volcengine/adaptor.go && git diff --check && go vet ./... && go build ./... && go test ./relay/channel/minimax ./relay/channel/volcengine -count=1
ok github.com/QuantumNous/new-api/relay/channel/minimax 0.018s
? github.com/QuantumNous/new-api/relay/channel/volcengine [no test files]
The command exited with code 0. gofmt -d, git diff --check, go vet ./..., and go build ./... produced no output.
Merge Danger
Door: two-way
Blast Radius: relay
Summary by CodeRabbit
Bug Fixes
Text-to-speech requests for MiniMax and Volcengine now use the configured upstream model, improving consistency between the selected model and the request sent to the service.
No actionable comments were generated in the recent review.
Walkthrough
MiniMax and Volcengine TTS request builders now use the upstream model name. A MiniMax test verifies the model and text in the converted request body.
Changes
TTS model mapping
Layer / File(s)
Summary
Use upstream model names in TTS requests relay/channel/minimax/adaptor.go, relay/channel/volcengine/adaptor.go, relay/channel/minimax/adaptor_test.go
Both TTS request builders now set the request model from info.UpstreamModelName. The MiniMax test checks the model and text in the converted request body.
MiniMax and Volcengine speech requests now send the channel-mapped model name, so aliases like my-tts forward correctly. Requests without a mapping send the same model as before. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix(relay): use mapped model for speech requests" matches the main change. The MiniMax and Volcengine speech adaptors now send info.UpstreamModelName instead of info.OriginModelName, so the…
Linked Issues check
[#8500] The issue requires the MiniMax audio/speech upstream request to use the channel-mapped model name instead of the original alias. At the reviewed head, relay/channel/minimax/adaptor.go `Conve…
Out of Scope Changes check
The PR changes three files: the MiniMax adaptor (one line), the MiniMax adaptor test (new test plus io, assert, and require imports), and the Volcengine adaptor (one line, Model from `info.Ups…
Full details: Title check
Explanation
The title "fix(relay): use mapped model for speech requests" matches the main change. The MiniMax and Volcengine speech adaptors now send info.UpstreamModelName instead of info.OriginModelName, so the mapped model is used. The title is specific and short, and it follows a conventional commit style. It does not cover the new test or the audio parameter override limitation, which is expected.
Full details: Linked Issues check
Explanation
[#8500] The issue requires the MiniMax audio/speech upstream request to use the channel-mapped model name instead of the original alias. At the reviewed head, relay/channel/minimax/adaptor.goConvertAudioRequest sets MiniMaxTTSRequest.Model from info.UpstreamModelName (diff from merge base changes only this line). AudioHelper runs ModelMappedHelper before the adaptor, so UpstreamModelName holds the mapped name (speech-2.6-turbo for my-tts). The new test TestConvertAudioRequestUsesUpstreamModelName sets OriginModelName to my-tts and UpstreamModelName to speech-2.6-turbo, then asserts the converted body has model equal to speech-2.6-turbo and text equal to the input. The PR reports this test failed before the fix and passes after. The issue also mentions parameter overrides not applying; the PR explicitly leaves that unchanged. The issue treats it as a separate limitation, not a requirement of the mapping fix, so it is not a failing requirement here. Unverified: I did not run the tests myself; the result relies on the reported command output and the visible test code.
Full details: Out of Scope Changes check
Explanation
The PR changes three files: the MiniMax adaptor (one line), the MiniMax adaptor test (new test plus io, assert, and require imports), and the Volcengine adaptor (one line, Model from info.UpstreamModelName instead of info.OriginModelName). The MiniMax changes implement #8500 directly. The Volcengine change applies the same defect fix to another audio conversion path. The PR description states the request was to scan other audio adaptors for the same mistake, and the change is a one-line instance of that same pattern, so it connects to the linked work. No unrelated refactoring, formatting, or documentation changes appear in the reviewed diffs. The override behavior is explicitly not changed.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
A rabbit checks the speech request, The mapped model hops in place. MiniMax sends the chosen name, Volcengine follows suit. The test reads the body, And finds the model and text inside.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 53ff8060-27c5-48eb-b787-199918018d67
Commits
Reviewing files that changed from the base of the PR and between 04dfcbb and da1dc4c.
Files selected for processing: 3
relay/channel/minimax/adaptor.go
relay/channel/minimax/adaptor_test.go
relay/channel/volcengine/adaptor.go
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent: Devin unknown · unknown · devin-box · 2026-12-02
Fixes #8500
Request summary
The user asked Devin to fix MiniMax
/v1/audio/speechmodel mapping and scan other audio adaptors for the same mistake. The user asked for a focused regression test, Go validation, and a pull request only if the issue remained open and unclaimed. The user asked Devin to treat the missing audio parameter override as out of scope unless it had a one-line consistent fix. This code is AI-generated and AI-assisted.Summary
MiniMax and Volcengine speech conversion now send the mapped upstream model name.
relay.AudioHelper helper.ModelMappedHelper info.UpstreamModelName = mapped model adaptor.ConvertAudioRequest - TTSRequest.Model = info.OriginModelName + TTSRequest.Model = info.UpstreamModelNameOpenAI-compatible audio conversion already uses
request.Model, whichModelMappedHelperupdates. The scan ofOriginModelNameunderrelay/channel/found no other implemented audio conversion path that sends the original name as the upstream model.relay/audio_handler.gostill does not callApplyParamOverride. This pull request leaves that behavior unchanged because applying overrides after audio conversion requires genericio.Readerand payload handling rather than a one-line consistent fix.Evidence
Issue #8500 reports new-api
v1.0.0-rc.51from the release or official image, self-deployed, with pass-through disabled. A MiniMax channel mapsmy-ttstospeech-2.6-turbo. EveryPOST /v1/audio/speechrequest withmodel=my-ttssends the literalmy-ttsupstream and MiniMax returns1008 insufficient balance. The same channel succeeds whenspeech-2.6-turboreaches the upstream request body. The database engine is not involved in this request-serialization defect.The new regression test failed before the fix:
The command exited with code 0.
gofmt -d,git diff --check,go vet ./..., andgo build ./...produced no output.Merge Danger
Door: two-way
Blast Radius: relay
Summary by CodeRabbit