Skip to content

cast uses wrong base path for LocalAgentSource in local mode #871

Closed

Description

@KenKilty

Bug

cast reports No agents found in current session cast. in local mode even when project agents exist on disk and the interactive shell is already showing them.

Environment

  • @bradygaster/squad-cli: 0.9.4-insider.1
  • @bradygaster/squad-sdk: 0.9.1
  • @github/copilot-sdk: 0.2.1 (overridden locally to work around the known startup/import issue)
  • OS: WSL2 Ubuntu / Linux
  • Node: v22.22.1
  • npm: 10.9.4

Repro

  1. Initialize a local squad repo.
  2. Ensure there is at least one project agent directory under .squad/agents/<name>/charter.md.
  3. Ensure team.md has at least one row under ## Members.
  4. Run:
npm exec squad -- cast

Actual

cast prints:

No agents found in current session cast.

Expected

cast should list the project agents discovered from .squad/agents/.

Why this looks like a real bug

In the same repo and same install:

  • squad doctor sees the agents directory and passes health checks
  • the interactive shell starts successfully
  • the shell header shows a real project agent, e.g. Lead [IDLE]

So the project agent files exist and are visible to other parts of the runtime.

Root Cause

The local cast command appears to pass the wrong base path into LocalAgentSource.

In the published CLI:

  • dist/cli/commands/cast.js does:
const paths = resolveSquadPaths(cwd);
const projectSource = new LocalAgentSource(paths.teamDir);

But LocalAgentSource itself appends .squad/agents when resolving local agents:

const AGENT_DIRS = ['.squad/agents', '.ai-team/agents'];

In local mode, resolveSquadPaths(cwd).teamDir is already the .squad directory, so LocalAgentSource(paths.teamDir) ends up looking under:

.squad/.squad/agents

which is wrong.

Direct proof

Running this in the affected repo:

const paths = resolveSquadPaths(process.cwd());
console.log(paths.teamDir);

const fromTeamDir = new LocalAgentSource(paths.teamDir);
const fromRepoRoot = new LocalAgentSource(process.cwd());

console.log(await fromTeamDir.listAgents());
console.log(await fromRepoRoot.listAgents());

produced:

  • paths.teamDir = /tmp/.../.squad
  • fromTeamDir.listAgents() = []
  • fromRepoRoot.listAgents() = [ lead, ralph, scribe ]

Local workaround

Patching the cast command to use cwd instead of paths.teamDir fixes the command locally:

const projectSource = new LocalAgentSource(cwd);

After that patch, cast correctly listed the project agents.

Suggested fix

Change the local project-agent discovery in cast to use the repo root cwd instead of paths.teamDir, or otherwise pass a base path that LocalAgentSource expects.

Activity

  1. added 2 commits that reference this issue on Apr 7, 2026
    6392209
    c2738a2
  2. added
    bugSomething isn't working
    squadSquad triage inbox — Lead will assign to a member
    on Apr 8, 2026
  3. github-actions commented on Apr 8, 2026

    @github-actions
    Contributor

    🏗️ Squad Triage — Flight (Lead)

    Issue: #871 — cast uses wrong base path for LocalAgentSource in local mode
    Assigned to: FIDO (Quality Owner)
    Reason: Issue relates to testing/quality work

    @copilot evaluation: No strong capability match — routed to squad member.

    Team roster:

    • Flight (Lead) → label: squad:flight
    • Procedures (Prompt Engineer) → label: squad:procedures
    • EECOM (Core Dev) → label: squad:eecom
    • FIDO (Quality Owner) → label: squad:fido
    • PAO (DevRel) → label: squad:pao
    • CAPCOM (SDK Expert) → label: squad:capcom
    • CONTROL (TypeScript Engineer) → label: squad:control
    • Surgeon (Release Manager) → label: squad:surgeon
    • Booster (CI/CD Engineer) → label: squad:booster
    • GNC (Node.js Runtime) → label: squad:gnc
    • Network (Distribution) → label: squad:network
    • RETRO (Security) → label: squad:retro
    • INCO (CLI UX & Visual Design) → label: squad:inco
    • GUIDO (VS Code Extension) → label: squad:guido
    • Telemetry (Aspire & Observability) → label: squad:telemetry
    • VOX (REPL & Interactive Shell) → label: squad:vox
    • DSKY (TUI Engineer) → label: squad:dsky
    • Sims (E2E Test Engineer) → label: squad:sims
    • Handbook (SDK Usability) → label: squad:handbook
    • Ralph (Work Monitor) → label: squad:ralph
    • @copilot (Coding Agent) → label: squad:copilot

    To reassign, remove the current squad:* label and add the correct one.

  4. added a commit that references this issue on Apr 13, 2026
    289f986
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

    bugSomething isn't workinggo:needs-researchNeeds investigationsquadSquad triage inbox — Lead will assign to a member

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions