Locking
Section titled “Locking”vteam uses advisory file locking via atomic mkdir (POSIX guarantees this is atomic). Each lock directory contains an info.json with the holding PID and timestamp.
- Stale detection: A lock is considered stale only if the holding process is dead (checked via
kill -0), so a long run keeps its lock however long it takes. A lock directory without its info file (a crash right aftermkdir) is stale after 30 minutes. Stale locks are renamed aside and checked again before being deleted, and a process only releases a lock it still owns. - Not distributed: Locks are local to the filesystem. If you run vteam from multiple machines against the same repo (e.g., via NFS), locks won’t protect against concurrent runs.
- Crash recovery: If vteam crashes while holding a lock, the lock may persist. The next run or
vteam cleanbreaks it once the holding process is dead. - Same agent concurrency: Two runs of the same agent are serialized by the lock. Different agents (improver + coder) can run concurrently.
- Task claiming: Picking a task (list → select → set
active) runs underlocks/task-claim.lockin the project’s state directory, shared by all agents, so two agents with overlappingtaskFilters never get the same task. The lock is held only while picking, not for the whole run. Like every lock it is local: agents on different machines syncing one aven database can still race.
Worktrees
Section titled “Worktrees”- Isolation: Agents with
worktree: truework in a git worktree under the state directory, branched fromorigin/<baseBranch>. Your main working tree is never touched. - Crash cleanup: If the coder crashes after creating a worktree but before cleanup, the worktree and its branch persist. Run
vteam cleanto remove orphans. - Stale branches: Task branch names include the run ID (
vteam/<title-slug>-<runId>), so a retried task never reuses an earlier attempt’s branch. If a local branch with the same name exists, it is deleted before a new worktree is created. - Pushing: vteam pushes with
--force-with-leaseagainst the commit it started from. A new branch must not exist on the remote yet. A PR branch must still be where vteam checked it out, so if someone pushes to the PR while the coder runs, the push is rejected instead of overwriting their commits, and the task goes back totodo. Network errors (connection reset, broken pipe, remote hung up, timeouts) are retried twice, after 5s and 15s. Before each retry vteam checks whether the dropped push actually reached the remote. - Disk space: Each worktree is a full checkout. On large repos, this can be significant. Worktrees are cleaned up after each run.
PR creation
Section titled “PR creation”- Requires
gh(GitHub) orglab(GitLab) CLI installed and authenticated. - If the CLI is missing, the branch is still pushed; you just need to create the PR manually.
- Labels are auto-created in the repository if they don’t already exist.
- Set
"autoPR": falsein the agent’sagent.jsonto skip PR creation entirely.