Skip to main content

Module locks

Module locks 

Source
Expand description

Lock coordinates for the per-agent lockfiles.

Two families, both under the per-state locks root and both held through objectiveai_sdk::lockfile (contents are always empty — these locks carry liveness, not data):

  • Per-instance: <state>/locks/agents/instances/<…> — the agent_instance_hierarchy is split on /; every segment but the last becomes a literal subdirectory, the last segment is the lockfile key (the SDK escapes the key; directory segments ride raw). A held instance lock ⇔ a live process owns that agent.
  • Per-tag: <state>/locks/agents/tags keyed by the tag name — held while a spawn is materializing an un-upgraded (GROUPED) tag, released once the spawn claims its minted AIH lock.

No create_dir_all here — the SDK’s acquire functions create the directory chain themselves.

Functions§

agent_instance_lock
(lock_dir, key) for an agent_instance_hierarchy.
agent_tag_lock
(lock_dir, key) for an agent tag.