Skip to content

v0.3.1 — HF4 reconfigure

Choose a tag to compare

@revolutionaryPhoton revolutionaryPhoton released this 14 May 15:15

HF4 fix — the GUI's Reconfigure flow now actually swaps the chat backend (mock ↔ Ollama) on a running stack instead of silently no-op'ing. Three compounding bugs were found and fixed in this single ship.

What was broken

Clicking Reconfigure on a running stack and switching backend (mock → Ollama, or back) would walk through the wizard but leave Docker Compose untouched. The user would land back on /status with the old backend still serving.

Three compounding bugs (all fixed)

  1. state::read clobbered env-set values — the GUI exported CHAT_BACKEND=ollama, but the wizard's state-loader overwrote it with the previously saved mock before the new compose got rendered. Inverted the guard so env wins. Also normalized OLLAMA_MODEL, which was missing the empty-state check the other four vars had.

  2. F13_STATE_ACTION was shadowed before state::check read itbin/f13-config did F13_STATE_ACTION="" unconditionally, so the GUI's exported edit value was discarded and the wizard defaulted to keep. Without this, the wizard never even entered the edit branch.

  3. Reconfigure didn't bring down the running stack — even after the wizard correctly took the edit path, the previous run's containers stayed bound to the chosen ports and the new chat container couldn't claim them. The user got stuck on the GUI's port-check screen because both ports were reported as in-use. Now the Reconfigure button on /status calls compose.down before navigating, and a new _wizard_stop_running_stack helper in the shell wizard adds defense-in-depth for direct CLI invocations.

Tests

  • 4 new bats regressions in tests/state.bats (env-wins for CHAT_BACKEND, OLLAMA_MODEL, FRONTEND_PORT, plus an empty-env case)
  • 4 new bats assertions in tests/f13-config.bats (stop event on edit / reset, absent on keep / fresh init)
  • 4 new vitest assertions (stateAction:"edit" plumbing + Reconfigure stops a running stack)
  • Pre-existing re-run with edit action re-renders config test tightened — old form was a no-op assertion

Validated on

  • macOS (Apple Silicon, manual smoke test of the full reconfigure round-trip: mock → Ollama → mock → fresh init)

Linux validation will happen on the maintainer's WSL2 box during the next session there; the changes are pure logic/state-machine fixes with no Linux-specific surface area.

Known loose ends carried forward

  • HF2 — Cancel button in the launch pipeline doesn't kill the bash subprocess (deferred since v0.2.x)
  • HF3 — Sporadic pull access denied on frontend image (deferred since v0.2.x)

PRD also flags some "likely-others" edge cases that may surface now that the reconfigure flow actually works (port changes mid-cycle, stale OLLAMA_MODEL on Ollama → mock). Worth a sweep but out of scope for this patch.


Full Changelog: v0.3.0...v0.3.1