Commit Graph
6 Commits
Author SHA1 Message Date
Hasan BasbunarandClaude Opus 5.5 dbf649932b v1.21.0: an engine restart no longer ends a session, and no engine starts on memory still held
Issue #26 reported a 27B engine dying about once a day with "CUDA error:
operation not permitted", systemd starting it again 17 s later, and the
fear that the restart lands in the window sglang#40948 blames for a DGX
Spark frozen 9.5 h. Measured on the reference box: a crashed engine's
memory is back 2 to 5 s after it dies, about 15 s before the restart.

engine-preflight.sh runs before every engine (27B, flash, image, video)
and refuses a start while what is left of an engine holds GPU memory,
while the driver holds more than 16 GiB that no process accounts for,
or while nvidia-smi does not answer; systemd tries again every 15 s.

The proxy (v6.28) holds a request while its engine comes back, through
a restart's stop half too, up to 1200 s: a streamed one gets its 200
and the keepalives at once. On a 503, opencode gave up after 151 s and
Claude Code after 325 s; both wait on a held stream (900 s measured).
An engine's mid-stream cut is passed on as a cut: the error event sent
in its place made Claude Code retry without a stream, give up on it
after about 330 s, and end with no answer.

The cockpit restarts an SGLang server left without its scheduler, once
it has been so for 2 min (COCKPIT_ZOMBIE_RESTART), tells one crash of a
serving lane from a boot that keeps dying, and says why a start waits
or was refused.

Tested end to end on the reference box: the flash lane's server sent
SIGQUIT under the real opencode and Claude Code, twice. The runs found
four faults the unit tests could not (a zombie probe docker refused, a
watched boot read as a boot again, a restart that ended the waits, the
cut's error event), each fixed with a test that fails without the fix.
After 632 to 1,068 s held, both clients got their whole answers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 23:20:35 +02:00
Hasan BasbunarandClaude Opus 5.5 8491b66dee engine-inputs.py: the run after a first install keeps the engine it started
The run after every first install restarted the engine: "why:
qwen38-sglang.service changed after qwen38-sglang.service started". The
installer writes the unit, then restarts the engine in the same second,
and systemd gives the start in whole seconds; compared with the file's
fraction (22:42:23.162 against 22:42:23), the write read as a change made
after the start. On the reference box, emptied and installed from nothing
on 2026-09-30, that second run cost an 8-minute boot, a new pool, new
opencode limits and a restart of opencode-web, all for nothing.

Both sides are whole seconds now, as install.sh's own stale_since compares
them for the proxy, the cockpit and opencode-web. A test pins the second of
the start (fails on the previous revision) and one the second after.

The last three strings that called the Agent view a tab (oc-fit-limits.py,
the relay's sign-in page, the cockpit's autofit event) say view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 23:06:54 +02:00
Hasan BasbunarandClaude Opus 5.5 1a86997f77 tests: the launcher's rewrite-only-when-it-changes guard, read in its new shape
03cc671 made the launcher's write an if/else so that an unchanged launcher says so;
the test held the guard by its old one-line spelling. It now checks that the install
sits in the branch where the comparison found a difference, and that no other path
writes the launcher. An unguarded write fails it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 21:53:43 +02:00
Hasan BasbunarandClaude Opus 5.5 d163cc4c1f tests: thirteen that could not fail now see the defect they are named for
Each was reproduced by a mutant that left the suite green, and now fails on it:
- the uninstall inventory read the last assignment of each pin (the help text's moving
  tag, a later "$CUR_DRAFT"), matched images by substring and units and containers by
  presence anywhere in the file: it reads the pins, matches whole entries, and checks the
  disable, rm and docker rm lines themselves, the flash launcher's container included;
- the fake systemctl printed an epoch whatever it was asked, so a dropped
  --timestamp=unix went unseen;
- the native-restore guard's fixture carried a --context-length no native unit has, and
  its exit code was thrown away, so a dropped `|| true` stayed green;
- the 27B opencode block's own numbers were the table's, so which one was used could not
  be seen;
- needle.sh's 1/1 pass tolerated rc 1;
- the System One cancel was set before the call, so a check above the slot wait passed;
- the image lane's root refusal was a substring, the cockpit step's wiring too: both run
  now, the step against stub installers under install.sh's own shell options;
- job pruning was called by a name that did not exist, behind a hasattr;
- the audit test never read the argv it is named for;
- "importing binds nothing" looked for a name nothing defines: it measures threads and
  sockets around a fresh import;
- the static directory's containment was a string prefix, so a sibling named static.bak/
  was served before the session check: it compares path components, with a test.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 18:22:38 +02:00
Hasan BasbunarandClaude Opus 5.5 795b97a270 install.sh: an update that changes nothing restarts nothing; a moved branch or tag restarts the engine; summaries that point at the right things
- I18: the proxy, the cockpit and opencode-web restart only when they are not
  running, when the run changed what they run, or when they started before a
  file they read changed (stale_since); units, the proxy copy and the
  generated opencode config are written only when their content changes.
  The proxy still follows an engine restart. On 1m, step 7 keeps a fitted
  pair under the table's bounds (oc-merge-limits.py --keep-lower, and the
  generator), instead of writing the bounds for the end fit to undo: 49
  opencode-web and 36 cockpit starts on 2026-09-23, 79 config backups
- I13: engine-inputs.py resolves a branch revision through refs/ and counts
  the ref, and reads the image wherever it is named (a moving tag); the flash
  draft vocabulary is built for MODEL_REV=main
- I14: an explicit CONTEXT_MODE=native writes the native opencode limits
- I15: an oc at ~/.local/bin/oc that is not ours is left alone; the command
  offered instead carries OPENCODE_CONFIG (I35)
- I16/I17: the summary sends clients to the proxy; --no-service names what
  ./uninstall.sh --list shows, the key-reading provider included
- tests: the smoke extraction ends at its own last check; the abort test's
  fake engine registers a request before its headers, as SGLang does (an
  abort landed in that gap once in a CI run)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 17:00:07 +02:00
Hasan BasbunarandClaude Opus 5.5 917ad94100 install: restart the engine only when something it reads changed
Every ./install.sh restarted the engine, a full boot per update (7 to 8 min
on the 27B, 12 on flash) even when the update touched only the cockpit, the
proxy or opencode. engine-inputs.py finds what the engine reads at start from
its unit (unit, drop-ins, the flash launcher, config files named directly or
through /out, checkpoint configs, image IDs) and tells whether the running
engine already has it. Step 9 keeps the engine when it does, the run changed
none of it by content, and it answers /health; the real smoke test still
runs. RESTART_ENGINE=1 forces a restart, and every restart says why.

The unit, the flash launcher and the patched template are now written only
when their content changes: an identical rewrite dated them after the
engine's start and made every second run restart it.

Reference box: a plain ./install.sh on the serving 27B, 28 s twice in a row,
engine start time unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 21:09:53 +02:00