Skip to content

ops: ephemeral task-scoped dev agents with worktree isolation#17

Merged
benvinegar merged 1 commit intomainfrom
ops/ephemeral-dev-agents
Feb 17, 2026
Merged

ops: ephemeral task-scoped dev agents with worktree isolation#17
benvinegar merged 1 commit intomainfrom
ops/ephemeral-dev-agents

Conversation

@baudbot-agent
Copy link
Copy Markdown
Collaborator

What changed

Major architecture change to how dev agents work.

Before

  • One persistent dev-agent session, long-lived, receives all tasks serially
  • Dev agent creates its own worktrees and cleans them up
  • Single agent for all repos

After

  • Ephemeral, task-scoped dev agents — spun up per task, cleaned up when done
  • Named by repo + todo: dev-agent-<repo>-<todo-short> (e.g. dev-agent-modem-a8b7b331)
  • Start in the worktree: control agent creates the worktree first, then launches pi with CWD = worktree root. This means pi auto-discovers project context from the repo.
  • Worktree isolation: multiple agents can work on the same repo simultaneously (separate branches/worktrees)
  • Max 4 concurrent dev agents
  • Multi-repo tasks: one agent per repo, coordinated sequentially or in parallel by the control agent
  • Control agent owns lifecycle: creates worktree → spawns agent → collects results → kills session → removes worktree
  • No persistent dev-agent at startup — all on-demand
  • Sentry agent unchanged (stays persistent)

Why

  • Better project context loading (agent starts in the repo, reads CODEX.md naturally)
  • Parallel work on multiple tasks
  • Clean isolation between tasks (no stale context carryover)
  • Two agents can work on the same repo without conflicts
  • Simpler mental model: task in, agent up, work done, agent gone

Major architecture change to dev agents:

- Dev agents are now ephemeral and task-scoped (spun up per task, cleaned up when done)
- Each agent starts in a git worktree for its target repo, getting project context from CWD
- Named dev-agent-<repo>-<todo-id> for tracking (e.g. dev-agent-modem-a8b7b331)
- Control agent creates worktree before spawning, cleans up after completion
- Multiple dev agents can work on the same repo via separate worktrees
- Max 4 concurrent dev agents
- Multi-repo tasks spawn one agent per repo (sequential or parallel)
- No persistent dev-agent session at startup — all on-demand
- Sentry agent remains persistent (unchanged)
@benvinegar benvinegar merged commit e5dcb3e into main Feb 17, 2026
8 checks passed
benvinegar pushed a commit that referenced this pull request Feb 17, 2026
Co-authored-by: hornet-fw <hornet-fw@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants