mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#5254
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/4934
Author: @dan64
Created: 11/1/2026
Status: 🔄 Open
Base:
main← Head:serve/shared-settings-tolerate-unknown📝 Commits (1)
15ae1easerve: one unknown key in .shared-settings.json no longer clears the rest (#4933)📊 Changes
2 files changed (+97 additions, -7 deletions)
View changed files
📝
serve/server.py(+35 -7)📝
serve/test_server.py(+62 -0)📄 Description
Fixes #4933.
Problem and result
One unknown key in a config's
.shared-settings.jsonemptied every shared Chat setting, silently. The start-uppath reused the strict reader that
POST /settingsuses, and swallowed itsValueErrorwithsvc.shared = {}:So one key the server did not recognise — a typo, a key from a newer version — also dropped
reasoning_effortwrittennext to it, and nothing in the log said so. Reproduced with two boots in #4933: with
{"reasoning_effort":"medium","preserve_thinking":false}the start-up lineother apps use the Chat settings: ...does not appear at all; with{"reasoning_effort":"medium"}alone it does.After this PR, the same file boots with:
Related discussion
Issue #4933. Found while preparing #4932 (which makes
preserve_thinking/preserve_reasoningknown keys and sohides the symptom for those two): the behaviour that matters is the one for any unknown key, and that is what this
PR changes. The two PRs touch different lines of
serve/server.pyand do not depend on each other.Approach
load_shared_settings(path, warn=print)reads the file at start-up, key by key, and tells the three failures apart:{}, no message: the normal case on a first start;now one line says which file and why;
others keep applying.
clean_shared_defaultsis untouched and still raises, soPOST /settingskeeps answering a client with a 400 namingthe key — that path did not change:
Compatibility: nothing that worked before behaves differently. A file that was read successfully is read to the same
dict; a file that used to clear everything now keeps its known keys, which is the fix.
warnis a parameter so thetests can read the messages instead of capturing stdout.
SHARED_KEYSis a separate, pre-existing tuple that nothing reads; I left it alone rather than bundle an unrelatededit (it is updated in #4932 where new keys are added).
Validation
Environment: Windows 11 Pro 26300, i7-12700KF, RTX 5070 Ti 16 GB (sm_120), 111.8 GiB RAM; engine 0.1.51 (CUDA,
compiled locally); model Qwen3.8-Flash-Next Uncensored Q4_K_S,
--ple-io direct,--kv q4_0, 524288 context.Server:
serve/server.py --engine strata --config <cfg>.json --port 9985.Revision tested: 3e140618, on top of upstream
c62d5e3a. The commit was then amended to15ae1ea3, which changesone thing: the example key in
test_an_unknown_key_no_longer_clears_the_known_onesis now a made-uppreserve_thoughtsinstead of
preserve_thinking(#4932 makes the latter a known key, so on a tree carrying both changes that test wouldhave passed without exercising anything). After that edit
LoadSharedSettingswas re-run alone: 7 passed. The fullpytest figure below was measured on
3e140618and was not repeated.Passed
python -m pytest serve/test_server.py serve/test_frontend.py -q— 389 passed, 3 skipped, 631 subtests passed in116.40 s, including the 7 new tests in
LoadSharedSettings(two known keys kept; an unknown key no longer clears theothers; a bad value named and skipped; several bad keys each named; unparsable file ignored whole and reported; a
non-object ignored whole and reported; a missing file quiet).
Boot A on this revision, the exact file that failed in #4933 (
reasoning_effort+preserve_thinking), stdout:Before the change the same file printed neither line (evidence in #4933).
POST /settingson the same running server: a bad key still answers 400 naming it; a valid body answers200 and applies.
Failed: none observed.
Not run
--serverestart path that re-reads the file, and--batch/ multi-slot modes with a corrupt settings file.Limits
default it would otherwise have had, so a file containing
{"top_p": 5, "reasoning_effort": "medium"}leavestop_punset rather than set to the server's default.POST /settingsremains the path that refuses the whole body.guessing at a shape the server never wrote.
printat start-up, as the neighbouring lines do; they are not part of the structured/metricsor the monitor.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.