Skip to content

bug: getPersonalSquadRoot() resolves to wrong directory, causing squad consult to skip personal agents #590

Closed

Description

@dat-intellis

Summary

When running squad consult on any project repo, the coordinator enters Init Mode even though a personal squad exists. The root cause is that getPersonalSquadRoot() in packages/squad-sdk/src/resolution.ts hardcodes .squad as the subdirectory path, resolving to the wrong location.

Environment

  • squad-cli: v0.9.1 (latest)
  • OS: macOS
  • Personal squad location: ~/Library/Application Support/squad/personal-squad/

Steps to Reproduce

  1. Set up a personal squad at the default location (e.g. ~/Library/Application Support/squad/personal-squad/)
  2. In a new project repo, run squad consult
  3. Observe that the coordinator enters Init Mode — personal agents are not discovered

Root Cause

getPersonalSquadRoot() resolves the personal squad dir by appending .squad to the global squad directory:

~/Library/Application Support/squad/.squad        ← what it resolves to (empty)
~/Library/Application Support/squad/personal-squad  ← where agents actually live

This means squad consult copies the wrong teamRoot into the project's .squad/config.json:

{
  "teamRoot": "/Users/home/Library/Application Support/squad/.squad",   // ← wrong
  "sourceSquad": "/Users/home/Library/Application Support/squad/.squad" // ← wrong
}

Both fields should point to personal-squad instead of .squad.

Impact

  • .squad/team.md is copied from the wrong (empty) source → ## Members table has no entries
  • Coordinator enters Init Mode and proposes a new team, discarding the user's personal agents
  • Personal agents are completely invisible to the coordinator on every new repo

Workaround

Manually fix after every squad consult on a new repo:

# 1. Edit .squad/config.json — change teamRoot and sourceSquad:
#    from: .../squad/.squad
#    to:   .../squad/personal-squad

# 2. Copy team.md from the correct source
cp "$HOME/Library/Application Support/squad/personal-squad/team.md" .squad/team.md

Related: --team-root flag (v0.9.1)

The new --team-root flag in packages/squad-cli/src/cli-entry.ts appears intended to address this class of problem. It strips the flag and writes to process.env['SQUAD_TEAM_ROOT'], but SQUAD_TEAM_ROOT is never read anywhere in the SDK. The flag is currently dead scaffolding — once wired up, it could serve as a manual escape hatch for this bug while the resolution logic is fixed.

Expected Behaviour

squad consult should detect the personal squad at personal-squad/ and write the correct teamRoot into config.json, so the coordinator immediately enters Team Mode with the user's existing agents.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions