[PR #5371] [TUI] keep the values the Settings view saved across launches; --set idle-unload writes its config key instead of an engine flag #5407

Open
opened 2026-11-07 16:34:59 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/5371
Author: @shikaku2
Created: 11/6/2026
Status: 🔄 Open

Base: main ← Head: fix/launch-settings-carry


📝 Commits (1)

  • 0077486 Launch: keep the values the Settings view saved (sampling defaults, idle unload, thinking budget and the other keys) in the rebuilt run config, and write --set idle-unload=… as the server's config key instead of an engine flag the engine would reject with "unknown argument" (#4985)

📊 Changes

2 files changed (+106 additions, -3 deletions)

View changed files

📝 strata_cli/launch/runner.py (+67 -2)
📝 tests/terminal/test_launch.py (+39 -1)

📄 Description

Problem and result:
a value saved in Strata's own page (About > Settings; serve/runconfig.py writes it into the run config of the running start) quietly reverted at the next strata launch --preset …. The launcher rebuilds that file from the installed config and carried the hand-edited engine options over from the earlier start, but none of the top-level keys the Settings view writes. My case: idle_unload_s: 300 saved into ~/.local/state/strata/launch/iq3_xxs-128k.json vanished on the next launch; the sampling keys revert the same way, which is the open half of #4985 (0.2.11's arg layers keep user_args and the engine options only, not the sampling block or the other keys).
A second symptom, from the same gap: writing --idle-unload into a preset's Advanced table or --set idle-unload=300 sends it to the engine, and no engine binary knows that flag (only serve/server.py does) — it exited unknown argument: --idle-unload seven times in the engine log while the start retried, until the args were cleaned out by hand.

After the change the saved values survive the rebuild, and the flag form writes the config key idle_unload_s instead of riding to the engine.

Related discussion: #4985 (sampling values reset after a restart — closes it), #5178 and #5132 (the arg-layer carry-over this follows).

Approach: derive_config is the one place a launch builds its private run config, so the fix stays there:

  • carry_settings copies the Settings-view keys from the config the earlier start wrote (the very file the page edits) into the rebuilt one, with the same "the person's own choice wins" precedence strata_control/arg_layers.py gives hand-edited engine options. Left out on purpose: mtp and drafting (the launcher decides those, --mtp / --drafting), open_browser (strata launch sets it itself), vram_reserve_mib (already survives as a flag in args with its user_args copy). lazy_load is not carried for a picture model — the page itself refuses that combination.
  • take_server_options maps an Advanced-table --idle-unload to the server's config key idle_unload_s ("off" removes it; a value that is not a number of seconds is refused in plain words). What this command line says beats what an earlier start saved.
  • A launch with no earlier config of its name and no such --set writes the same config as before; the tests assert the engine args are untouched.

Validation (this machine: Linux, AMD RX 9070 16 GiB, engine component 0.1.56 HIP, model Qwen IQ3_XXS at 128K, launched with strata launch --preset; branch on main @ 9f7d977d; Python 3.14, pytest 9.2):

  • Passed: python -m pytest tests/terminal/test_launch.py -q → 124 passed, 3 of them new (RunConfig): the Settings-view keys survive the rebuild; --idle-unload from --set/extra becomes idle_unload_s and never enters args or user_args, "off" removes it, a bad word raises a plain LaunchError; and the carry list agrees key-for-key with serve/runconfig.py's EDITABLE.
  • Passed: python -m pytest tests/terminal/test_launch.py tests/terminal/test_launch_precedence_0213.py tests/terminal/test_launch_install.py tests/terminal/test_launch_identity.py tests/terminal/test_launch_speed.py tests/terminal/test_launch_dsv41.py tests/terminal/test_cfg_paths.py tests/terminal/test_drafting.py tests/terminal/test_calibration.py -q → 313 passed, 1 skipped.
  • Passed: the whole suite python -m pytest tests/terminal -q → 2,707 passed, 53 skipped, 2 failed; both failures fail identically on the untouched tree (verified with git stash): test_connections.py::…telemetry… expects an older message wording, and test_drafting_single.py::…split engine…mtp failed only from an import shadowed by an unrelated tests package installed in my user site-packages (with that import unshadowed its file passes 22/22). Neither touches this change. No engine builds were run because no C++ file changes.
  • Passed: replay against this machine's real files (copies, nothing written): idle_unload_s present only in the previous launch config (the ordinary web-page state) is kept by the derived config; --idle-unload added to the installed preset's extra table lands in neither args nor user_args and idle_unload_s: 300 is written as the config key instead; a fresh launch without saved keys shows no new keys and the preset's own --ram-keep-gib/--vram-reserve-mib extras as before.
  • Failed (observed before the change, kept for the record): the machine's ~/.local/state/strata/launch/iq3_xxs-128k.engine.log shows seven engine started: … --idle-unload 300 lines each followed by unknown argument: --idle-unload.
  • Not run: a live strata launch restart on this machine after the fix (the current server already runs with the value); the desktop app's own save path (apps/host) is untouched and was not tested here.

Limits: the carry needs an earlier launch config of the same name (the web-page case); the first launch of a new preset keeps the installed values. A value carried from the earlier start beats the installed config — the same precedence hand-edited engine options already have. mtp stays the launcher's decision.

