← All guides

Sharing one resource between agents

Some things can only be used by one runner at a time — a browser tab being the obvious one. Two Agents that both drive it will happily interleave their clicks and produce nonsense, and neither can see what the other is doing.

So they take a named lock instead. Whoever asks first gets it; everyone else is told, plainly, who holds it and until when. Being turned away is a normal answer and not an error — the usual shape of a loop is "ask for the lock, and if someone else has it, skip this tick and try again later".

A lock is a lease, not a flag: you say how long you expect to need it, and it lets go on its own when that time is up. That is the part that matters. An agent that crashes mid-run can't leave the thing it was holding stuck forever, because nothing has to remember to clean up after it — the lease simply lapses. If a run legitimately takes longer than expected, it can extend its own lease as it goes.

Prompts and scripts contend on equal terms, so a model-driven agent and a script can safely share one resource. Where Frontier drives a browser, the lock is enforced at the browser rather than on trust: while someone holds it, another caller's attempts to drive the tab are refused outright, while looking at what the tab is doing stays open to everyone, since that is how you find out why a holder is stuck.

Locks you can see are listed with their holders and expiry, including the ones that have already lapsed — an expired lock is still the most recent answer to "who touched this last".