Compare commits

...

2 Commits

Author SHA1 Message Date
27049f00ea Merge pull request 'quick agent fix' (#24) from zfp-oss into main
Some checks failed
Build Sphinx Docs Set / Build Docs (push) Successful in 21s
Build Project / Build Project (3.10) (push) Successful in 16m7s
Build Project / Build Project (3.12) (push) Successful in 20m21s
Build Project / Build Project (3.11) (push) Successful in 21m9s
Test with tox / Test with tox (3.10) (push) Failing after 21m25s
Test with tox / Test with tox (3.11) (push) Failing after 15m0s
Test with tox / Test with tox (3.12) (push) Failing after 14m7s
Reviewed-on: #24
2026-04-17 11:50:10 -04:00
ben
78ecd171bd quick agent fix
Some checks failed
Build Sphinx Docs Set / Build Docs (pull_request) Successful in 18s
Test with tox / Test with tox (3.10) (pull_request) Failing after 51s
Build Project / Build Project (3.10) (pull_request) Successful in 1m12s
Build Project / Build Project (3.11) (pull_request) Successful in 1m12s
Build Project / Build Project (3.12) (pull_request) Successful in 1m14s
Test with tox / Test with tox (3.12) (pull_request) Failing after 2m29s
Test with tox / Test with tox (3.11) (pull_request) Failing after 1m37s
2026-04-17 11:49:44 -04:00

View File

@ -20,7 +20,7 @@ Usage::
The agent:
1. Registers with RIA Hub and receives a ``node_id``.
2. Sends a heartbeat every 30 s so the hub knows it is online.
3. Long-polls ``GET /orchestrator/nodes/{id}/commands`` (30 s timeout).
3. Long-polls ``GET /composer/nodes/{id}/commands`` (30 s timeout).
4. Dispatches received commands:
- ``run_campaign``: executes via CampaignExecutor, uploads recordings.
- ``load_model``: loads an ONNX fingerprint or detector model.
@ -173,7 +173,7 @@ class NodeAgent:
if self._ort_available:
capabilities.append("inference")
resp = self._post(
"/orchestrator/nodes/register",
"/composer/nodes/register",
json={
"name": self.name,
"sdr_device": self.sdr_device,
@ -190,7 +190,7 @@ class NodeAgent:
if not self.node_id:
return
try:
self._delete(f"/orchestrator/nodes/{self.node_id}", timeout=10)
self._delete(f"/composer/nodes/{self.node_id}", timeout=10)
logger.info("Deregistered %s", self.node_id)
except Exception as exc:
logger.debug("Deregister failed (ignored on shutdown): %s", exc)
@ -202,7 +202,7 @@ class NodeAgent:
def _heartbeat_loop(self) -> None:
while not self._stop.wait(_HEARTBEAT_INTERVAL):
try:
resp = self._post(f"/orchestrator/nodes/{self.node_id}/heartbeat", timeout=10)
resp = self._post(f"/composer/nodes/{self.node_id}/heartbeat", timeout=10)
if resp.status_code == 404:
logger.warning("Heartbeat got 404 — hub lost registration, re-registering")
self._register()
@ -217,7 +217,7 @@ class NodeAgent:
while not self._stop.is_set():
try:
resp = self._get(
f"/orchestrator/nodes/{self.node_id}/commands",
f"/composer/nodes/{self.node_id}/commands",
timeout=_POLL_CLIENT_TIMEOUT,
)
if resp.status_code == 204:
@ -540,7 +540,7 @@ class NodeAgent:
logger.info("Inference loop exited")
def _post_event(self, device_id: str | None, confidence: float, snr_db: float) -> None:
"""POST a single detection event to ``POST /orchestrator/nodes/{id}/events``.
"""POST a single detection event to ``POST /composer/nodes/{id}/events``.
Failures are logged at DEBUG level and silently swallowed so that a
transient network blip does not crash the inference loop.
@ -556,7 +556,7 @@ class NodeAgent:
}
try:
resp = self._post(
f"/orchestrator/nodes/{self.node_id}/events",
f"/composer/nodes/{self.node_id}/events",
json=payload,
timeout=5,
)
@ -619,7 +619,7 @@ class NodeAgent:
payload["error"] = error
try:
resp = self._post(
f"/orchestrator/nodes/{self.node_id}/campaign-status",
f"/composer/nodes/{self.node_id}/campaign-status",
json=payload,
timeout=15,
)