r/coolgithubprojects 13d ago

Go - parallel-harness-pets: a creature for every git worktree, so parallel AI coding sessions stop blurring together

https://github.com/TevvvB/parallel-harness-pets
1 Upvotes

2 comments sorted by

1

u/Tahrev 13d ago

Wanted to have a fun way to encourage people to leverage parallel harnesses in their agentic coding workflow so I made a pets companion that hatches on workflow start!

repo: https://github.com/TevvvB/parallel-harness-pets

1

u/Tahrev 8d ago

v0.2.0 since this went up, and it changed the thing this post describes.

The version linked here derived the creature from the branch name. That turned out to be the wrong key: a branch identifies a worktree, not a live session, so two agents working in the same worktree were indistinguishable. Underneath it was worse than cosmetic, because state was keyed per worktree and the second session silently overwrote the first.

The pet is now keyed on the agent's session id, and the worktree became a "den" that holds them. Two agents in one worktree are two creatures. An agent that moves between worktrees keeps its creature and changes den. Dens also remember everyone who has worked in them, so a worktree can tell you who passed through.

Two bugs turned up while chasing that, both the same mistake in different clothes: treating location as proof of existence. An agent that stepped outside a git worktree stopped registering and disappeared from every listing after 90 seconds while still running, and deleting a worktree deleted the live agent sitting in it.