Refuse what a node cannot publish, and stop timing out work that is fine

Four things the python SDK turned up, each fixed where every client sees it.

A key no port declares is now an error rather than a silent drop, on the
return, the yield and the emit alike — the contract the docs already stated.
The SDK reads literal yields at sync time, so a typo fails before anything
runs, and an emission of one fails the call rather than being logged where
nobody looks.

NaN and infinity are refused at the port. JSON cannot spell either, so one
that travelled came back as a 500, a socket frame that stopped the canvas, or
a metric batch the database dropped whole.

An artifact input takes `@run:<id>.<output>` or a bare digest, resolved on the
engine — so the CLI, the run dialog and a python caller mean the same thing,
and a sweep can pass one at all.

Node timeouts are off by default. The clock measured silence, which a training
node is full of, and remote workers had already stopped enforcing it — their
heartbeat reset it. Now a heartbeat proves the agent rather than the node,
ninety seconds of nothing fails the call either way, and the engine touches
work it is still running so a long node is not redelivered at sixty seconds.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019V5bsYGNxcgPs4xXmTPx69
This commit is contained in:
2026-08-25 07:30:14 +02:00
co-authored by Claude Opus 5
parent c33fa404a4
commit 93374a310e
32 changed files with 968 additions and 67 deletions
+26
View File
@@ -126,6 +126,15 @@ class WorkQueue(ABC):
def ack(self, item: WorkItem) -> None:
"""Mark an item done, so it is never redelivered."""
def touch(self, entry_ids: list[str]) -> None:
"""Say these items are still being worked on, not abandoned.
A node with no timeout may run far longer than the reclaim window, and
nothing else distinguishes that from an engine that died holding the
item. Concrete rather than abstract: a queue with no redelivery has
nothing to answer here.
"""
@abstractmethod
def reclaim_stale(self, min_idle_ms: int) -> list[WorkItem]:
"""Take back items claimed by a consumer that never acknowledged them."""
@@ -361,6 +370,23 @@ class RedisWorkQueue(WorkQueue):
if item.entry_id:
self._redis.xack(self._stream, GROUP, item.entry_id)
def touch(self, entry_ids: list[str]) -> None:
if not entry_ids:
return
# Claiming an entry we already hold resets how long it has been idle,
# which is the only thing `reclaim_stale` reads. `justid` keeps the
# delivery count where it is, so a long node neither redelivers nor
# spends its way towards the dead-letter cap. An entry already
# acknowledged is simply not there, and this is a no-op for it.
self._redis.xclaim(
self._stream,
GROUP,
self._consumer,
min_idle_time=0,
message_ids=entry_ids,
justid=True,
)
def reclaim_stale(self, min_idle_ms: int) -> list[WorkItem]:
"""Take over entries a dead consumer never acknowledged."""
_cursor, entries, _deleted = cast(