[GH-ISSUE #4933] [Other] serve: one unknown key in .shared-settings.json silently disables every shared setting #2270

Open
opened 2026-11-04 01:58:04 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @dan64 on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4933

Summary

One unknown key in a config's .shared-settings.json does not lose just that key: it empties every shared Chat
setting, silently
, for the whole life of the server. reasoning_effort written next to it stops applying too, and
nothing in the log says so.

clean_shared_defaults (serve/server.py:8473) is deliberately strict — it is what /settings uses to answer a
client with a 400 naming a bad key (serve/server.py:8509). The start-up path reuses it and swallows the same error:

# serve/server.py:9469-9476
svc.shared_path = str(Path(a.config).with_suffix("")) + ".shared-settings.json"
try:
    svc.shared = clean_shared_defaults(json.loads(Path(svc.shared_path).read_text(encoding="utf-8")))
    if svc.shared:
        print("[strata] other apps use the Chat settings: " + ...)
except (OSError, ValueError):
    svc.shared = {}

The same ValueError therefore means "tell the client which key is wrong" on one path and "forget everything, in
silence" on the other.

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 9983
  • Revision: upstream main at c62d5e3a (no local patches)

Reproduce

Two runs of the same server, the same model, the same config — only the .shared-settings.json next to it differs.
The config is a copy of a working Q4_K_S config, with log changed; the server file is
<config>.shared-settings.json, as server.py:9469 builds it.

  1. <cfg-a>.shared-settings.json:

    {"reasoning_effort": "medium", "preserve_thinking": false}
    
  2. <cfg-b>.shared-settings.json:

    {"reasoning_effort": "medium"}
    

Start the server on each and look for the start-up line that reports what the shared settings will be.

Expected

Two reasonable outcomes, either is fine and neither happens today:

  • the unknown key is named and skipped, and the settings that are known keep applying (reasoning_effort=medium
    stays in force); or
  • the server refuses to start, saying which key it does not know.

What should not happen is that a typo in one key silently disables the others.

Actual

Boot A (reasoning_effort + preserve_thinking), stdout:

[strata] sampling defaults from the config: ...
[strata] starting the engine: reading the model's weights ...
[strata] still starting (27 s) - please wait ...
[strata] still starting (47 s) - please wait ...
[strata] experts loaded: 68.26 GiB at 1.96 GiB/s (52 s so far)
[strata] filling the GPU's expert cache (2880 experts, 7.99 GiB of VRAM) ...
[strata] almost ready ...
ready: http://127.0.0.1:9983/v1  (OpenAI: /v1/chat/completions, Anthropic: /v1/messages, context 524288 tokens, images on)

No [strata] other apps use the Chat settings: ... line at all. The server is healthy and answers; the shared
settings are {}. The reasoning_effort=medium that was in the same file is gone with the unknown key, and there is
no warning anywhere:

$ Select-String -Path <stdout-a> -Pattern 'Chat settings'
(nothing)

Boot B (reasoning_effort alone), same machine, same revision, stdout:

[strata] other apps use the Chat settings: reasoning_effort=medium
ready: http://127.0.0.1:9984/v1  (OpenAI: /v1/chat/completions, Anthropic: /v1/messages, context 524288 tokens, images on)

So the key was accepted and applied in B and silently discarded in A — the difference between the two runs is exactly
the one extra key.

The mechanism, from the source (this part is read, not executed as a separate test):

$ python -c "from serve.server import clean_shared_defaults; clean_shared_defaults({'reasoning_effort':'medium','unknown_key':1})"
ValueError: unknown setting 'unknown_key'

and that ValueError is caught by except (OSError, ValueError): svc.shared = {}.

Evidence

preserve_thinking is the key I hit it with, and it is a useful example because it is not a typo: it is the name
Qwen's chat templates test, and a user who wants the reasoning of earlier turns out of the prompt has a reason to write
it there. Any other key a user might invent does the same thing. I opened #4932 (still a draft) to make those two keys
known, which stops it for them — but it leaves the behaviour for every other unknown key exactly as it is.

Reproduction status

Reproduced locally, twice, on the revision above: the A/B above is two boots, not a reading of the code.
The /settings 400 path was not exercised in this report; it is cited from
serve/server.py:7775-7777 only.

What I would change (a suggestion, not a decision for me to make)

Keep the strictness where a client can be told about it, and separate "this file is unusable" from "this key is
unknown":

  • unreadable file / not a JSON object / not a dict → keep svc.shared = {}, but print one line saying the file was
    ignored and why;
  • a known key with a bad value, or an unknown key → name it, skip it, keep the rest (reasoning_effort stays in force).

The second bullet is a behaviour decision (skip and continue vs. refuse to start), which is why I am reporting it
rather than guessing: a server that starts with half of a user's settings silently missing is what caused this report
in the first place.

Originally created by @dan64 on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4933 ## Summary One unknown key in a config's `.shared-settings.json` does not lose just that key: it **empties every shared Chat setting, silently**, for the whole life of the server. `reasoning_effort` written next to it stops applying too, and nothing in the log says so. `clean_shared_defaults` (`serve/server.py:8473`) is deliberately strict — it is what `/settings` uses to answer a client with a 400 naming a bad key (`serve/server.py:8509`). The start-up path reuses it and swallows the same error: ```python # serve/server.py:9469-9476 svc.shared_path = str(Path(a.config).with_suffix("")) + ".shared-settings.json" try: svc.shared = clean_shared_defaults(json.loads(Path(svc.shared_path).read_text(encoding="utf-8"))) if svc.shared: print("[strata] other apps use the Chat settings: " + ...) except (OSError, ValueError): svc.shared = {} ``` The same `ValueError` therefore means "tell the client which key is wrong" on one path and "forget everything, in silence" on the other. ## 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 9983` - Revision: upstream `main` at **c62d5e3a** (no local patches) ## Reproduce Two runs of the same server, the same model, the same config — only the `.shared-settings.json` next to it differs. The config is a copy of a working Q4_K_S config, with `log` changed; the server file is `<config>.shared-settings.json`, as `server.py:9469` builds it. 1. `<cfg-a>.shared-settings.json`: ```json {"reasoning_effort": "medium", "preserve_thinking": false} ``` 2. `<cfg-b>.shared-settings.json`: ```json {"reasoning_effort": "medium"} ``` Start the server on each and look for the start-up line that reports what the shared settings will be. ## Expected Two reasonable outcomes, either is fine and neither happens today: - the unknown key is named and skipped, and the settings that **are** known keep applying (`reasoning_effort=medium` stays in force); or - the server refuses to start, saying which key it does not know. What should not happen is that a typo in one key silently disables the others. ## Actual **Boot A** (`reasoning_effort` + `preserve_thinking`), stdout: ``` [strata] sampling defaults from the config: ... [strata] starting the engine: reading the model's weights ... [strata] still starting (27 s) - please wait ... [strata] still starting (47 s) - please wait ... [strata] experts loaded: 68.26 GiB at 1.96 GiB/s (52 s so far) [strata] filling the GPU's expert cache (2880 experts, 7.99 GiB of VRAM) ... [strata] almost ready ... ready: http://127.0.0.1:9983/v1 (OpenAI: /v1/chat/completions, Anthropic: /v1/messages, context 524288 tokens, images on) ``` No `[strata] other apps use the Chat settings: ...` line at all. The server is healthy and answers; the shared settings are `{}`. The `reasoning_effort=medium` that was in the same file is gone with the unknown key, and there is no warning anywhere: ``` $ Select-String -Path <stdout-a> -Pattern 'Chat settings' (nothing) ``` **Boot B** (`reasoning_effort` alone), same machine, same revision, stdout: ``` [strata] other apps use the Chat settings: reasoning_effort=medium ready: http://127.0.0.1:9984/v1 (OpenAI: /v1/chat/completions, Anthropic: /v1/messages, context 524288 tokens, images on) ``` So the key was accepted and applied in B and silently discarded in A — the difference between the two runs is exactly the one extra key. The mechanism, from the source (this part is read, not executed as a separate test): ``` $ python -c "from serve.server import clean_shared_defaults; clean_shared_defaults({'reasoning_effort':'medium','unknown_key':1})" ValueError: unknown setting 'unknown_key' ``` and that `ValueError` is caught by `except (OSError, ValueError): svc.shared = {}`. ## Evidence `preserve_thinking` is the key I hit it with, and it is a useful example because it is not a typo: it is the name Qwen's chat templates test, and a user who wants the reasoning of earlier turns out of the prompt has a reason to write it there. Any other key a user might invent does the same thing. I opened #4932 (still a draft) to make those two keys known, which stops it for them — but it leaves the behaviour for every other unknown key exactly as it is. ## Reproduction status **Reproduced locally**, twice, on the revision above: the A/B above is two boots, not a reading of the code. The `/settings` 400 path was not exercised in this report; it is cited from `serve/server.py:7775-7777` only. ## What I would change (a suggestion, not a decision for me to make) Keep the strictness where a client can be told about it, and separate "this file is unusable" from "this key is unknown": - unreadable file / not a JSON object / not a dict → keep `svc.shared = {}`, but print one line saying the file was ignored and why; - a known key with a bad value, or an unknown key → name it, skip it, keep the rest (`reasoning_effort` stays in force). The second bullet is a behaviour decision (skip and continue vs. refuse to start), which is why I am reporting it rather than guessing: a server that starts with half of a user's settings silently missing is what caused this report in the first place.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2270
No description provided.