Closes #4985.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/5371 **Author:** [@shikaku2](https://github.com/shikaku2) **Created:** 11/6/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/launch-settings-carry` --- ### 📝 Commits (1) - [`0077486`](https://github.com/Niko1221/Strata/commit/0077486a18b5d340e565f0fbdad662fb857c8576) Launch: keep the values the Settings view saved (sampling defaults, idle unload, thinking budget and the other keys) in the rebuilt run config, and write --set idle-unload=… as the server's config key instead of an engine flag the engine would reject with "unknown argument" (#4985) ### 📊 Changes **2 files changed** (+106 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `strata_cli/launch/runner.py` (+67 -2) 📝 `tests/terminal/test_launch.py` (+39 -1) </details> ### 📄 Description Problem and result: a value saved in Strata's own page (About > Settings; `serve/runconfig.py` writes it into the run config of the running start) quietly reverted at the next `strata launch --preset …`. The launcher rebuilds that file from the installed config and carried the hand-edited engine options over from the earlier start, but none of the top-level keys the Settings view writes. My case: `idle_unload_s: 300` saved into `~/.local/state/strata/launch/iq3_xxs-128k.json` vanished on the next launch; the sampling keys revert the same way, which is the open half of #4985 (0.2.11's arg layers keep `user_args` and the engine options only, not the `sampling` block or the other keys). A second symptom, from the same gap: writing `--idle-unload` into a preset's Advanced table or `--set idle-unload=300` sends it to the engine, and no engine binary knows that flag (only `serve/server.py` does) — it exited `unknown argument: --idle-unload` seven times in the engine log while the start retried, until the args were cleaned out by hand. After the change the saved values survive the rebuild, and the flag form writes the config key `idle_unload_s` instead of riding to the engine. Related discussion: #4985 (sampling values reset after a restart — closes it), #5178 and #5132 (the arg-layer carry-over this follows). Approach: `derive_config` is the one place a launch builds its private run config, so the fix stays there: - `carry_settings` copies the Settings-view keys from the config the earlier start wrote (the very file the page edits) into the rebuilt one, with the same "the person's own choice wins" precedence `strata_control/arg_layers.py` gives hand-edited engine options. Left out on purpose: `mtp` and drafting (the launcher decides those, `--mtp` / `--drafting`), `open_browser` (`strata launch` sets it itself), `vram_reserve_mib` (already survives as a flag in `args` with its `user_args` copy). `lazy_load` is not carried for a picture model — the page itself refuses that combination. - `take_server_options` maps an Advanced-table `--idle-unload` to the server's config key `idle_unload_s` ("off" removes it; a value that is not a number of seconds is refused in plain words). What this command line says beats what an earlier start saved. - A launch with no earlier config of its name and no such `--set` writes the same config as before; the tests assert the engine args are untouched. Validation (this machine: Linux, AMD RX 9070 16 GiB, engine component 0.1.56 HIP, model Qwen IQ3_XXS at 128K, launched with `strata launch --preset`; branch on `main` @ 9f7d977d; Python 3.14, pytest 9.2): - Passed: `python -m pytest tests/terminal/test_launch.py -q` → 124 passed, 3 of them new (`RunConfig`): the Settings-view keys survive the rebuild; `--idle-unload` from `--set`/extra becomes `idle_unload_s` and never enters `args` or `user_args`, "off" removes it, a bad word raises a plain `LaunchError`; and the carry list agrees key-for-key with `serve/runconfig.py`'s `EDITABLE`. - Passed: `python -m pytest tests/terminal/test_launch.py tests/terminal/test_launch_precedence_0213.py tests/terminal/test_launch_install.py tests/terminal/test_launch_identity.py tests/terminal/test_launch_speed.py tests/terminal/test_launch_dsv41.py tests/terminal/test_cfg_paths.py tests/terminal/test_drafting.py tests/terminal/test_calibration.py -q` → 313 passed, 1 skipped. - Passed: the whole suite `python -m pytest tests/terminal -q` → 2,707 passed, 53 skipped, 2 failed; both failures fail identically on the untouched tree (verified with `git stash`): `test_connections.py::…telemetry…` expects an older message wording, and `test_drafting_single.py::…split engine…mtp` failed only from an import shadowed by an unrelated `tests` package installed in my user site-packages (with that import unshadowed its file passes 22/22). Neither touches this change. No engine builds were run because no C++ file changes. - Passed: replay against this machine's real files (copies, nothing written): `idle_unload_s` present only in the previous launch config (the ordinary web-page state) is kept by the derived config; `--idle-unload` added to the installed preset's extra table lands in neither `args` nor `user_args` and `idle_unload_s: 300` is written as the config key instead; a fresh launch without saved keys shows no new keys and the preset's own `--ram-keep-gib`/`--vram-reserve-mib` extras as before. - Failed (observed before the change, kept for the record): the machine's `~/.local/state/strata/launch/iq3_xxs-128k.engine.log` shows seven `engine started: … --idle-unload 300` lines each followed by `unknown argument: --idle-unload`. - Not run: a live `strata launch` restart on this machine after the fix (the current server already runs with the value); the desktop app's own save path (`apps/host`) is untouched and was not tested here. Limits: the carry needs an earlier launch config of the same name (the web-page case); the first launch of a new preset keeps the installed values. A value carried from the earlier start beats the installed config — the same precedence hand-edited engine options already have. `mtp` stays the launcher's decision. Closes #4985. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5407
No description provided.