mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4035] [Engine] Newline stop at max_tokens returns finish_reason "length" after removing the stop #1741
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1741
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Jackmeson1 on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4035
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Source (START-HERE.bat, setup.sh or a build)
What happened
On
/v1/chat/completionswithstop: ["\n"]andmax_tokens: 3, a greedy answer whose third token is the newline comes back as"ALPHA"withfinish_reason: "length". The server recognised the stop string and removed it from the content, but reports the token cap as the reason.The same request on
/v1/messages(stop_sequences: ["\n"],max_tokens: 3) returnsstop_reason: "stop_sequence"withstop_sequence: "\n".Expected:
finish_reason: "stop".docs/DETAILS.md("Current limits") says the answer ends before the first stop string, which is not sent, withfinish_reason"stop" (stop_reason"stop_sequence" on the Anthropic side).From the code at
7dd5cf18:serve/server.py:5606-5610builds thedonerecord with the engine'sfinish("length" here) and addsstop_sequencewhenstops.hitis set, without changingfinish.serve/server.py:6025) checksstop_sequencefirst, so it reportsstop_sequence.serve/server.py:5886) maps fromfinishalone, solengthstayslength.Smallest steps or command that reproduce it
Checkout
7dd5cf18e68c639a8773e096c5c79f971ea2a9f5.build/was configured with CMake; the values frombuild/CMakeCache.txtare: generator Unix Makefiles,CMAKE_BUILD_TYPE=Release,STRATA_ENABLE_CUDA=ON,CMAKE_CUDA_ARCHITECTURES=120.Server config I ran (
area3_config.json):Client, from another terminal:
The
max_tokens: 3control without a stop returnsALPHA\n, so the third token is the newline. I ran only this config (--vram-reserve-mib 74000leaves a partial expert cache on this 97,887 MiB card); the finish mapping above is inserve/server.py, not in the engine.Reproduction status
Reproduced locally, and again on 0.2.11 (see Strata version)
Strata version
0.2.11 (commit
c3b3f50355, engine 0.1.57), re-tested 2026-11-05. Still present. Throughserve/server.pywith the repository's byte tokenizer and a scripted engine outputALPHA\nBETA(no GPU), a request with a newline stop and a 6-token cap returnsALPHAwith the OpenAIfinish_reasonlength, streaming and non-streaming; the Anthropic endpoint reportsstop_sequence. The final flush inService._run(server.py around line 6720) still matches the stop after the loop, and the done record keepsfinish="length". The GPU reproduction above is from the original commit.Originally reported on commit
7dd5cf18e6(main), engine 0.1.49.2Graphics card, memory and system
NVIDIA RTX PRO 6000 Blackwell Server Edition 97,887 MiB · 176 GiB RAM · Ubuntu 24.04.4 LTS (Linux 6.6.122+, Google Colab), driver 580.82.07, CUDA 13.0.88, GCC 13.3.0, Python 3.13.16, AMD EPYC 9B45 (48 logical CPUs)
Model, size and settings
Qwen3.8-Flash-Next GSQ-RCO Q2_0 (two GGUF parts, pack, MTP draft layer) · 4096 context · INT8 KV · settings as in the config above
Logs
Client output (my run, 2026-10-25):
Server log, one
doneline per request in the same order:Not checked: streaming responses at this boundary, other models, other engine settings.
@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.
@Jackmeson1 commented on GitHub (Nov 5, 2026):
Re-tested on 0.2.11; the result is in the updated Strata version section of the issue.
@Jackmeson1 commented on GitHub (Nov 5, 2026):
/reopen
@github-actions[bot] commented on GitHub (Nov 5, 2026):
Reopened, thank you. A maintainer will pick it up from here.