Repository navigation
SWF(bug): stop empty stop sequences matching every output - #49
Merged
Merged
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration
Bot
force-pushed
the
devin/1795371427-empty-stop-sequence
branch
from
November 22, 2026 18:28
7266665 to
d5dc780
Compare
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.
stop: [""]no longer matches every output: empty stop strings are ignored in both the final strip (inference_impl/tail.rs) and the streaming holdback (chat_stream/handle_token/tail.rs).Summary
strip_stop_sequences_matchedusedstrip_suffix(""), which always succeeds, so any request containing an empty stop reported a matched stop (finish_reason: "stop", Anthropicstop_sequence: "") even when the model never stopped. The streaming path had the same root cause:find("")returnsSome(0), so the stream was cut to nothing on the first token. Both now skip empty strings before matching; non-empty stops in the same list still match as before.Failing run (before the fix)
Passing run (after the fix)
Full spark binary suite:
test result: ok. 3201 passed; 0 failed; 14 ignored(rebased on main after #51, no local workarounds).Why this is the root cause
An empty string is a suffix and a substring of every string, so
strip_suffix("")/find("")match unconditionally. Filtering empties at the two match sites is the minimal fix; the tests cover[""], empty text,["", "STOP"]in both orders, overlapping stops, and no stops.Try it
ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo test -p spark-server --bin spark empty_stop_sequences_never_match(Needs
bash scripts/ci_gpu_stubs.shon a GPU-less host.)Test plan
ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --workspace --tests— cleanbash scripts/check-license-headers.sh—valid: 4262, invalid: 0typos— cleancargo fmt --all -- --check— cleanUntested
No live GPU/model run: the change is in pure string handling, exercised directly by the unit tests.
CLA
Implemented in session Stop empty stop sequences matching every output
Review with Devin · Open in Devin Desktop