From a095f1a140d6ee291b7121e297d12c0a11380e58 Mon Sep 17 00:00:00 2001 From: m3ultra Date: Wed, 22 Jul 2026 19:04:23 +1000 Subject: [PATCH] fix(runner): remap remote-worker output paths after collect Pre-existing working-tree fix committed for the record: result.json from a remote worker carries paths on ITS disk; remap by the out/-relative tail (basename fallback) and log skipped outputs instead of silently dropping them. Co-Authored-By: Claude Fable 5 --- server/runner.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/server/runner.py b/server/runner.py index 267fe3a..27f3b94 100644 --- a/server/runner.py +++ b/server/runner.py @@ -341,11 +341,25 @@ class Runner: p = Path(out["path"]) if not p.is_absolute(): p = outdir / p + if not p.exists(): + # a remote worker writes result.json with paths on ITS disk + # (/data/remote//out/...); after collect() those + # files sit in the local outdir — remap by the out/-relative + # tail, falling back to the basename + marker = f"/data/remote/{job_id}/out/" + _, _, tail = str(out["path"]).partition(marker) + if tail and (outdir / tail).exists(): + p = outdir / tail + else: + p = outdir / Path(out["path"]).name if p.exists(): a = store.register_file(con, p, name=out.get("name"), parent_job=job_id, move=True, meta=out.get("meta"), user_id=owner_id) registered.append(a["id"]) + else: + print(f"[runner] {job_id}: result.json output not found after " + f"collect, skipped: {out.get('path')}", flush=True) else: for p in sorted(outdir.iterdir()): if p.name == "result.json" or p.name.startswith("."):