Skip to content

spawn_agent puts every Peer Agent in the caller's branch and worktree #274

Closed

Description

@Jacksondr5

spawn_agent (J5-owned, apps/server/src/j5/a2a/mcp/handlers.ts, thread.create) copies branch and worktreePath from the calling thread. Every Peer Agent therefore edits the caller's checkout, and parallel agents collide unless each one creates a worktree by hand. That's exactly what the 2026-09-24 upstream-sync builders had to be told to do.

Upstream's launch tools (t3_thread_launch, create_threads) take a workspaceStrategy (worktree / existing_worktree / root), and handle worktree setup, branch naming (pingdotgg#13294) and cleanup. J5 excludes those tools because they don't record Squadron homes.

Fix: add an optional workspace choice to spawn_agent (and Crew launch) that reuses upstream's workspace-aware launch underneath, while keeping J5's home, placement, provenance and brief rules. Decide the default. A fresh worktree is probably right for Peer Agents that write code.

Activity

  1. added
    bug
    on Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions