Skip to content

[fix]: transcription - preserve the client's multipart filename so non-WAV containers are not relabelled audio.mp3 - #5823

Merged
akshaydeo merged 1 commit into
maximhq:devfrom
AdityaPainuli:fix/transcription-filename-5670
Aug 4, 2026
Merged

[fix]: transcription - preserve the client's multipart filename so non-WAV containers are not relabelled audio.mp3#5823
akshaydeo merged 1 commit into
maximhq:devfrom
AdityaPainuli:fix/transcription-filename-5670

Conversation

@AdityaPainuli

Copy link
Copy Markdown
Contributor

Summary

The /v1/audio/transcriptions transport 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 relabelled audio.mp3 and rejected upstream with 400 "Audio file might be corrupted or unsupported".

Changes

  • transports/bifrost-http/integrations/openai.go: parseTranscriptionMultipartRequest now sets transcriptionReq.Filename from fileHeader.Filename (matching the sibling file-upload parser)
  • core/providers/openai/transcription.go: ToBifrostTranscriptionRequest now carries Filename into schemas.TranscriptionInput.
  • Tests: transport-level filename propagation test, plus a core round-trip test (ingress → egress → multipart form) asserting the wire form file part keeps its real name; the round-trip test fails on current dev

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

cd core && go test ./providers/openai/ -run Transcription -v
cd transports && go test ./bifrost-http/integrations/ -run ParseTranscriptionMultipartRequest -v

Breaking changes

  • No

Related issues

Closes #5670

Security considerations

Filename is passed through as a multipart form filename only, not used for any filesystem access.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 17265661-791a-403b-9feb-600dac8c7857

📥 Commits

Reviewing files that changed from the base of the PR and between 81bd10e and 57e006f.

📒 Files selected for processing (4)
  • core/providers/openai/transcription.go
  • core/providers/openai/transcription_test.go
  • transports/bifrost-http/integrations/openai.go
  • transports/bifrost-http/integrations/openai_test.go

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Preserved uploaded audio filenames throughout transcription processing.
    • Multipart transcription requests now retain the original filename instead of using a fallback.
  • Tests
    • Added coverage verifying filename preservation for common audio formats, including M4A and MP3 files.

Walkthrough

The 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.

Changes

Transcription filename preservation

Layer / File(s) Summary
Multipart filename capture
transports/bifrost-http/integrations/openai.go, transports/bifrost-http/integrations/openai_test.go
The multipart parser copies the uploaded file’s filename into OpenAITranscriptionRequest.Filename. The parser test verifies sample.mp3.
Provider filename forwarding
core/providers/openai/transcription.go, core/providers/openai/transcription_test.go
ToBifrostTranscriptionRequest copies request.Filename into TranscriptionInput.Filename. The end-to-end test verifies recording.m4a reaches the outbound multipart file part.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: akshaydeo, tejasghatte

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the filename-preservation fix and its effect on non-WAV containers.
Description check ✅ Passed The description covers the problem, changes, tests, affected areas, breaking changes, security, issue, and checklist, but omits the transport area checkbox.
Linked Issues check ✅ Passed The changes implement both required filename assignments and add tests for transport parsing and end-to-end filename preservation [#5670].
Out of Scope Changes check ✅ Passed All production and test changes directly support preserving transcription filenames and preventing incorrect container relabelling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai
coderabbitai Bot requested review from TejasGhatte and akshaydeo August 4, 2026 05:15
@akshaydeo
akshaydeo merged commit 8665274 into maximhq:dev Aug 4, 2026
5 checks passed
akshaydeo pushed a commit that referenced this pull request Aug 5, 2026
akshaydeo pushed a commit that referenced this pull request Aug 7, 2026
atharvamhaske pushed a commit to atharvamhaske/bifrost that referenced this pull request Aug 13, 2026
akhsaul pushed a commit to akhsaul/bifrost that referenced this pull request Aug 27, 2026
occcat pushed a commit to occcat/bifrost that referenced this pull request Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Transcription drops the client's multipart filename, so non-WAV containers are relabelled audio.mp3 and rejected

2 participants