mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4651] [GUI] add --resume (STRATA_RESUME=1) to the Linux AppImage so your last model loads as Strata starts #5130
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#5130
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/4651
Author: @o-leary
Created: 10/30/2026
Status: 🔄 Open
Base:
main← Head:gui/appimage-resume📝 Commits (1)
b8920dfdesktop (Linux): --resume (STRATA_RESUME=1) loads the model you used last as Strata opens📊 Changes
7 files changed (+283 additions, -21 deletions)
View changed files
📝
apps/desktop/src-tauri/src/main.rs(+1 -1)📝
apps/desktop/src-tauri/src/supervisor.rs(+106 -15)📝
apps/desktop/tester/README-linux.txt.in(+5 -0)📝
apps/host/server/index.mjs(+10 -1)📝
apps/host/server/native-control.mjs(+32 -3)➕
apps/host/tests/appimage-resume.test.mjs(+126 -0)📝
docs/INSTALL.md(+3 -1)📄 Description
Problem and result
The Linux app has no way to ask for its model at launch. Closing the window stops the host and the native engine with it, so every start comes up with
no model is loaded yetand the person presses Load again and waits while the weights are mapped. On a machine that runs one model all day that is the same minute, every time.The autostart hook in the host covers only the old llama.cpp supervisor path. In the packaged app a model is loaded through the native Control path (
/api/native/operations, kindload), and those instances live in memory only: on closenative.close()force-unloads them and deletes the per-instance run config, so nothing is left to resume.apps/host/docs/plans/09-multiple-models.md:59records persistence and autostart as an open decision ("Current extra design instances are session-only").After this change:
--resume, orSTRATA_RESUME=1.The model you last loaded starts again with the settings it was loaded with, before anyone opens a page, and the Models screen shows the same progress card it shows for your own click. With #4582 the two switches make a launch that is ready for the rest of your machines:
--lan --resumebrings your model back and serves it to your other devices on your network as Strata opens.Related discussion
none — no open or closed issue asks for this, and nothing in the open PR list adds a launch-time model. It is the opt-in half of the plan item quoted above (
apps/host/docs/plans/09-multiple-models.md:59), one flag and one small record file, so it goes straight to a PR rather than a scope thread.One overlap to merge: #4582 (
--lan, branchgui/appimage-lan) adds an argument toparse_argshere (resume_env) and there (lan_env), and both passoptstojoin_running. One line each, and the shape of the two switches is the same on purpose.Approach
apps/desktop/src-tauri/src/supervisor.rs: the option (Options::resume,parse_args,--resume,STRATA_RESUME=1),STRATA_RESUME=1in the host's environment, the--helpline, and the second-start question (--resumewhile Strata runs asks that host, it does not start a second copy).apps/host/server/native-control.mjs: a load records what it asked for in~/.strata/data/native-last-load.json(mode 0600) at the two places a load says it is ready.resumeLastLoad()replays that record through the same native operation the Models screen sends, and reports in plain words when there is no record, when the model's files are gone, when the model is no longer set up in this Strata folder, or when the engine is missing.apps/host/server/index.mjs:POST /api/native/resume, and the start-up line whenSTRATA_RESUMEis set.docs/INSTALL.md.No default path changes and nothing is downloaded: a flag was never a request to fetch tens of gigabytes. Nothing is read back unless the person asked —
resumeRequestedaccepts the shell's words (1, on, true, yes, resume). One thing does happen on the ordinary path: a successful load writes that 0600 record file, and a load that cannot write it still loads. If you would rather have the write behind the switch too, say so: the alternative is that the first--resumeafter the switch is set records it, and later starts replay it.Compatibility: Windows and macOS get no new command-line option, as with
--browser— the shell code there is untouched. Nothing here needs an engine build: the diff is two.rs, two.mjs, one new test, the Linux tester README and onedocs/INSTALL.mdbullet; no file undersrc/,include/,metal/,sycl/orserve/changes.Validation
Revision under test:
43699304(this branch, on top of870aedd9=upstream/main). Environment for every line below: this PC, Arch Linux rolling, kernel 7.2.11-arch1-1, RTX 4070 plus RTX 3060, 125 GB RAM, Node v26.12.1, cargo 1.99.0, Python 3.14.8. The baseline comparison runs were made in a second worktree checked out at870aedd9, which carries none of this change.Passed:
cd apps/desktop/src-taurithencargo test supervisor::, at43699304:One environment note, because it changed on this box today: a package update removed
webkit2gtk-4.1at 12:47 on 30 Oct (/var/log/pacman.log), andcargo test supervisor::then fails to link (rust-lld: error: unable to find library -lwebkit2gtk-4.1, and the same for-ljavascriptcoregtk-4.1). The run above used the same version's files unpacked out of this box's pacman cache (PKG_CONFIG_PATH=<dir>/usr/lib/pkgconfig LD_LIBRARY_PATH=<dir>/usr/lib, no root needed). On a box where the package is installed the plain command works.cd apps/hostthennode --test tests/appimage-resume.test.mjs, at43699304:tests 6,pass 6,fail 0— "a load remembers the model and the settings it was loaded with", "resume starts the model of the last session again, with the same settings", "a second resume while the model is loaded says so, and starts nothing", "a start with nothing recorded says what happened, and downloads nothing", "a model whose files are gone is reported: the flag is never a request to download", "nothing loads at start unless the switch is on". Control here is a fake that records what the host saved and what it was asked to start, so the test can check that the resumed engine start carries the same engine arguments as the load it replaces.The packaged host on its own (no app window), at
43699304:Nothing started and nothing downloaded, which is the expected answer with an empty scratch
STRATA_HOME; nodata/native-last-load.jsonappeared in that scratch home.The finished AppImage from this branch (
dist/Strata-0.2.8-linux-x86_64.AppImage, 380,692,984 bytes, sha25641e1650972de34b7546e4fbe204a8e0d4612a08b0283194b0519a2770aa71ee8):Failed:
cd apps/hostthennpm test, at43699304:tests 1253, pass 1146, fail 2, skipped 105. The two:tests/component-updates.test.mjs— "packaged: an update job an OLDER host left running is finished when the app program file is newer than the job",actual: 'error', expected: 'done'; andtests/timeskip-real.test.mjs— "Stop ends the job and everything it started…",the revision command (a grandchild of the job) was ended too: true !== false. Neither is caused by this change: the same two files givefail 2at870aedd9(node --test tests/component-updates.test.mjs tests/timeskip-real.test.mjs, both worktrees).python -m unittest tests.desktop.test_tester_readme: 4 tests, 1 failure,AssertionError: 'Strata 0.2.3' not found in …— the tester README it checks names the current version (0.2.8), so the test's expectation is stale. Same single failure at870aedd9in the second worktree.cd apps/desktopthennpx tauri build --bundles appimage: the Rust release binary and the AppDir build (44-51 s), then Tauri's own AppImage step dies withfailed to bundle project: No such file or directory (os error 2). This also happened when 0.2.7 was built on this box, so it is not a result of this change; the AppImage named above was finished the same way as the 0.2.7 one —linuxdeploy(git07333c6, gtk and gstreamer plugins) plusapps/desktop/scripts/repack-appimage.shto put the staged payloads back byte for byte.Not run:
--resume, and the model loads before the page opens.--resumewhile Strata is already running), where only the sentence the host answers is unit-tested.#[cfg(target_os = "linux")]inmain.rs, and the host is the same.mjsfiles, but I did not build or run those systems.src/,include/,metal/,sycl/orserve/file is touched), and no engine was compiled or run for it.Limits
--resumeis an explicit ask for the model you last loaded, and loading another model replaces it.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.