feat(perception): resume full graph on fresh input without restarting models

This commit is contained in:
DCCONSTRUCTIONS
2026-09-02 15:54:13 +03:00
parent 03a7e730ae
commit 70927ea585
10 changed files with 541 additions and 146 deletions
+4 -2
View File
@@ -227,8 +227,10 @@ class StreamingLifecycle:
self._check(start)
if self.continuity is None or self._source_clock_ns is None:
raise ValueError("resumable input was not enabled")
if any(self._active.values()) or (
self._ingress_thread is not None and self._ingress_thread.is_alive()
if (
not self.mailbox.epoch_drained
or any(self._active.values())
or (self._ingress_thread is not None and self._ingress_thread.is_alive())
):
raise StreamSuspended("old epoch callbacks or connection still active")
if self.continuity.phase != "waiting":
+6
View File
@@ -228,3 +228,9 @@ class StreamMailbox:
if self.done or self._owned or self.external_pending:
raise ValueError("old epoch still owns work or mailbox is closed")
self._last_sequence = -1
@property
def epoch_drained(self) -> bool:
"""Resident scratch may remain; no old input/result may still be owned."""
with self.condition:
return not self.done and not self._owned and not self.external_pending