mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#4792
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/3817
Author: @miketgv
Created: 10/23/2026
Status: ❌ Closed
Base:
main← Head:start-wait-env📝 Commits (4)
febdbe5GUI: the start wait follows the model's size, asstrata launchdoes, and never asks an older Control for more than it takes (#3459 #4191)ecc469cGUI: ask the installed Control for the start wait it actually takes, and let the CLI take the runtime's ceiling (#3459 #4191)ef077adcontrol: the operation record takes a long start wait too, and the tests walk the whole CLI path (#3459 #4191)3c58162GUI: ask for the longer wait only when all three of a Control's ceilings agree (#3459 #4191)📊 Changes
5 files changed (+186 additions, -9 deletions)
View changed files
📝
apps/host/server/native-control.mjs(+51 -2)📝
apps/host/tests/packaged-control.test.mjs(+59 -3)📝
strata_control/journal.py(+7 -2)📝
strata_control/management.py(+6 -2)📝
tests/terminal/test_runtime.py(+63 -0)📄 Description
Problem and result
In the app, a start waits a flat 300 s for any model. On a slow disk a big model needs longer, so the load ends with
startup_wait_expiredwhile the engine goes on reading and would have come up. #4191 reports it at about 180 GB and saysthat editing
300to600inapps/host/server/native-control.mjsfixed it on 0.2.1, but needs several files changed now;#3459 is the same stop on Windows 11 after the tuning stage (RTX 5060 Ti, 56 GB). Both are still open. #4191 asks for the
parameter to be raised in advance so it does not have to be edited at every update.
mainsolved the Terminal's own side of this in27cbbfe6(#3949):MAX_START_WAITto 1800 s and a wait that follows themodel's size. This branch is the same rule for the app, with no new setting and nothing for anyone to set.
A local build of the first commit showed that the app could not use the new ceiling yet. Loading a big model in the app
said:
Start wait must be finite seconds in 0..600. Control validates a start wait twice, and27cbbfe6raised only one ofthe two ceilings:
27cbbfe6runtime.start(wait=…)strata launch(Runner, calls it directly)MAX_START_WAIT= 1800 ✔strata runtime start --wait …→management.runtime_action_seconds(…, 0, 600, …)= 600 ✘strata runtime start --waitchecks the wait three times before the engine is reached, and27cbbfe6raised only theruntime's own:
27cbbfe6management.runtime_action_seconds(…, 0, 600, …)= 600start wait must be finite seconds in 0..600journal._validate_direct_intent{"wait_s": (0, 600)}= 600direct runtime intent has an invalid timeoutruntime.startstrata launch(calls it directly)MAX_START_WAIT= 1800 ✔Both of the first two refuse the wait before the engine is reached, so a wait of 601 s or more was impossible through the CLI
on every released Control — checked on this repo's
v0.2.5/v0.2.7(Control 0.1.52, and 0.1.49.2 installed on the test PC),where the runtime already says 1800 while both gates still say 600:
So
27cbbfe6fixed the Terminal by calling the runtime directly, and left the CLI — the app's path — at 600 s in two places. Anearlier version of this branch gated on
control.versioninstead; that gate was wrong for the same reason (0.1.50, 0.1.51 and0.1.52 all refuse more than 600 s through the CLI), and is replaced here by reading the Control.
Approach
Control — both gates take their ceiling from the runtime they hand the wait to, instead of repeating a number that has
already fallen out of step (
runtime.MAX_START_WAIT):management.runtime_action, forstartand forrestart'sstartup wait(whichruntime.restartalready accepts up toMAX_START_WAIT, so the CLI was the only thing still refusing it).journal._validate_direct_intent, forruntime.startand for a restart'sstartup_wait_s.stopandverifykeep theirown 600 s, which is what
runtime.stopandruntime.verifytake.The default stays 300 s and every wait at or below 600 s behaves exactly as before; a Control whose runtime refuses a long wait
still refuses it, one layer later.
App (
apps/host/server/native-control.mjs):startWaitFor(config, entry, model)sizes the wait from the model in27cbbfe6's shape: ten minutes, about eight moreseconds per GB above 40 GB, at most what this Control accepts. The size comes from the installed model's bytes on disk, else
from the catalog's download figure (both already reach the host); a model nobody can size keeps the 300 s it always had.
places, the app asks for more than 600 s only when that Control's own sources hand both of the first two gates to the
runtime's ceiling, and then takes the figure from its
runtime.py. A Control that raised only one of them — which is exactlywhat every released Control does today, and what this branch did halfway through its own history — keeps the 600 s it takes.
So it changes nothing for anyone on a released build and uses the longer wait as soon as a fixed Control is installed: no
version table to keep in step, and no load that fails because the app asked for more than its Control accepts. This is the
same kind of source-read the app already does for the settings fields and for
/v1/responses. Anything it cannot read, or aline that still spells out 600, falls back to 600 s.
engine_ready_sis now a floor the app never shortens, instead of a figure clamped to 600 s. Where the start thenwaits longer than the server's own engine wait (900 s), the launch's copy of the config gets
engine_ready_sabove it — whatRunner.build_configdoes. Without this the two cannot work together: the server ends the engine when its own wait runs out,so a start that waits longer than the server waits for nothing. It is only ever raised, so setup's 3600 s for
DeepSeek V4.1-Flash stays as written, and the installed config file is untouched.
No new variable and nothing for anyone to set, which is what
27cbbfe6asked for when it declined theSTRATA_ENGINE_READY_Sroute.
One thing this does not change, on purpose: Control's start wait is not only patience. The owner host gives the model the
same budget to prove it is ready (
probe_deadlinecomes from--startup-wait) and stops it if it readies late, so the appcannot simply ignore an expired wait and keep polling — raising the wait it passes down is the only real lever. The app's outer
five-minute health loop runs only after Control reports ready, and is left alone.
Validation
Passed:
--wait 1720on the staged Control passed all three gates andreached the engine spawn (
state: failed … server_exitedfrom the deliberately dummy exe, afterowner_id/child_pidwereassigned). The same command before these two commits stopped at gate 1 and then gate 2, before any process was started.
python -m unittest tests.terminal.test_runtime.StartWaitLimit: 4 cases. One walksmanagement→journal→runtime.startwith only the engine faked, at 300/600/601/1800 s, and names the wait that failed to arrive; one pins each kind's ceiling on the
record; two keep the runtime's own limits. Reverting the journal change fails three of them with the quoted message, and
reverting
management.pyfails the chain test — which is how the second gate was missed the first time: the earlier CLI testfaked
runtime.startand so stopped at the first gate.tests.terminal.test_recipes,test_bench,test_calibration: 44 tests OK, plus the fulltest_runtimemodule.npm testinapps/host: 1227 tests, 1120 pass, 2 fail — the same two that fail onupstream/mainat5e8a4ccain thischeckout ("an update job an OLDER host left running…" and "Stop ends the job and everything it started…").
tests.terminal.test_runtimealso reports 3 errors intest_foreground_jsonl_emits_ready_and_stop_without_human_stdout(
_queue.Emptyin a subprocess-signal case). Pre-existing: identical with these changes stashed.against real folders: this repo and the staged 0.1.52 component → 1800 s; the installed 0.1.49.2 component → 600 s; and the
released
v0.2.5/v0.2.7sources taken straight from git, which carryMAX_START_WAIT = 1800with both gates at 600 → theapp asks them for 600 s, which is what they take.
native-control.mjsbyte-identical to the committed file, all threeControl gates patched, the app's probe reading both markers, and its bundled Control answering
--wait 300/600/1720/1800past every validator. A 148 GB model asks 1464 s where the Control takes it and 600 s where it does not; a 20 GB
model keeps the 300 s it always had.
Not run:
fixed, which no released Control has. Until then the app keeps asking 600 s, so this branch changes nothing for anyone on a
released build — which is also why the two Control fixes need to land for the app change to do anything at all.
Limits
An app with this change is harmless on an old Control (it reads 600 s and behaves as today) and only takes the longer wait
once a Control with the CLI fix is installed. If you would rather keep them apart, the Control commit is self-contained and
can be split into its own pull request.
Control that validates the start wait in a shape neither pattern matches falls back to 600 s: today's behaviour, never a
broken load.
verify waitandstop wait(600 s in both layers) were left alone: they agree with each other and no model load isbounded by them.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.