Skip to content

fix(proxy): stop keeps the port alive; default guard watchdog#13

Merged
codehippie1 merged 3 commits into
mainfrom
release/v0.11.1
Jun 18, 2026
Merged

fix(proxy): stop keeps the port alive; default guard watchdog#13
codehippie1 merged 3 commits into
mainfrom
release/v0.11.1

Conversation

@codehippie1

Copy link
Copy Markdown
Contributor

What

Stopping Burnwall could strand an already-running AI tool: the tool froze the
proxy URL at launch, so when stop killed the proxy the tool's next request hit
a dead port (a bare connection error), and neither stop nor pause gave a
clean escape. This makes the proxy lifecycle resilient.

  • burnwall stop (default) now drains instead of vacating the port. It flips
    the proxy to a relay-only pass-through and leaves it serving, so a running tool
    keeps working (protection off — no scan/budget/cost capture) until traffic goes
    idle, at which point the proxy retires itself and frees the port.
    burnwall stop --hard keeps the immediate-terminate behavior (used by
    uninstall/upgrade).
  • A fresh start takes over a draining proxy and clears stale bypass, so
    stopstart re-arms protection seamlessly.
  • Guard watchdog on by default with start --daemon (--no-guard to opt
    out): it pauses shell routing within seconds when the proxy dies silently, so
    new shells go direct. It now watches the proxy's actual port — previously it
    watched the configured port, so a non-default --port could make it misread a
    healthy proxy as dead.
  • Clearer dead-proxy guidance in status/stop, pointing at burnwall start
    (revive) and burnwall recover (go direct); status shows a "stopped
    (draining)" state instead of a misleading green.

Tests

New coverage for the drain bypass mode + relay, the idle-retire decision, soft vs
hard stop, guard spawn/terminate, and --no-guard. Full suite passes, clippy
-D warnings clean, no leaked processes.

Bumps 0.11.0 → 0.11.1.

…atchdog

A soft `burnwall stop` now leaves the proxy up as a pass-through relay and
pauses protection, so an already-running AI tool keeps working instead of
failing on a dead port. The relay does no scanning/budget/cost capture and
retires itself once traffic goes idle, freeing the port. `burnwall stop
--hard` keeps the immediate-terminate behavior (used by uninstall/upgrade),
and a fresh `start` takes over a draining proxy so `stop` -> `start` re-arms
protection seamlessly.

`burnwall start --daemon` now spawns the guard watchdog by default
(`--no-guard` to opt out): it pauses shell routing within seconds when the
proxy dies silently (best-effort relaunch on). The guard now watches the
proxy's ACTUAL port -- a `--port` differing from config previously made it
misread a healthy proxy as dead.

The dead-proxy guidance in `status`/`stop` now points at `burnwall start`
(revive) and `burnwall recover` (go direct) and shows a draining state.

Bumps 0.11.0 -> 0.11.1.
The Linux branch compared only the bare file name, so a binary launched from a burnwall checkout (the daemon_test-* integration runner) read as not-burnwall and process_is_alive returned false on Linux only. Match the full /proc/<pid>/exe path, consistent with the Windows (full image path) and macOS (ps -o comm=) checks. Fixes the two Linux-only daemon test failures.
Formatting-only; clears the tree-wide rustfmt --check failures that predate this branch (accuracy/doctor/explain/export/history/nudge/security/status/term/...).
@codehippie1 codehippie1 merged commit 5b9c281 into main Jun 18, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant