From 328e3c8e98e22cff2b62e2f6f5119a761314ed32 Mon Sep 17 00:00:00 2001 From: stroblme Date: Tue, 18 Aug 2026 18:03:28 +0200 Subject: [PATCH] Let the worker agent run straight from a checkout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It expects worker_main.py beside it, which is true on a worker host and not in a clone — so trying a remote worker started with copying files around. It now looks one directory over as well. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01AD8SfVhzXBG2nAfFcVh3iD --- backend/app/worker/fluksio_worker.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/backend/app/worker/fluksio_worker.py b/backend/app/worker/fluksio_worker.py index 458f652..4124902 100644 --- a/backend/app/worker/fluksio_worker.py +++ b/backend/app/worker/fluksio_worker.py @@ -48,7 +48,24 @@ PROTOCOL = 1 HEARTBEAT_S = 10.0 #: Reconnection backs off to this and no further. MAX_BACKOFF_S = 30.0 -WORKER_MAIN = Path(__file__).with_name("worker_main.py") + + +def _worker_main() -> Path: + """The user-code runner: beside this file once deployed, or in a checkout. + + On a worker host the two files sit together, which is what the install + instructions say. Run straight from a clone and the runner is one directory + over, in the engine's own package — worth finding, so trying this out does + not start with copying files around. + """ + here = Path(__file__).resolve().parent + for candidate in (here / "worker_main.py", here.parent / "flow" / "worker_main.py"): + if candidate.exists(): + return candidate + return here / "worker_main.py" + + +WORKER_MAIN = _worker_main() class Subprocess: