Skip to content

fix: vllm stream truncation - #5585

Merged
akshaydeo merged 1 commit into
devfrom
07-27-fix_vllm_stream_truncation
Jul 27, 2026
Merged

fix: vllm stream truncation#5585
akshaydeo merged 1 commit into
devfrom
07-27-fix_vllm_stream_truncation

Conversation

@sammaji

@sammaji sammaji commented Jul 27, 2026

Copy link
Copy Markdown
Member

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

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

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • 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.

go test ./core/providers/vllm/...

Breaking changes

  • Yes
  • 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

@coderabbitai

coderabbitai Bot commented Jul 27, 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: 2f4ebb58-8121-4dd1-919e-d99129302a41

📥 Commits

Reviewing files that changed from the base of the PR and between 63b41c6 and 7f61f25.

📒 Files selected for processing (1)
  • core/providers/vllm/vllm.go

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of unexpectedly interrupted transcription streams.
    • Prevented incomplete raw response data from being included in truncated-stream errors.

Walkthrough

The vLLM transcription provider now passes a nil payload when reporting an unexpectedly truncated SSE stream without a terminal marker.

Changes

vLLM transcription stream

Layer / File(s) Summary
Update truncated-stream error payload
core/providers/vllm/vllm.go
TranscriptionStream passes nil instead of buffered body bytes to truncated-stream error handling.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

Suggested reviewers: akshaydeo, tejasghatte

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly reflects the main change: fixing vLLM transcription stream truncation handling.
Description check ✅ Passed The PR description follows the template and covers summary, changes, testing, type, affected areas, breaking changes, security, and checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 07-27-fix_vllm_stream_truncation

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 @coderabbitai help to get the list of available commands.

sammaji commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sammaji
sammaji marked this pull request as ready for review July 27, 2026 13:05
Copilot AI review requested due to automatic review settings July 27, 2026 13:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai
coderabbitai Bot requested review from TejasGhatte and akshaydeo July 27, 2026 13:06

akshaydeo commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • Jul 27, 3:50 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 27, 3:51 PM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo
akshaydeo merged commit 9ceadae into dev Jul 27, 2026
14 checks passed
@akshaydeo
akshaydeo deleted the 07-27-fix_vllm_stream_truncation branch July 27, 2026 15:51
akhsaul pushed a commit to akhsaul/bifrost that referenced this pull request Aug 27, 2026
## 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
occcat pushed a commit to occcat/bifrost that referenced this pull request Sep 2, 2026
## 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
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.

3 participants