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.md has at least one row under ## Members.
- Run:
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:
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.
Bug
castreportsNo 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)v22.22.110.9.4Repro
.squad/agents/<name>/charter.md.team.mdhas at least one row under## Members.npm exec squad -- castActual
castprints:Expected
castshould 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 checksLead [IDLE]So the project agent files exist and are visible to other parts of the runtime.
Root Cause
The local
castcommand appears to pass the wrong base path intoLocalAgentSource.In the published CLI:
dist/cli/commands/cast.jsdoes:But
LocalAgentSourceitself appends.squad/agentswhen resolving local agents:In local mode,
resolveSquadPaths(cwd).teamDiris already the.squaddirectory, soLocalAgentSource(paths.teamDir)ends up looking under:which is wrong.
Direct proof
Running this in the affected repo:
produced:
paths.teamDir = /tmp/.../.squadfromTeamDir.listAgents() = []fromRepoRoot.listAgents() = [ lead, ralph, scribe ]Local workaround
Patching the cast command to use
cwdinstead ofpaths.teamDirfixes the command locally:After that patch,
castcorrectly listed the project agents.Suggested fix
Change the local project-agent discovery in
castto use the repo rootcwdinstead ofpaths.teamDir, or otherwise pass a base path thatLocalAgentSourceexpects.