fix: vllm stream truncation - #5585
Conversation
|
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 (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe vLLM transcription provider now passes a nil payload when reporting an unexpectedly truncated SSE stream without a terminal marker. ChangesvLLM transcription stream
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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" Comment |
Merge activity
|
## Summary Fixes an issue in the vLLM provider's `TranscriptionStream` where a non-nil byte buffer was being passed to `SendStreamTruncatedError` when a stream is detected as truncated. Passing `nil` instead ensures consistent behavior and avoids potentially sending stale or partial buffer contents as part of the truncation error. ## Changes - In the truncation detection path of `TranscriptionStream`, the `body.Bytes()` argument passed to `SendStreamTruncatedError` is replaced with `nil`, aligning with the intended contract for that error path. ## Type of change - [x] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [x] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs ## How to test Trigger a transcription stream request against a vLLM backend that terminates without sending `[DONE]` and verify that the truncation error is surfaced correctly without any partial body data being included. ```sh go test ./core/providers/vllm/... ``` ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations No security implications. The change removes the forwarding of potentially partial response body bytes in an error path, which reduces the risk of leaking incomplete data. ## 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
## Summary Fixes an issue in the vLLM provider's `TranscriptionStream` where a non-nil byte buffer was being passed to `SendStreamTruncatedError` when a stream is detected as truncated. Passing `nil` instead ensures consistent behavior and avoids potentially sending stale or partial buffer contents as part of the truncation error. ## Changes - In the truncation detection path of `TranscriptionStream`, the `body.Bytes()` argument passed to `SendStreamTruncatedError` is replaced with `nil`, aligning with the intended contract for that error path. ## Type of change - [x] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [x] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs ## How to test Trigger a transcription stream request against a vLLM backend that terminates without sending `[DONE]` and verify that the truncation error is surfaced correctly without any partial body data being included. ```sh go test ./core/providers/vllm/... ``` ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations No security implications. The change removes the forwarding of potentially partial response body bytes in an error path, which reduces the risk of leaking incomplete data. ## 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

Summary
Fixes an issue in the vLLM provider's
TranscriptionStreamwhere a non-nil byte buffer was being passed toSendStreamTruncatedErrorwhen a stream is detected as truncated. Passingnilinstead ensures consistent behavior and avoids potentially sending stale or partial buffer contents as part of the truncation error.Changes
TranscriptionStream, thebody.Bytes()argument passed toSendStreamTruncatedErroris replaced withnil, aligning with the intended contract for that error path.Type of change
Affected areas
How to test
Trigger a transcription stream request against a vLLM backend that terminates without sending
[DONE]and verify that the truncation error is surfaced correctly without any partial body data being included.go test ./core/providers/vllm/...Breaking changes
Related issues
Security considerations
No security implications. The change removes the forwarding of potentially partial response body bytes in an error path, which reduces the risk of leaking incomplete data.
Checklist
docs/contributing/README.mdand followed the guidelines