Skip to content

fix: resolve Windows workspace launcher shims - #2545

Merged
tamirdresher merged 4 commits into
devfrom
squad/2538-codeql-workflows
Nov 19, 2026
Merged

tamirdresher merged 4 commits into
devfrom
squad/2538-codeql-workflows

Conversation

@tamirdresher

Copy link
Copy Markdown
Collaborator

What

Fix Windows workspace-local Squad and npx shim resolution in both the generated repository launcher and the Claude plugin launcher.

Why

Closes #2544. A workspace .bin\squad.cmd was incorrectly resolved beneath .bin\node_modules, preventing the squad_state bridge and squad doctor from starting.

How

Resolve .bin shims against their sibling packages while retaining global npm layout and shell-free argument forwarding. Regenerate the plugin and cover PATH, explicit shim, outdated CLI fallback, npx, and argument preservation.


⚠️ Quick Check

  • If SDK/CLI source files changed: completed the applicable Changeset step below (npx changeset add / .changeset/*.md, direct CHANGELOG.md entry for maintainers, or skip-changelog label for no user-facing changes)

PR Readiness Checklist

The PR readiness bot will validate these automatically after push.
Check each item before requesting review. See CONTRIBUTING.md for full details.

Branch & Commit

  • Branch created from dev (not main)
  • Branch is up to date with dev (git fetch upstream && git rebase upstream/dev)
  • Verified diff contains only intended changes (git diff --cached --stat)
  • PR is not in draft mode (mark ready when checks pass)
  • Commit history is clean (squash fixups before review)

Build & Test

  • npm run build passes
  • npm test passes (all tests green)
  • npm run lint passes (type check clean)
  • npm run lint:eslint passes
  • For migration PRs (>20 files): include test output summary in PR description

Windows x64, Node 26:

  • $env:SKIP_BUILD_BUMP='1'; npm run build: passed.
  • npx vitest run test\launcher-argv.test.ts test\portable-launch.test.ts test\claude-plugin.test.ts test\ux-gates.test.ts test\acceptance\hostile.test.ts: passed, 79 passed, 6 skipped, 2 todo.
  • npx vitest run test\launcher-argv.test.ts: passed, 9 tests, including the added explicit-shim case.
  • npx vitest run test\cli\upgrade-portability.test.ts test\cli\init-upgrade-parity.test.ts --testTimeout 60000 --no-file-parallelism --silent: passed, 30 tests. The initial default-timeout run timed out on this Windows machine.
  • npm run lint: passed.
  • npx eslint packages\squad-sdk\src\client\adapters\claude-plugin.ts test\launcher-argv.test.ts: passed with 5 pre-existing warnings, no errors.
  • node scripts\build-claude-plugin.mjs --check: passed.

An isolated fresh init and an upgrade from a deliberately broken old managed launcher both passed the 15-tool squad_state doctor probe with a workspace shim on PATH, while preserving a user file.

Changeset

  • Changeset added via npx changeset add (if packages/squad-sdk/src/ or packages/squad-cli/src/ changed)
  • Or direct CHANGELOG.md entry (maintainers only — write-protected for external contributors)
  • Or skip-changelog label applied (if no user-facing changes)

Docs

  • README section updated (if new feature/module)
  • Docs feature page (if new user-facing capability)

No new capability or setup instructions; this repairs existing behavior.

Exports

  • package.json subpath exports updated (if new module)

N/A: no new modules or exports.


Breaking Changes

None.

Waivers

Full npm test and full npm run lint:eslint were not run locally; CI validation is pending. No waiver requested.

tamirdresher and others added 3 commits November 19, 2026 19:10
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Closes #2544

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI adaptive review requested due to automatic review settings November 19, 2026 17:21
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #2545

Risk tier: 🟡 MEDIUM

📊 Summary

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

🎯 Risk Factors

  • 4 files changed (≤5 → LOW)
  • 3 modules touched (2-4 → MEDIUM)

📦 Modules Affected

root (2 files)
  • .changeset/fix-windows-workspace-shim.md
  • plugins/squad/scripts/squad.mjs
squad-sdk (1 file)
  • packages/squad-sdk/src/client/adapters/claude-plugin.ts
tests (1 file)
  • test/launcher-argv.test.ts

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

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

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

PR Scope: 📦🔧 Mixed (product + infrastructure)

⚠️ 3 item(s) to address before review

Status Check Details
❌ Single commit 4 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 1 check(s) still running

Files Changed (4 files, +62 −6)

File +/−
.changeset/fix-windows-workspace-shim.md +6 −0
packages/squad-sdk/src/client/adapters/claude-plugin.ts +3 −2
plugins/squad/scripts/squad.mjs +3 −2
test/launcher-argv.test.ts +50 −2

Total: +62 −6


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements 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.

🟢 Approval recommended

No active review issues were identified for the Windows workspace-local shim resolution changes.

No open issues 🎉

What changed in this PR

Fixes Windows workspace-local shim resolution for the generated repository launcher and Claude plugin, addressing #2544 while preserving shell-free argument forwarding and global npm support.

Changes:

  • Resolves Squad and npx shims in node_modules/.bin to sibling package entry points.
  • Adds Windows regression coverage for PATH discovery, explicit shims, outdated CLI fallback, npx, and argument preservation.
  • Regenerates the plugin launcher and adds patch changesets for the CLI and SDK.
File Description
test/​launcher-argv.test.ts Adds workspace shim resolution and argument-preservation tests.
plugins/​squad/​scripts/​squad.mjs Updates the generated plugin launcher’s shim resolution.
packages/​squad-sdk/​src/​client/​adapters/​claude-plugin.ts Corrects workspace package paths in the launcher generator.
.changeset/​fix-windows-workspace-shim.md Records CLI and SDK patch releases for the fix.

Review effort: Balanced (adaptive)

Closes #2544

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@tamirdresher
tamirdresher merged commit 185b08c into dev Nov 19, 2026
33 checks passed
@tamirdresher
tamirdresher deleted the squad/2538-codeql-workflows branch November 19, 2026 17:48
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.

Windows workspace npm shims break the squad_state launcher

2 participants