Repository navigation
fix(cli): wire cast/hire creation, build --watch, and memory provider errors - #2223
Conversation
… errors Closes github#2191 Closes github#2192 Closes github#2193 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5cf0811c-a02a-41a7-ab00-904b6900db7b
🛫 PR Readiness Check
PR Scope: 📦🔧 Mixed (product + infrastructure)
|
| Status | Check | Details |
|---|---|---|
| ✅ | Single commit | 1 commit — clean history |
| ✅ | Not in draft | Ready for review |
| ✅ | Branch up to date | Up to date with dev |
| ❌ | Copilot review | No Copilot review yet — it may still be processing |
| ✅ | Changeset present | Changeset file found |
| ✅ | Scope clean | No .squad/ or docs/proposals/ files |
| ✅ | No merge conflicts | No merge conflicts |
| ✅ | Copilot threads resolved | No Copilot review threads |
| ❌ | CI passing | 10 check(s) still running |
Files Changed (9 files, +650 −36)
| File | +/− |
|---|---|
.changeset/cli-stubs-cast-build-watch-memory-provider.md |
+5 −0 |
packages/squad-cli/src/cli-entry.ts |
+21 −14 |
packages/squad-cli/src/cli/commands/build.ts |
+114 −10 |
packages/squad-cli/src/cli/commands/cast.ts |
+362 −1 |
packages/squad-cli/src/cli/commands/memory.ts |
+4 −3 |
packages/squad-cli/src/cli/core/command-help.ts |
+12 −7 |
test/build-command.test.ts |
+57 −0 |
test/cli/cast.test.ts |
+47 −1 |
test/memory-governance.test.ts |
+28 −0 |
Total: +650 −36
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
🏗️ Architectural Review
Automated architectural review — informational only. |
🟡 Impact Analysis — PR #2223Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affectedroot (1 file)
squad-cli (5 files)
tests (3 files)
This report is generated automatically for every PR. See #733 for details. |
There was a problem hiding this comment.
🟡 Changes recommended
Cast creation can erase history, leave inconsistent partial state, and fail to persist supported configuration formats safely.
6 open findings
Check duplicate agents only in the Primary column · New Escape or validate roles before writing config literals · New Preserve existing history when using --force · New Validate and roll back before mutating project files · New Keep agent roles consistent across all records · New Update the active configuration source before reporting success · New
What changed in this PR
Implements three CLI fixes covering agent creation, build watch mode, and clean memory-provider errors.
Changes:
- Persists agents created through
cast/hire. - Adds live configuration rebuilding with
build --watch. - Reports unsupported native Copilot Memory through
SquadErrorand updated help.
| File | Description |
|---|---|
.changeset/cli-stubs-cast-build-watch-memory-provider.md |
Records the CLI patch. |
packages/squad-cli/src/cli-entry.ts |
Routes cast and hire creation. |
packages/squad-cli/src/cli/commands/cast.ts |
Implements agent persistence. |
packages/squad-cli/src/cli/commands/build.ts |
Implements watch mode. |
packages/squad-cli/src/cli/commands/memory.ts |
Uses SquadError for unsupported providers. |
packages/squad-cli/src/cli/core/command-help.ts |
Updates cast and memory help. |
test/cli/cast.test.ts |
Tests agent creation and validation. |
test/build-command.test.ts |
Tests initial and watched builds. |
test/memory-governance.test.ts |
Tests provider errors and help. |
Review effort: Balanced
| if (existing.includes(`| ${name} |`)) { | ||
| return; | ||
| } |
|
|
||
| const roleId = rawRole.toLowerCase().replace(/\s+/g, '-'); | ||
| const catalogRole = getRoleById(roleId); | ||
| const displayRole = catalogRole?.title ?? rawRole; |
| if (!storage.existsSync(historyPath) || options.force) { | ||
| storage.writeSync(historyPath, historyContent); | ||
| } |
|
|
||
| updateTeamMdWithAgent(squadDir, rawName, displayRole, slug); | ||
| updateRoutingMdWithAgent(squadDir, rawName, displayRole); | ||
| await updateCastingStateWithAgent(squadDir, rawName, displayRole, slug); |
| updateTeamMdWithAgent(squadDir, rawName, displayRole, slug); | ||
| updateRoutingMdWithAgent(squadDir, rawName, displayRole); | ||
| await updateCastingStateWithAgent(squadDir, rawName, displayRole, slug); | ||
| await addAgentToConfig(teamRoot, slug, displayRole); |
| updateTeamMdWithAgent(squadDir, rawName, displayRole, slug); | ||
| updateRoutingMdWithAgent(squadDir, rawName, displayRole); | ||
| await updateCastingStateWithAgent(squadDir, rawName, displayRole, slug); | ||
| await addAgentToConfig(teamRoot, slug, displayRole); |

Summary
Fixes three v1.0.1 CLI release-check findings (#2191, #2192, #2193):
unCastAdd in packages/squad-cli/src/cli/commands/cast.ts to create persisted specialist agents (.squad/agents//charter.md, history.md, .squad/team.md, .squad/routing.md, .squad/casting/registry.json, .squad/casting/history.json, .squad/casting/policy.json, squad.config.ts, and .github/agents/squad.agent.md).
Validation
Closes #2191
Closes #2192
Closes #2193