mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4037] [Engine] Chat and Messages silently coerce boolean and fractional token limits #1742
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#1742
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/4037
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
/v1/chat/completionsacceptstrueand2.5in eithermax_tokensormax_completion_tokens; my requests produced 1 and 2 completion tokens respectively./v1/messagesdoes the same formax_tokens. Chatmax_tokens: falsealso succeeds and allows the 81-token answer to finish./v1/responsesrejects the testedmax_output_tokens: trueand2.5requests with HTTP 400 and"max_output_tokens must be a positive whole number".Expected: reject boolean and fractional token limits with HTTP 400 instead of silently converting them to a different generation budget. Preserve the documented integer
-1and0sentinel values.Chat and Messages convert their selected token limit with
int(...)atserve/server.py:7147andserve/server.py:7395. This convertsTrueto 1 and2.5to 2. With no other cap field supplied,Falsefalls through theorexpression to 0;Service.preparetreats that as the remaining context allowance (serve/server.py:4889-4898).Smallest steps or command that reproduce it
The same build and config as in #4035 (commit
7dd5cf18). Server:Client:
These cases are a subset of a larger client I ran; the log lines below are excerpts from that run, unchanged.
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 a scripted engine (no GPU), on Chat (max_tokensandmax_completion_tokens) and Messages (max_tokens), streaming and non-streaming:truereturns HTTP 200 with a budget of 1,2.5returns 200 with a budget of 2, andfalsereturns 200 with the remaining context as the budget; integer0and-1keep their documented meaning. Responses rejects all three with HTTP 400. The conversions are at server.py around lines 8596 and 8865. 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 · 4096 context · INT8 KV · the config in #4035
Logs
Excerpts from my run, 2026-10-25:
Not checked in this run: streaming requests, numeric-string caps,
falsein chatmax_completion_tokens, Messagesmax_tokens, or Responsesmax_output_tokens, or requests supplying both chat cap fields.@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.