Commit graph

2 commits

Author SHA1 Message Date
Neil Bantoc
e48517b1cf Setup: keep the dashboard's reasoning setting across an update
cmd_setup rebuilds config.json from the plan, and the reasoning setting isn't
part of the plan -- the dashboard writes it into the same file. So every
`llmhost update` (setup --yes under the hood) silently put every model back to
"Model default", losing a setting the user had chosen in the UI.

Carry it over, minus models that no longer fit. The helper exists so the reason
is on the record rather than implied by a dict literal; its tests cover the
empty and no-longer-fits cases that must not write the key at all.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-11-03 15:01:12 -08:00
Neil Bantoc
51c2880a2e Add tests/: four suites, a runner, and a sandbox that can't escape
These grew one bug at a time in a scratch directory and were about to be thrown
away, having caught four real regressions between them. Move them in as they
are -- plain scripts, stdlib only, no test dependency -- behind a shared harness
and `python3 tests/run.py`.

The harness exists mostly for its guard. A suite testing the purge path once
sandboxed LLMHOST_CONFIG but not LLMHOST_HOME and deleted a live install's data
directory; BIN_DIR and SHIM have no env override at all, coming straight off
Path.home(). So the harness repoints those into the sandbox and then asserts
that every path llmhost could write or delete is inside it, aborting the run if
not -- verified by pointing it at a real path and watching it refuse.

The model plan the opencode suite needs is now a fixture rather than a file read
out of someone's home directory; it carries no key (the key lives in its own
file) and its machine-specific fields are pinned.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-11-03 02:23:15 -08:00