← All features

Run the agentsAvailable in v0.3.0

Leases

A lease reserves the paths one task may change, so two AI sessions never edit the same files by accident. An overlapping lease is refused with OAH_LEASE_CONFLICT, naming the holder. When the task finishes, oah compares the files really changed with the scope, because a lease cannot stop an editor from writing elsewhere.

When you need it

Two AI sessions on one repository will happily edit the same file, and nobody notices until the changes collide.

How it works

  1. oah start --task T --agent A --scope PATH… takes a lease; oah start --packet PACKET.md takes the scope from the packet and binds its intent in the same step.
  2. A scope that overlaps another lease is refused with OAH_LEASE_CONFLICT, which names the holder. The scope repo means the whole repository.
  3. oah status lists every lease as active or STALE and only reads; oah renew extends a lease and can replace its scope; oah release --reason drops it without finishing.
  4. oah finish compares the files really changed since the lease started with the scope and refuses with OAH_SCOPE_EXCEEDED when they go outside it.
  5. Workers that oah call launches run with OAH_WORKER=1 and use your lease; they never start, renew, release or finish one (OAH_WORKER_LEASE_REFUSED).

Example

Check the start and take the lease in the worked example.

oah preflight --task hello-name
oah start --task hello-name --agent claude --packet .oah/tasks/hello-name/PACKET.md

Requirements

  • A git repository. Lease state lives in oah/ inside the repository's git folder, shared by every worktree and never shown in git status.

Limits and recovery

  • A lease cannot stop an editor from writing elsewhere; oah finish checks what happened instead.
  • A lease lasts 4 hours by default (--ttl-hours, up to 168). An expired lease shows as STALE, cannot be renewed (OAH_LEASE_EXPIRED) and is pruned by the next oah start; you can still finish or release it.
  • To widen the scope, run oah renew --task <task> --agent <agent> --scope <path> … repeating every path, or pass --allow-out-of-scope, which is recorded.
  • Using the right task with another agent's name gives OAH_LEASE_NOT_YOURS.

Original documents

Related