Skip to content

fix(cli,sdk): warn when squad.agent.md template is missing during upgrade/init#762

Merged
diberry merged 3 commits intodevfrom
squad/730-fix-silent-agent-md-skip
Apr 3, 2026
Merged

fix(cli,sdk): warn when squad.agent.md template is missing during upgrade/init#762
diberry merged 3 commits intodevfrom
squad/730-fix-silent-agent-md-skip

Conversation

@diberry
Copy link
Copy Markdown
Collaborator

@diberry diberry commented Apr 2, 2026

Closes #730

What

  • upgrade.ts: Add warning when template source missing in version-current path
  • init.ts: Track template-missing warning in structured return data (new \warnings\ field on \InitResult)
  • Tests: Happy-path regression guard + missing-template warning test

Why

2 code paths silently skip squad.agent.md creation when the template source is missing. Users lose their coordinator instructions with no warning.

Changes

File Change
\packages/squad-cli/src/cli/core/upgrade.ts\ Add \�lse { warn(...) }\ to version-current path
\packages/squad-sdk/src/config/init.ts\ Add \warnings: string[]\ to \InitResult, track missing template
\ est/cli/upgrade.test.ts\ Happy-path regression: verify squad.agent.md refreshed in version-current path
\ est/init-scaffolding.test.ts\ Happy-path + missing-template warning via proxy storage
.changeset/fix-silent-agent-md-skip.md\ Patch changeset for both packages

Working as EECOM (Core Dev)

@diberry diberry force-pushed the squad/730-fix-silent-agent-md-skip branch from e06d1d4 to ec9a1fb Compare April 2, 2026 21:43
@diberry diberry marked this pull request as ready for review April 2, 2026 21:47
Copilot AI review requested due to automatic review settings April 2, 2026 21:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a silent failure mode where .github/agents/squad.agent.md is not created/refreshed during squad init or squad upgrade when the squad.agent.md.template source is missing, by surfacing explicit warnings and adding regression tests.

Changes:

  • CLI: warn in the upgrade “already current version” path when squad.agent.md.template is missing.
  • SDK: extend InitResult with a warnings array and record a warning when the agent template is missing during initSquad.
  • Tests: add regression coverage for the version-current upgrade refresh and init missing-template warning behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/squad-cli/src/cli/core/upgrade.ts Adds a warning when the template is missing in the “already current” upgrade path.
packages/squad-sdk/src/config/init.ts Adds warnings: string[] to InitResult and pushes a warning when the agent template is missing.
test/cli/upgrade.test.ts Adds a regression test ensuring squad.agent.md is refreshed even when already current.
test/init-scaffolding.test.ts Adds tests for happy-path creation and missing-template warning behavior in initSquad.
.changeset/fix-silent-agent-md-skip.md Declares patch releases for CLI and SDK and describes the warning + new result field.

Comment thread packages/squad-sdk/src/config/init.ts Outdated
Comment thread packages/squad-cli/src/cli/core/upgrade.ts Outdated
Comment thread packages/squad-sdk/src/config/init.ts
Comment thread .changeset/fix-silent-agent-md-skip.md
diberry and others added 2 commits April 2, 2026 15:23
…rade/init

Closes #730

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry diberry force-pushed the squad/730-fix-silent-agent-md-skip branch from f1481e8 to a9a0960 Compare April 2, 2026 22:24
diberry added a commit that referenced this pull request Apr 2, 2026
Captures the full Copilot PR reviewer comment pipeline learned across
PRs #756, #760, #762: reading reviews, critical evaluation, lockout-aware
routing, GraphQL thread resolution, and CI verification.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tamirdresher
Copy link
Copy Markdown
Collaborator

Nice catch Dina. This is a real bug - users silently losing their coordinator instructions is bad. Clean fix, good tests.

One small thing: the PR description has a Unicode rendering glitch - \�lse { warn(...) } should be else { warn(...) }. Mind fixing the description text?

Other than that, LGTM. Merging this first.

Also did a quick compare with how microsoft/aspire handles similar stuff - they use a PR template with checkboxes but don't have automated validation like this. We're ahead here.

Copy link
Copy Markdown
Collaborator

@tamirdresher tamirdresher left a comment

Choose a reason for hiding this comment

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

Approved. Merge first in the batch.

@diberry diberry merged commit 27f07cf into dev Apr 3, 2026
11 checks passed
@diberry diberry deleted the squad/730-fix-silent-agent-md-skip branch April 3, 2026 13:13
diberry added a commit that referenced this pull request Apr 3, 2026
…rade/init (#762)

* fix(cli,sdk): warn when squad.agent.md template is missing during upgrade/init

Closes #730

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: make InitResult.warnings optional, improve warning messages

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: squad.agent.md silently disappears after upgrade when template source is missing

3 participants