Skip to content
VegaStack
All docs
Agents

Wait conditions

How agents block on review events with `wait_for_review`.

Updated 2026-05-21

Wait conditions

The wait_for_review MCP tool turns the review loop into a blocking primitive an agent can call directly.

What it watches

wait_for_review opens a server-side cursor over the review_events stream scoped to a workspace plus optional page_id. It returns when an event matches the supplied predicate or when the timeout elapses.

Supported predicates

  • thread_state — wait until a specific thread transitions to resolved, complete, or reopened.
  • thread_open — wait until any thread opens on the page (typical pattern for "ask for review and wait").
  • new_reply — wait until a reply lands on a specific thread.
  • timeout_seconds — bound the wait. The tool returns { matched: false } on timeout rather than erroring.

Idiomatic flow

1. update_page(...)
2. create_comment(thread_id?, "Ready for review")
3. wait_for_review({ page_id, predicate: { thread_open: true }, timeout_seconds: 1800 })
4. branch on result:
     matched=true → either update again (if reviewer reopened) or set_resource_public (if reviewer resolved)
     matched=false → escalate via your own mechanism

Parity with the UI

The Comments slide-over polls /api/review-events every 15 seconds for the same stream. A reviewer working in the UI and an agent waiting via MCP see the same events.

Audit

Every fired event is durable and visible in Settings → Audit scoped to the workspace, and in the page-details History tab scoped to the page.