Skip to content

fix: try fix retry /v1/audio/transcriptions - #2413

Closed
seefs001 wants to merge 4800 commits into
QuantumNous:mainfrom
seefs001:fix/transcriptions-500-fix
Closed

fix: try fix retry /v1/audio/transcriptions#2413
seefs001 wants to merge 4800 commits into
QuantumNous:mainfrom
seefs001:fix/transcriptions-500-fix

Conversation

@seefs001

@seefs001 seefs001 commented Dec 11, 2025

Copy link
Copy Markdown
Collaborator

fix #2403

Summary by CodeRabbit

Bug Fixes

  • Fixed Content-Type header handling during audio request retries for OpenAI integrations. The system now correctly preserves multipart form-data formatting when rebuilding requests, ensuring audio content is properly processed during retry operations.

✏️ Tip: You can customize this high-level summary in your review settings.

feitianbubu and others added 30 commits October 25, 2025 11:26
Signed-off-by: iwu <iwu@tencent.com>
feat(i-18n): Add Japanese localization
chore: Update AWS claude 4.5 haiku model's information
chore: Ignore .zed and debug binaries in .gitignore
feat: add image handling to image request for form-data
feat: vertex veo sora-compatible video output
fix(go): Correct Go module import paths
feat: add special user usable group setting
fix: 当totalWeight小于等于0时设置为1选择第一个渠道
…zero total weight and removing unnecessary variable
oudi and others added 27 commits December 4, 2025 11:18
Increase token name length limit from 30 to 50
- Add model to Claude ModelList
- Add model ratio (0.5, $1/1M input tokens)
- Add completion ratio support (5x, $5/1M output tokens)
- Add cache read ratio (0.1, $0.10/1M tokens)
- Add cache write ratio (1.25, $1.25/1M tokens)

Model specs:
- Context window: 200K tokens
- Max output: 64K tokens
- Release date: October 1, 2025
fix(adaptor): fix reasoning suffix not processing in vertex adapter
feat: add claude-haiku-4-5-20251001 model support
Increase token name length limit from 30 to 50
fix: Set default to unsupported value for gpt-5 model series requests
fix(go.mod): 更新modernc.org/sqlite依赖项版本
fix: Try to fix login error "already logged in" issue
fix: Use channel proxy settings for task query scenarios
@coderabbitai

coderabbitai Bot commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Captures the original Content-Type header from incoming requests and restores it during retry handling for OpenAI audio endpoints, preserving multipart/form-data boundary information required for proper request body parsing on retries.

Changes

Cohort / File(s) Summary
Audio retry Content-Type preservation
controller/relay.go
Adds capture of original Content-Type header and restores it during OpenAI audio endpoint retries when multipart/form-data is detected, preventing buffer parsing errors

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Minimal scope: single file with straightforward header preservation logic
  • Low density: targeted bug fix with clear intent and limited conditional logic
  • No architectural or control-flow changes

Possibly related PRs

Poem

🐰 A header lost, a retry failed,
But now we guard the multipart trail,
With boundary safe and form intact,
Audio flows through, fact on fact—
One small fix, transcription restored! 🎵

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly summarizes the main change: fixing retry issues for the /v1/audio/transcriptions endpoint. It directly relates to the changeset's objective.
Linked Issues check ✅ Passed The code changes address the linked issue #2403 by capturing the original Content-Type and restoring it during retries, which fixes the multipart form parsing error that occurred on retry attempts.
Out of Scope Changes check ✅ Passed All changes in controller/relay.go are directly scoped to fixing the retry handling for /v1/audio/transcriptions by managing Content-Type headers, with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fca015c and e28de47.

📒 Files selected for processing (1)
  • controller/relay.go (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
controller/relay.go (1)
types/relay_format.go (1)
  • RelayFormatOpenAIAudio (10-10)
🔇 Additional comments (2)
controller/relay.go (2)

69-69: LGTM! Proper capture of the original Content-Type header.

Capturing the Content-Type at the beginning of the request ensures the multipart boundary is preserved for retry attempts, which directly addresses the root cause of the 500 error described in issue #2403.


171-173: The Content-Type restoration logic is already safe and doesn't require the suggested check. The condition strings.Contains(originalContentType, "multipart/form-data") safely returns false when originalContentType is empty, making an additional empty string check redundant. The code correctly preserves the multipart boundary on retry for audio requests.


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 and usage tips.

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.

/v1/audio/transcriptions接口在重试的时候会出现500报错