Repository navigation
fix(cli): squad doctor validates state files against resolved team root in remote mode - #2057
Merged
tamirdresher merged 6 commits intoOct 2, 2026
Conversation
…emote mode squad doctor detected the remote teamRoot correctly but then ran the team.md/routing.md/agents/casting/decisions checks against the local .squad/ stub instead of the resolved team root's .squad/, producing false 'file not found' failures for linked projects even though squad status and squad cast resolved the team fine. runDoctor() now uses effectiveSquadDir() (the same dual-root resolver already used by build/copilot/export/loop/plugin/watch) to compute the state dir, so it follows the remote teamRoot the same way the rest of the CLI does. Fixes github#2056. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
🛫 PR Readiness Check
PR Scope: 📦🔧 Mixed (product + infrastructure)
|
| Status | Check | Details |
|---|---|---|
| ❌ | Single commit | 6 commits — consider squashing before review |
| ✅ | 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 | 5 check(s) still running |
Files Changed (3 files, +44 −3)
| File | +/− |
|---|---|
.changeset/2056-doctor-remote-state-dir.md |
+5 −0 |
packages/squad-cli/src/cli/commands/doctor.ts |
+6 −3 |
test/cli/doctor.test.ts |
+33 −0 |
Total: +44 −3
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
Contributor
🟡 Impact Analysis — PR #2057Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affectedroot (1 file)
squad-cli (1 file)
tests (1 file)
This report is generated automatically for every PR. See #733 for details. |
ashtewari
marked this pull request as ready for review
September 19, 2026 11:36
ashtewari
requested review from
bradygaster and
tamirdresher
as code owners
September 19, 2026 11:36
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused resolver change and regression test address the reported remote-mode failure.
Review effort: Lite
Findings: None
What changed in this PR
Updates squad doctor to validate remote-mode state files from the resolved team root.
Changes:
- Uses
effectiveSquadDir()for state resolution. - Adds a remote-mode regression test.
- Adds the CLI changeset.
| File | Description |
|---|---|
doctor.ts |
Resolves state files against the effective team root. |
doctor.test.ts |
Covers linked-project validation. |
.changeset/2056-doctor-remote-state-dir.md |
Documents the CLI patch. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…r-remote-state-dir # Conflicts: # packages/squad-cli/src/cli/commands/doctor.ts
11 of 17 tasks
…b#2119 github#2119 introduced a richer, shared resolveSquadPaths-based resolution utility in effective-squad-dir.ts. github#2057's remote-mode doctor fix already targeted the resulting effectiveSquadDir() combined helper (local + stateDir), so the only real conflict was the import line switching from the module's standalone resolveStateDir export to effectiveSquadDir; the call site and both PRs' new tests merge cleanly side by side with no semantic overlap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2056
Problem
squad doctor correctly resolves the remote \ eamRoot\ for linked (dual-root) projects ([PASS] team root resolves), but then ran the \ eam.md/
outing.md/\�gents//\casting/registry.json/\decisions.md\ checks against the local .squad/\ directory instead of the resolved team root's .squad/. For a linked project whose local .squad/\ only contains \config.json, this produced false 'file not found' failures even though \squad status\ and \squad cast\ resolve and read the shared team correctly.
Fix
unDoctor()\ now resolves the state directory via \�ffectiveSquadDir()\ (\packages/squad-cli/src/cli/core/effective-squad-dir.ts) instead of calling
esolveStateDir(squadDir)\ directly on the local squad dir. \�ffectiveSquadDir()\ already implements the dual-root resolution used by \�uild, \copilot, \�xport, \loop, \plugin, and \watch\ — it follows \config.json's \ eamRoot\ via
esolveSquadPaths()\ in remote mode, and falls back to the local .squad/\ (with externalized-state support) otherwise. This makes \doctor\ consistent with how the rest of the CLI already resolves state in remote mode.
Testing
pm run build,
pm run lint, and
px vitest run test/cli/doctor.test.ts test/effective-squad-dir.test.ts\ pass (two unrelated tests in the full suite occasionally hit the 5s default timeout spawning \git/\copilot\ child processes on this machine — confirmed pre-existing/flaky and unaffected by this change; the remote-mode tests pass consistently in isolation).