Merge pull request 'Agent: bound video GPU work (early-exit frame loop at max_regions)' (#172) from dev into main
Build images / sign-extension (push) Successful in 3s
CI / lint (push) Successful in 4s
Build images / build-ml (push) Successful in 6s
Build images / build-agent (push) Successful in 8s
Build images / build-web (push) Successful in 6s
CI / frontend-build (push) Successful in 20s
CI / backend-lint-and-test (push) Successful in 27s
CI / integration (push) Successful in 3m26s

This commit was merged in pull request #172.
This commit is contained in:
2026-06-30 22:57:33 -04:00
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ from .worker import Worker
# Bump on every agent change. The page embeds this and /status reports it; the UI
# warns to reload when they differ — so a stale browser-cached page can't be
# mistaken for "the new image didn't deploy". (Belt-and-braces with no-store.)
VERSION = "2026-06-30.9 · region-caps + active-reset"
VERSION = "2026-06-30.10 · video region early-exit"
logbuf.install()
cfg = Config.from_env()
+6
View File
@@ -559,6 +559,12 @@ class Worker:
tmpl["siglip_embedding"] = vec
tmpl["embedding_version"] = embed_version
regions.append(tmpl)
# Stop once we have enough: a long video (image 81602 = a 156 MB
# mp4, 64 sampled frames × ~32 regions) would otherwise burn ~38s
# of GPU across every frame before the submit is even truncated.
# Bounds the WORK, not just the POST body.
if len(regions) >= self.cfg.max_regions:
break
self._record("gpu", time.monotonic() - _t_gpu)
# Backstop: never submit an unbounded pile of regions (a pathological
# image / long video). Keep the highest-scoring max_regions so the