fix(app): install cancels whole process trees and silent downloads, and finishes only with the settings written

- A cancelled command ends with every process it started (process group on
  Unix, taskkill /T on Windows).
- Waiting for a response or the next chunk gives way to a cancel, so a
  silent server cannot hold the install.
- Pointing the settings at the runtime is the last install step: a failure
  shows as failed and can be retried; done means written.
- Strata's installer gets its folder as the working folder, not inside the
  script text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-12 17:17:25 +09:00
parent a4436698c8
commit 1a6d6447f6
6 changed files with 196 additions and 28 deletions

View File

@@ -140,6 +140,7 @@ on the game PC (`scripts/m0`). The steps, in order:
| `stt_model` | Whisper `large-v3-turbo` (faster-whisper) |
| `tts_model` | the NLTK data MeloTTS's English g2p reads, then the worker's own `melo_child.py` loads the Korean voice once (downloading it) and must say its warm-up sentence |
| `strata` | Strata's own installer (`install.ps1`, `install.sh` elsewhere) with Strata's state, engine and components under `runtime/strata` and no PATH change |
| `settings` | `voiceWorker` in the settings pointed at the worker venv's Python with `--melo-python <melo venv> --history memory/history.sqlite --brain` (other settings kept); the install is done only once this is written |
The LLM itself (Qwen3.6-35B-A3B, about 23 GB) is downloaded by Strata on its first start, which the
app runs next (M5, later step).
@@ -147,15 +148,15 @@ app runs next (M5, later step).
- A finished step leaves `runtime/.done/<id>` holding its version (the pin; for `worker_env` a hash
of its requirement files), so later runs skip it and a new pin runs it again. Steps run one at a
time; a failure stops the run and the next run starts at that step; cancel stops the running
command or download (a download's part file stays, so the next try continues it).
command and every process it started (one process group, a job tree on Windows) or the download,
also while a server sends nothing (a download's part file stays, so the next try continues it).
- Folders go to commands as arguments or as the working folder, never inside a script's text.
- Every command runs with the layout's environment: `uv`'s cache and Pythons, `HF_HOME`
(`models/hf`), `NLTK_DATA` (`models/nltk`), temp files (`cache/tmp`) and Strata's folders, all
inside the data folder. Python comes from `uv` only. Output lines go to the `install` log tab.
- Downloads go to `<file>.part`, continue with an HTTP range after a break (a server without ranges
starts over), and are checked against the pinned SHA-256; a wrong checksum deletes the part.
- When every step is done, `uv`'s download cache is cleaned (the venvs hold copies), and
`voiceWorker` in the settings is pointed at the worker venv's Python with
`--melo-python <melo venv> --history memory/history.sqlite --brain` (other settings kept).
- When every step is done, `uv`'s download cache is cleaned (the venvs hold copies).
- With the install complete, the services start the worker with the same environment (models,
caches and temp files in the data folder; on Linux also the CUDA wheels' library folders).