[fix]: transcription - preserve the client's multipart filename so non-WAV containers are not relabelled audio.mp3 - #5823
Conversation
…ntainers are not relabelled
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe transcription flow now preserves the client’s multipart filename during ingress parsing and OpenAI provider conversion. Regression tests verify filename retention in the parsed request and final outbound multipart file part. ChangesTranscription filename preservation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" 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 |
…ntainers are not relabelled (#5823)
…ntainers are not relabelled (#5823)
…ntainers are not relabelled (maximhq#5823)
…ntainers are not relabelled (maximhq#5823)
…ntainers are not relabelled (maximhq#5823)
Summary
The
/v1/audio/transcriptionstransport parsed the multipart upload but never carried the part's filename, and the OpenAI ingress converter dropped it again when building the Bifrost request. The provider then fell back to magic-byte sniffing, which has no ftyp check, so MP4-family containers (m4a, mp4, webm) were relabelledaudio.mp3and rejected upstream with 400 "Audio file might be corrupted or unsupported".Changes
transports/bifrost-http/integrations/openai.go:parseTranscriptionMultipartRequestnow setstranscriptionReq.FilenamefromfileHeader.Filename(matching the sibling file-upload parser)core/providers/openai/transcription.go:ToBifrostTranscriptionRequestnow carriesFilenameintoschemas.TranscriptionInput.Type of change
Affected areas
How to test
cd core && go test ./providers/openai/ -run Transcription -vcd transports && go test ./bifrost-http/integrations/ -run ParseTranscriptionMultipartRequest -vBreaking changes
Related issues
Closes #5670
Security considerations
Filename is passed through as a multipart form filename only, not used for any filesystem access.
Checklist
docs/contributing/README.mdand followed the guidelines