From fd3ae220a1255e5a17c6b2f30af619f15ebb5423 Mon Sep 17 00:00:00 2001 From: Kaden Schutt Date: Fri, 4 Sep 2026 17:44:50 +0000 Subject: [PATCH] fix(serve_harness): the per-run home wins over an inherited HIPFIRE_HOME MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit spawn_serve isolates the daemon by setting HOME= and writing /.hipfire/config.toml — but it inherits os.environ, and ConfigPaths::discover prefers HIPFIRE_HOME over $HOME/.hipfire. hw-gate exports HIPFIRE_HOME per lane, so every gate daemon resolved the lane's pinned config (no [speculation] section) instead of the harness's `mtp = "off"`, and the schema default `auto` auto-attached a sibling .mtp head wherever one existed. On #691's run (33900101473) that made the two lanes diverge on host state: hiptrx has qwen3.8-27b.mq4v2.xt.mtp beside the symlink target and ran the chain under MTP (one degenerate turn); hipx has no sidecar and ran AR. The pre-flight printed `mtp_mode: off` either way — the harness's intent, not what the daemon resolved. Reproduced on hiptrx with the base daemon, same config.toml, `mtp="off"`: inherited HIPFIRE_HOME -> "MTP head loaded"; HIPFIRE_HOME=/.hipfire -> no head. The env now sets HIPFIRE_HOME to the run home explicitly. --- scripts/serve_harness.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/serve_harness.py b/scripts/serve_harness.py index 0b0b8f85f..ae460ca46 100644 --- a/scripts/serve_harness.py +++ b/scripts/serve_harness.py @@ -1951,7 +1951,14 @@ def spawn_serve(cfg, home, log): # Honor a caller-provided per-GPU daemon binary (a renamed copy → distinct # process comm → the CLI's reapOrphans `pkill -x ` stays scoped to THIS # instance). HIPFIRE_DAEMON_NAME/ID pass through from os.environ untouched. - env = dict(os.environ, HOME=home, HIP_VISIBLE_DEVICES=os.environ.get("HIP_VISIBLE_DEVICES","0"), + # The isolated home MUST be what the daemon resolves. ConfigPaths::discover + # prefers HIPFIRE_HOME over $HOME/.hipfire, so an inherited HIPFIRE_HOME + # (hw-gate exports one per lane) silently replaced this run's config.toml + # with the parent's: [speculation] mtp="off" never reached the daemon, the + # schema default `auto` auto-attached a sibling .mtp head, and the two gate + # lanes diverged on host state (hw-gate run 33900101473, #691). + env = dict(os.environ, HOME=home, HIPFIRE_HOME=os.path.join(home, ".hipfire"), + HIP_VISIBLE_DEVICES=os.environ.get("HIP_VISIBLE_DEVICES","0"), HIPFIRE_DAEMON_BIN=os.environ.get( "HIPFIRE_DAEMON_BIN", os.path.join(REPO, "target", "release", "daemon" + (".exe" if os.name == "nt" else ""))),