Description
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
- Initialize a local squad repo.
- Ensure there is at least one project agent directory under
.squad/agents/<name>/charter.md. - Ensure
team.mdhas at least one row under## Members. - Run:
npm exec squad -- castActual
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 doctorsees 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.jsdoes:
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/.../.squadfromTeamDir.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
fix(cast): pass repo root to LocalAgentSource instead of .squad/ dir
fix(cast): pass repo root to LocalAgentSource instead of .squad/ dir
github-actions commentedon Apr 8, 2026
🏗️ 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:
squad:flightsquad:proceduressquad:eecomsquad:fidosquad:paosquad:capcomsquad:controlsquad:surgeonsquad:boostersquad:gncsquad:networksquad:retrosquad:incosquad:guidosquad:telemetrysquad:voxsquad:dskysquad:simssquad:handbooksquad:ralphsquad:copilotfix(cast): pass repo root to LocalAgentSource instead of .squad/ dir