mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1663] [CLOSED] serve: a sampling field of the wrong type is a 400 that names it #3591
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#3591
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1663
Author: @midagedev
Created: 10/9/2026
Status: ❌ Closed
Base:
main← Head:request-sampling-types📝 Commits (1)
c67db95serve: a sampling field of the wrong type is a 400 that names it📊 Changes
2 files changed (+63 additions, -1 deletions)
View changed files
📝
serve/server.py(+24 -0)📝
serve/test_request_hardening.py(+39 -1)📄 Description
Summary
A request with
"temperature": "0.7","top_k": 40.0or"seed": truegot a 200 and a greedy reply. The bad value replaced the configured default inrun()'s merge, thensampling_keysdropped it as not a number. Now it is a 400 that names the field, as POST /settings and the run config already do.What changed
serve/server.py:check_request_sampling(req)checks types only (a number for temperature, top_p, min_p and the penalties; an integer for top_k, penalty_last_n and seed; never bool). Chat, messages, count_tokens and responses call it before anything is sent.serve/test_request_hardening.py: a wrong type gets 400 on each endpoint; in-type values of any range and null fields still get 200.Ranges and every well-typed request behave as before.
Extra Notes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.