Skip to content

fix(cli): wire cast/hire creation, build --watch, and memory provider errors - #2223

Merged
tamirdresher merged 1 commit into
github:devfrom
tamirdresher:fix/2191-2192-2193-cli-stubs-and-memory-provider
Oct 14, 2026
Merged

tamirdresher merged 1 commit into
github:devfrom
tamirdresher:fix/2191-2192-2193-cli-stubs-and-memory-provider

Conversation

@tamirdresher

Copy link
Copy Markdown
Collaborator

Summary

Fixes three v1.0.1 CLI release-check findings (#2191, #2192, #2193):

  1. squad cast --name --role and squad hire (Bug: cast --name/--role and hire are no-op stubs but exit successfully (v1.0.1) #2191):
    • Implement
      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).
    • Fail cleanly with exit status 1 via atal() when --name or --role is missing on hire or partial cast.
  2. squad build --watch (Bug: build --watch is advertised but exits successfully without building or watching (v1.0.1) #2192):
    • Run an initial build and watch squad.config.ts / squad.config.js via s.watch, triggering debounced rebuilds with ESM cache-busting when the config file content changes.
  3. squad memory provider --provider copilot (Bug: native Copilot memory provider is unconditionally rejected despite conditional help (v1.0.1) #2193):
    • Throw SquadError instead of a generic Error when selecting native copilot persistence so the CLI exits cleanly with exit status 1 and no uncaught stack trace.
    • Align squad memory --help and command-help.ts to state that native Copilot Memory is unsupported in this release and distinguish hostInjectedCopilotAdapter.

Validation

  • Added regression tests in est/cli/cast.test.ts, est/build-command.test.ts, and est/memory-governance.test.ts.
  • Verified all 74 tests across est/cli/cast.test.ts, est/build-command.test.ts, est/memory-governance.test.ts, and est/cli/command-help.test.ts pass.

Closes #2191
Closes #2192
Closes #2193

… 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
Copilot AI balanced review requested due to automatic review settings October 14, 2026 14:36
@github-actions

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit c735112

PR Scope: 📦🔧 Mixed (product + infrastructure)

⚠️ 2 item(s) to address before review

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.

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Architectural Review

Authoritative evidence: base-controlled pull_request_target reporter.

⚠️ Architectural review: 1 warning(s).

Severity Category Finding Files
🟡 warning bootstrap-area 1 file(s) in the bootstrap area (packages/squad-cli/src/cli/core/) were modified. These files must maintain zero external dependencies. Review carefully. packages/squad-cli/src/cli/core/command-help.ts

Automated architectural review — informational only.

@github-actions

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #2223

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 9
Files added 1
Files modified 8
Files deleted 0
Modules touched 3

🎯 Risk Factors

  • 9 files changed (6-20 → MEDIUM)
  • 3 modules touched (2-4 → MEDIUM)

📦 Modules Affected

root (1 file)
  • .changeset/cli-stubs-cast-build-watch-memory-provider.md
squad-cli (5 files)
  • packages/squad-cli/src/cli-entry.ts
  • packages/squad-cli/src/cli/commands/build.ts
  • packages/squad-cli/src/cli/commands/cast.ts
  • packages/squad-cli/src/cli/commands/memory.ts
  • packages/squad-cli/src/cli/core/command-help.ts
tests (3 files)
  • test/build-command.test.ts
  • test/cli/cast.test.ts
  • test/memory-governance.test.ts

This report is generated automatically for every PR. See #733 for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Cast creation can erase history, leave inconsistent partial state, and fail to persist supported configuration formats safely.

6 open findings
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 SquadError and 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

Comment on lines +194 to +196
if (existing.includes(`| ${name} |`)) {
return;
}

const roleId = rawRole.toLowerCase().replace(/\s+/g, '-');
const catalogRole = getRoleById(roleId);
const displayRole = catalogRole?.title ?? rawRole;
Comment on lines +347 to +349
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);
Comment on lines +351 to +354
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);
@tamirdresher
tamirdresher merged commit f677a01 into github:dev Oct 14, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants