fix(installer): uninstall.sh dev mode + hal0-caddy unit cleanup#18
Merged
Conversation
Two related defects in installer/uninstall.sh that together let a developer's `install.sh --dev` get torpedoed by a follow-up `uninstall.sh` that hardcoded the host FHS layout, and left an orphan hal0-caddy.service behind on real installs that used --auth=basic. Findings #3+#4 / tasks #21+#22: * Mirror install.sh:89-100's PREFIX / ETC_DIR / VAR_DIR / UNIT_DIR / LIB_DIR computation behind a new --dev flag (HAL0_PREFIX honored the same way), and route every path reference through the computed vars instead of /etc/hal0, /var/lib/hal0, /usr/lib/hal0, /etc/systemd/system literals. --dev also skips root-escalation, systemctl, docker-stop, the /usr/local/bin/hal0 PATH symlink, and the system-user removal — exactly the operations install.sh --dev never performed. * Add hal0-caddy.service to both the stop/disable list and the unit-file removal loop so --auth=basic installs uninstall cleanly. * Help text now documents --dev and HAL0_PREFIX. Smoke-tested with HAL0_PREFIX=$(mktemp -d) HAL0_FORCE=1 ./uninstall.sh --dev: only touches the tmp tree, leaves the host alone, exits clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
11 tasks
thinmintdev
added a commit
that referenced
this pull request
May 21, 2026
…18) (#69) Two harness findings on the OpenAI-compatible audio routes: - #14: POST /v1/audio/transcriptions with a non-audio body could leak the moonshine container's ffmpeg argv + tempfile path through the proxy when an out-of-tree / older upstream returned a raw CalledProcessError repr. The dispatcher forwards upstream bodies verbatim by design, so the audio route now scrubs the response for the leak markers ("ffmpeg" / "CalledProcessError") and substitutes a clean 415 envelope with code=audio.unsupported_format. New UnsupportedMediaType subclass added to hal0.errors so other 415 call sites have an ergonomic on-ramp. - #18: POST /v1/audio/speech with a body missing the 'model' field previously fell through the dispatcher's default-model + no-route path and surfaced a misleading 404. The route now raises BadRequest up front with code=request.missing_model so OpenAI clients see the real problem (matching field added on /v1/audio/transcriptions for consistency). Existing tests' code assertion updated from validation.invalid to request.missing_model. Tests ===== - tests/api/test_v1_audio.py (new) covers: * non-audio multipart → 415 audio.unsupported_format, no "ffmpeg" or "CalledProcessError" substring in the response body * clean upstream 5xx body passes through untouched (scrubber narrowness) * /v1/audio/speech missing model → 400 request.missing_model * /v1/audio/speech empty/whitespace model → 400 request.missing_model * happy-path STT + TTS via httpx.MockTransport round-trip * sanity: scrubber leaves non-audio routes alone Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Two related defects in
installer/uninstall.sh:#22 — missing
hal0-caddy.servicein unit-removal loop (install.sh:439 writes it on--auth=basic). After uninstall, hal0-caddy is orphaned — failed-to-start unit pointing at deleted binary.#21 — no
--devmode. Uninstaller hardcoded FHS paths; running it afterinstall.sh --devwould wipe the host's/etc/hal0,/var/lib/hal0,/usr/lib/hal0, and systemd units. Now mirrors install.sh:89-100's PREFIX / ETC_DIR / VAR_DIR / UNIT_DIR / LIB_DIR computation behind a--devflag (HAL0_PREFIX honored the same way).--devalso skips root-escalation, systemctl, docker-stop, the /usr/local/bin/hal0 PATH symlink, and the system-user removal.Closes tasks #21 + #22. Harness FINDINGS.md #3 + #4.
Note on branch hygiene
This was cherry-picked from Team M's original branch (which was inadvertently based on the FLM toolbox branch instead of main) onto a fresh main checkout. The 196-line uninstall.sh diff is the only real change.
Test plan
bash -n installer/uninstall.sh— syntax OKHAL0_PREFIX=$(mktemp -d) HAL0_FORCE=1 bash installer/uninstall.sh --dev— only touches tmp tree, exits cleaninstall.sh --dev+uninstall.sh --devround-trip on hal0-test LXCinstall.sh --auth=basic+uninstall.sh— confirm hal0-caddy unit removed🤖 Generated with Claude Code