From 3254f9233c5ac236e4f97f33669231c6073123e4 Mon Sep 17 00:00:00 2001 From: goodboy Date: Mon, 23 Mar 2026 23:05:12 -0400 Subject: [PATCH] Use pre-set reg addrs in `maybe_spawn_daemon()` Pull actor-runtime `registry_addrs` from (the new) `tractor.get_runtime_vars()` (over the previous hardcoding of `('127.0.0.1', 6116)`..)) so that underlying `find_service()` and `maybe_open_pikerd()` calls use the local actor's assigned registrar endpoints. Note, this is particularly necessary to get the `pytest` harness workin again alongside any local running `pikerd` instance(s). (this commit msg was generated in some part by [`claude-code`][claude-code-gh]) [claude-code-gh]: https://github.com/anthropics/claude-code --- piker/service/_daemon.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/piker/service/_daemon.py b/piker/service/_daemon.py index 7cd7cdd1..edab10a5 100644 --- a/piker/service/_daemon.py +++ b/piker/service/_daemon.py @@ -79,10 +79,17 @@ async def maybe_spawn_daemon( lock = Services.locks[service_name] await lock.acquire() + if not pikerd_kwargs: + # XXX NOTE, pin to apprope `tractor` branch! + rtvs: dict = tractor.get_runtime_vars() + registry_addrs: list[tuple] = list( + map(tuple, rtvs['_registry_addrs']) + ) + try: async with find_service( service_name, - registry_addrs=[('127.0.0.1', 6116)], + registry_addrs=registry_addrs, ) as portal: if portal is not None: lock.release() @@ -99,6 +106,7 @@ async def maybe_spawn_daemon( # process tree async with maybe_open_pikerd( loglevel=loglevel, + registry_addrs=registry_addrs, **pikerd_kwargs, ) as pikerd_portal: