Expand description
agents wait — block until an agent is done.
Targets an instance hierarchy or a tag (a plain ref has no live identity — error). The wait is uncapped — it blocks until the target’s lock releases, however long that takes.
- Instance: subscribe to the AIH lock’s release
(
objectiveai_sdk::lockfile::wait_releasedreturns immediately when nobody holds it). - BOUND tag: resolve to its hierarchy, then the instance wait.
- GROUPED (un-upgraded) tag: the tag lock’s holder is the spawn materializing the tag. Nobody holding it ⇒ nothing is materializing it ⇒ done (re-checked against the DB first — a racer may have upgraded+released between our lookup and the probe). Held ⇒ wait for release, then re-resolve: the spawn flow commits the GROUPED→BOUND upgrade strictly BEFORE releasing the tag lock, so a still-GROUPED tag here is a systemic invariant violation and errors fatally; the freshly bound hierarchy falls through to the instance wait.