[GH-ISSUE #629] Re-running setup with a different --context silently discards mcp_servers, mcp and sampling from the run config #296

Closed
opened 2026-11-04 01:41:44 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @jmaher-fas on GitHub (Oct 3, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/629

Title: Re-running setup with a different --context silently discards mcp_servers, mcp and sampling from the run config

What happened

I had a working install (qwen / IQ3_S, two GPUs) and had hand-edited
strata-iq3_s.json to add three blocks that the installer does not write itself:

"sampling":    { "temperature": 1.0, "top_p": 0.95, "top_k": 20, "min_p": 0.0 },
"mcp_servers": { "files": {...}, "browser": {...}, "search": {...} },
"mcp":         { "timeout_s": 60, "max_result_chars": 16000, "max_rounds": 8 }

I then re-ran setup to change only the context length:

START-HERE.bat --yes --family qwen --model IQ3_S --gpus 0,1 --context 131072 --no-start

Setup correctly reused the downloaded model and rewrote the start script. It also rewrote
strata-iq3_s.json from scratch
, so all three blocks were gone. The file came back with only
the generated keys (exe, args, cwd, tokenizer, model_name, log, lib_dirs, port,
gpu, gpus_asked, layer_split).

Nothing warned that a config containing user-authored blocks was about to be replaced, and the
loss is quiet: the model loads fine, it just decodes greedy (no sampling) and has no MCP tools
in the chat page (no mcp_servers) until you notice.

I only recovered because I had copied the file to strata-iq3_s.json.preserve beforehand, on the
suspicion that this might happen.

Why it is easy to hit

The documentation encourages putting these blocks in this file — DETAILS.md documents
"sampling" and the "mcp_servers" / "mcp" blocks as belonging in the run config — and
changing context later is a natural thing to do (MODELS.md discusses context choice as a
tradeoff worth revisiting). So the two instructions combine into data loss.

Reproduce

  1. Install any model.
  2. Add a "sampling" block (or "mcp_servers") to strata-<model>.json.
  3. Re-run setup with a different --context.
  4. The block is gone.

Suggested fix, roughly in order of effort

  • Merge rather than replace. When regenerating strata-<model>.json, carry over any key the
    generator does not own — sampling, mcp_servers, mcp, and anything else unrecognised.
    Setup already knows exactly which keys it writes, so the rest can be preserved by construction.
  • Or back it up and say so: write strata-<model>.json.bak and print one line —
    "your previous run config was saved to ...; sampling / mcp_servers were not carried over".
  • Or warn before overwriting when the existing file contains keys the generator will not
    re-create, and ask (or require --force).

The first seems closest to what a user expects: the flags passed to setup describe how the model
is loaded, not how it samples or what tools it may use.

Environment

Windows 11, NVIDIA 2x RTX 5070 Ti (driver 616.92), engine 0.1.38 CUDA 13.0,
qwen / IQ3_S, two-GPU layer split. Strata cloned from main on 2026-10-03.


Attribution: this was found and diagnosed by Claude (Anthropic's Claude Code) while it was
setting up an MCP-driven worker loop against Strata on my machine — it hit the wipe, recovered
from its own backup, and worked out the cause and the suggested fixes above. I'm filing it under
my account and can relay or dig into any follow-up questions.

Originally created by @jmaher-fas on GitHub (Oct 3, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/629 **Title:** Re-running setup with a different `--context` silently discards `mcp_servers`, `mcp` and `sampling` from the run config ### What happened I had a working install (`qwen` / `IQ3_S`, two GPUs) and had hand-edited `strata-iq3_s.json` to add three blocks that the installer does not write itself: ```json "sampling": { "temperature": 1.0, "top_p": 0.95, "top_k": 20, "min_p": 0.0 }, "mcp_servers": { "files": {...}, "browser": {...}, "search": {...} }, "mcp": { "timeout_s": 60, "max_result_chars": 16000, "max_rounds": 8 } ``` I then re-ran setup to change only the context length: ``` START-HERE.bat --yes --family qwen --model IQ3_S --gpus 0,1 --context 131072 --no-start ``` Setup correctly reused the downloaded model and rewrote the start script. It also **rewrote `strata-iq3_s.json` from scratch**, so all three blocks were gone. The file came back with only the generated keys (`exe`, `args`, `cwd`, `tokenizer`, `model_name`, `log`, `lib_dirs`, `port`, `gpu`, `gpus_asked`, `layer_split`). Nothing warned that a config containing user-authored blocks was about to be replaced, and the loss is quiet: the model loads fine, it just decodes greedy (no `sampling`) and has no MCP tools in the chat page (no `mcp_servers`) until you notice. I only recovered because I had copied the file to `strata-iq3_s.json.preserve` beforehand, on the suspicion that this might happen. ### Why it is easy to hit The documentation encourages putting these blocks in this file — `DETAILS.md` documents `"sampling"` and the `"mcp_servers"` / `"mcp"` blocks as belonging in the run config — and changing context later is a natural thing to do (`MODELS.md` discusses context choice as a tradeoff worth revisiting). So the two instructions combine into data loss. ### Reproduce 1. Install any model. 2. Add a `"sampling"` block (or `"mcp_servers"`) to `strata-<model>.json`. 3. Re-run setup with a different `--context`. 4. The block is gone. ### Suggested fix, roughly in order of effort - **Merge rather than replace.** When regenerating `strata-<model>.json`, carry over any key the generator does not own — `sampling`, `mcp_servers`, `mcp`, and anything else unrecognised. Setup already knows exactly which keys it writes, so the rest can be preserved by construction. - **Or back it up and say so**: write `strata-<model>.json.bak` and print one line — "your previous run config was saved to ...; sampling / mcp_servers were not carried over". - **Or warn before overwriting** when the existing file contains keys the generator will not re-create, and ask (or require `--force`). The first seems closest to what a user expects: the flags passed to setup describe how the model is loaded, not how it samples or what tools it may use. ### Environment Windows 11, NVIDIA 2x RTX 5070 Ti (driver 616.92), engine 0.1.38 CUDA 13.0, `qwen` / `IQ3_S`, two-GPU layer split. Strata cloned from `main` on 2026-10-03. --- *Attribution: this was found and diagnosed by Claude (Anthropic's Claude Code) while it was setting up an MCP-driven worker loop against Strata on my machine — it hit the wipe, recovered from its own backup, and worked out the cause and the suggested fixes above. I'm filing it under my account and can relay or dig into any follow-up questions.*
Author
Owner

@Niko1221 commented on GitHub (Oct 4, 2026):

Fixed in 0.1.39: running setup again for an installed model (another --context, say) now keeps every key of strata-<model>.json that setup does not write itself: sampling, mcp_servers, mcp, cors_origins, aliases and so on, plus env entries and a vision.mmproj of your own. Setup rewrites only its own keys (exe, args, port, gpu, host, api_key, vision, ...). It keeps the earlier file as strata-<model>.json.bak and prints one line naming what it kept. Engine options you added to "args" by hand are not carried over, because setup chooses those; it names them so you can add them again. A copy of Strata set up like an earlier install carries the keys over from that install's config too.

<!-- gh-comment-id:5979960543 --> @Niko1221 commented on GitHub (Oct 4, 2026): Fixed in 0.1.39: running setup again for an installed model (another `--context`, say) now keeps every key of `strata-<model>.json` that setup does not write itself: `sampling`, `mcp_servers`, `mcp`, `cors_origins`, `aliases` and so on, plus `env` entries and a `vision.mmproj` of your own. Setup rewrites only its own keys (`exe`, `args`, `port`, `gpu`, `host`, `api_key`, `vision`, ...). It keeps the earlier file as `strata-<model>.json.bak` and prints one line naming what it kept. Engine options you added to `"args"` by hand are not carried over, because setup chooses those; it names them so you can add them again. A copy of Strata set up like an earlier install carries the keys over from that install's config too.
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#296
No description provided.