Repository navigation
FormLit 0.54.0: a failed start says why, and the engine cannot outlive the app on Windows - #19
Merged
Merged
Conversation
… and refuses to serve alone The family's Windows start and stop pattern, engine side, as FormTools 0.10.0 has it. - app/core/startup.py is FormTools's file with formlit's names at its top. - app/core/runtime.py starts Logs/formlit-engine.log in the data folder and wraps the lock. - formlit_engine.py: the log starts before the lock; an absent standard error is kept in a file; a frozen engine started without its app opens the app or says one sentence (exit 4); a second engine on the same data folder is refused with a sentence (exit 2) while the first one's shell lives, and an engine whose shell is gone is ended and replaced; the engine leaves when the process in FORMLIT_SHELL_PID ends; a data folder that cannot be made is one sentence and exit 5. - tests/test_startup.py: 15 tests with POSIX stand-ins, 15 passed here. Seen on Linux only. Nothing ran on Windows or macOS, and no frozen engine was built.
…he app on Windows The family's Windows start and stop pattern, shell side, as FormTools 0.10.0 has it. - win_job.rs is FormTools's file, unchanged: the engine goes into a job object that Windows closes with the shell, which ends the engine and what it started. - engine_start.rs is FormTools's file with formlit's names, a two minute address wait and the data folder rule of the engine (FORMLIT_DATA_DIR, else Formlit in the home folder). - main.rs: the engine is started with std::process::Command in place of the shell plugin's sidecar call (win_job needs a Child), from the same place beside the app, with FORMLIT_SHELL_PID set; every failure of the start ends in one dialog with the sentence, the engine's last lines and the log's path, shown before the loading window closes; quitting ends the job on Windows before the kill. - Cargo.toml and Cargo.lock: windows-sys 0.61.2 under the Windows target, already in the lock for other packages. No new crate, no single-instance plugin. Not compiled as an app on any system. Seen here: a scratch crate holding the two files passed cargo check for x86_64-pc-windows-msvc; cargo test on Linux, 4 unit tests and 5 loop tests over read_port and engine_exit_code cut from main.rs, passed; cargo update --workspace on a scratch copy of the old lock gives the lock as edited.
Moves every version site from 0.53.0 to 0.54.0: frontend/package.json, both version fields of frontend/package-lock.json, version.ts, backend __version__, Cargo.toml and its Cargo.lock entry, tauri.conf.json, the README badge, the three HASHOUT_LOG headers, and the supported-versions row of SECURITY.md (0.54.x). The CHANGELOG gains v0.54.0, dated 2026-11-19: a failed start says why, the engine ends with the app on Windows, an engine left behind is replaced, a second start on the same data folder is refused with a sentence, the engine opened by itself opens the app, and the engine keeps a log. Run before this commit, on a scratch copy of 10aec6d with the commands of .github/workflows/ci.yml: compileall and --selfcheck exit 0; the uvicorn boot answered /api/health and /api/capabilities; the whole backend suite, 407 passed and 1 failed (test_selection_models, which failed the same way on main: onnxruntime is not installed in the environment used here); bash -n on every script. The window tests ran on a scratch copy of 43f0763: 12 passed. Run on this tree: the em dash and emoji check (clean) and a reading of the six version sites the suite compares (all 0.54.0). Not run on this tree: the suite itself (the lane was taken; no test changed after 10aec6d and only version fields and the CHANGELOG differ), npm audit, the type check on its own, desktop builds (the shell is not compiled here), Windows and macOS, the real agent programs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FormLit 0.54.0: a failed start says why, and the engine cannot outlive the app on Windows
The Windows start and stop pattern of FormTools 0.10.0, carried into FormLit: engine side and shell side.
What changes for people
Logs/formlit-engine.login the data folder, with a second file for errors when it has no console.What was built
backend/app/core/startup.pyis FormTools's file with FormLit's names.backend/app/core/runtime.py(new) starts the log and wraps the lock.backend/formlit_engine.pystarts the log before the lock, keeps an absent standard error in a file, refuses to serve alone when frozen, holdsengine.lock, and follows the process named inFORMLIT_SHELL_PID. FormLit had no engine lock and no engine log before; both belong to the frozen entry only, so development runs and the tests' engines are as they were.win_job.rsis FormTools's file, unchanged.engine_start.rsis FormTools's with FormLit's names, a two minute address wait, and the engine's own data folder rule. FormLit started its engine through tauri-plugin-shell; that one start moved tostd::process::Commandsowin_job.rscould stay unchanged. The engine is looked for where the plugin looked: beside the app's program.windows-sys 0.61.2under the Windows target, a version the lock already held; no new crate.How it was checked
All on Linux.
sleepas the stand-in app and the real entry: a second engine exit 2 with the sentence while the first kept answering; exit 0 and no lock half a second after its app was ended; a stopped engine whose app was gone replaced after five seconds; four damaged lock files and a lock naming an unrelated process replaced, that process left running; started alone with a stand-in app in each of the three install layouts exit 0 with the app opened and no lock; with no app near exit 4 and the sentence; with the three streams closed the health route answered; a data folder that cannot be made exit 5 with one sentence.backend/tests/test_startup.py: 15 tests, 15 passed.engine_start.rsandwin_job.rspassedcargo check --target x86_64-pc-windows-msvcwith no error.cargo teston Linux: 4 unit tests and 5 loop tests overread_portandengine_exit_codecut frommain.rs, all passed. The hand edit ofCargo.lockequals whatcargo update --workspacewrites from the old lock.Checks rehearsed (the jobs of
.github/workflows/ci.yml, on a scratch copy of the commit named)npm ci,npm run buildnpm audit --audit-level=lowpython -m compileall -q app formlit_engine.pypython formlit_engine.py --selfcheck/api/health,/api/capabilitiespython -m pytest tests -q -p no:cacheprovidertest_selection_modelsone; main had 392 passed and the same 1 failed, this branch adds 15 tests)python -m pytest frontend/tests/window -q -p no:cacheprovider(Playwright 1.63.0)bash -non each scriptThe workflow pins Python 3.12 and Node 22; here Python was 3.13.18. The workflow has no lint step.
Not run
sys.frozenset.engine_program,start_engine,open_main,engine_failedand the start insetupwere read against FormTools's, not built.win_job.rstype-checks for Windows and has never run.npm audit, and the macOS and Windows build jobs of the release workflow.test_selection_models.py::test_the_recommended_models_run_on_the_cpu_provider_only. It importsonnxruntime, which is not installed in the environment used here;backend/requirements.txtpins it, so the workflow installs it. Whether the test passes there was not seen here./home/claude/form/out/test_plan/formlit.mdlists these as steps.Held
FORMLIT_ENGINE_WINDOWED) was not prepared.FORMLIT_SHELL_PID; FormLit watched nothing before, so no fallback to the parent process was added.Merge
Merge with a merge commit. Do not squash and do not rebase-merge.