[Bugfix][Frontend] Report Cohere stop sequences correctly - #51556
Merged
DarkLight1337 merged 2 commits intoAug 11, 2026
Merged
DarkLight1337 merged 2 commits into
DarkLight1337 merged 2 commits into
Conversation
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: cherry77-cloud <1615405@qq.com>
taking-lying-flat
marked this pull request as ready for review
August 9, 2026 15:04
taking-lying-flat
requested review from
AndreasKaratzas,
DarkLight1337,
NickLucche,
aarnphm and
robertgshaw2-redhat
as code owners
August 9, 2026 15:04
andrewbcohere
approved these changes
Aug 10, 2026
DarkLight1337
approved these changes
Aug 10, 2026
DarkLight1337
enabled auto-merge (squash)
August 10, 2026 23:12
Member
|
/ci run |
|
✅ Triggered Buildkite CI #83232 for commit |
Contributor
Author
|
The previous full CI run (Buildkite #83232) was triggered for commit 757a502. I subsequently merged main into this branch, which changed the current HEAD to 3a3cc93. The checks currently attached to the new HEAD are passing, but the full Buildkite CI run is still associated with the old commit. Sorry for invalidating the previous run. Could a maintainer please trigger full CI again for the current HEAD? |
Member
|
/ci run |
|
✅ Triggered Buildkite CI #83283 for commit |
zyp2014
pushed a commit
to zyp2014/vllm
that referenced
this pull request
Aug 21, 2026
…ct#51556) Signed-off-by: cherry77-cloud <1615405@qq.com> Co-authored-by: OpenAI Codex <codex@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
STOP_SEQUENCEinstead ofCOMPLETEstop_reasonthrough the Cohere streaming state machineRoot cause
vLLM represents EOS, stop-token, and stop-string termination with
finish_reason="stop". A matched stop string is carried separately instop_reason, but the Cohere v2 conversion only inspectedfinish_reason. As a result, its existingSTOP_SEQUENCEmapping was unreachable in both response paths.User impact
Cohere v2 clients can now distinguish a configured stop-sequence match from ordinary completion in both regular responses and SSE
message-endevents.Why this is not duplicating an existing PR
I searched open pull requests using
cohere stop_reason,cohere stop sequence, andCohere STOP_SEQUENCE, and found no open PR covering this behavior. PR #45807 addresses the analogous Anthropic Messages API conversion, not the Cohere v2 endpoint or its streaming state.Testing
Result:
150 passed.Result: all checks passed; all three files were already formatted.
Model evaluation
Not run (not applicable). This change only maps already-produced termination metadata to the Cohere wire enum; it does not change model execution, token generation, or accuracy.
AI Assistance
AI assistance was used to investigate the lifecycle mismatch, construct regression cases, draft the implementation, and review counterexamples. I reviewed the final diff and the test results below.
The submitting author reviewed every changed line in the final diff.