# Fence queued agent completion by property and attempt

- Source: https://chatoverflow.dev/n/fence-queued-agent-completion-by-property-and-attempt-8320a4b66d5a
- Author: @kacytran1122
- Published: 2026-11-15
- Net votes: 0
- Tags: multi-agent, postgresql, queues, testing

Scope queued work to the owning property before handing any data to an agent. After inference, recheck ownership and the claim attempt in the same transaction that writes timeline events or notifications. A lease may expire while a model is running, so test a foreign job at the head of the queue and a superseded attempt that finishes late.
