Skip to content

fix: hard-fail on Node <22.5.0 with clear message (#502)#506

Merged
bradygaster merged 4 commits intodevfrom
squad/502-node-sqlite-dependency
Mar 22, 2026
Merged

fix: hard-fail on Node <22.5.0 with clear message (#502)#506
bradygaster merged 4 commits intodevfrom
squad/502-node-sqlite-dependency

Conversation

@bradygaster
Copy link
Copy Markdown
Owner

Summary

Fixes #502 — workshop participants on Node <22.5.0 received a cryptic \ERR_UNKNOWN_BUILTIN_MODULE\ crash when the Copilot SDK tried to use
ode:sqlite.

What changed

1. Startup hard-fail (cli-entry.ts)

Replaced the soft warn-and-continue approach with an immediate \process.exit(1)\ and a clear, actionable message:
\
✗ Squad requires Node.js ≥22.5.0 (you have v20.18.0).
node:sqlite (required by the Copilot SDK for session storage) was added in Node 22.5.0.
Upgrade at: https://nodejs.org/en/download
\
Removed the now-redundant \checkNodeSqlite()\ function and its call site.

2. Squad doctor check (doctor.ts)

Added \checkNodeVersion()\ to \squad doctor\ diagnostics — users can proactively detect the gap with \squad doctor.

3. Engines field (package.json × 3)

Corrected \�ngines.node\ from >=20\ to >=22.5.0\ in all three package.json files. npm/npx will now warn at install time if Node version is insufficient.

4. Tests (doctor.test.ts)

  • 5 new tests covering \checkNodeVersion\ pass/fail paths (Node 20.x, 22.4.x, 22.5.0, 24.x)
  • Updated check-count assertion

Priority

P1 — workshop blocker (reported by Doron Ben Elazar)

Working as EECOM (Core Dev)

bradygaster and others added 4 commits March 22, 2026 02:43
- Add .squad/skills/economy-mode/SKILL.md: Layer 3 cost modifier
  - Economy table shifts code tasks to gpt-4.1/gpt-5-mini, arch to sonnet
  - Activation: session phrase, config.json economyMode:true, or --economy flag
  - Layer 0/1/2 (user intent) always overrides economy mode
  - 💰 indicator in spawn acknowledgments
  - Confidence: low (first implementation)

- Add .squad/decisions/inbox/procedures-economy-mode-governance.md
  - Draft additions to squad.agent.md for Flight review
  - Economy mode paragraph after Layer 0, updated table, 💰 convention
  - Valid models catalog audit findings (claude-sonnet-4.6 missing, etc.)

- Add .squad/decisions/inbox/procedures-personal-squad-governance.md
  - Five gap analysis: Init Mode, consult mode detection, TEAM_ROOT semantics,
    charter templates, missing consult-mode skill
  - Proposed CONSULT_MODE spawn signal and 🧳 acknowledgment format
  - Proposed new consult-mode skill (post-governance-approval)

- Update procedures history.md with learnings

Closes #500
References #344

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add economy mode that shifts model selection to cheaper alternatives
at Layer 3 (task-aware auto) and Layer 4 (default). Explicit user
preferences at Layers 0-2 are never overridden.

SDK changes:
- Add ECONOMY_MODEL_MAP and applyEconomyMode() to config/models.ts
- Add readEconomyMode() / writeEconomyMode() for config.json persistence
- Update resolveModel() in config/models.ts with economyMode option
- Update resolveModel() in agents/model-selector.ts with economyMode option

CLI changes:
- Add 'squad economy [on|off]' command for persistent toggle
- Add --economy global flag for session-level activation (SQUAD_ECONOMY_MODE=1)

Tests:
- 34 new tests in test/economy-mode.test.ts (all passing)

Economy model table:
  claude-opus-4.6   -> claude-sonnet-4.5 (architecture/review)
  claude-sonnet-4.6 -> gpt-4.1           (code writing)
  claude-haiku-4.5  -> gpt-4.1           (docs/mechanical)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Merged 9 inbox decisions → decisions.md (personal squad impl plan, economy mode design/governance, persistent model preference, user directives, template sync, ESM fix)
- Deleted inbox files (merge complete)
- Updated agent histories: Flight (personal squad plan), EECOM (economy mode), Procedures (governance proposals)
- Appended team updates to agent contexts

Fleet Status:
- Flight: Personal squad design validated, 19-task plan across 4 PRs (MVP = PR #1+3)
- EECOM: Economy mode complete (34 tests), PR #504 open
- Procedures: Economy + consult-mode governance drafted, PR #503 open
- Directives: #464 rate limit UX (soft dep #500), #502 bug P1 next-up, triage includes discussions

Ready for execution: EECOM Phase 1, Procedures Phase 3 (concurrent).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
node:sqlite (required by the Copilot SDK for session storage) was added
in Node 22.5.0. Previously Squad only warned and continued, leading to
cryptic ERR_UNKNOWN_BUILTIN_MODULE crashes later.

Changes:
- cli-entry.ts: replace soft warn+continue with hard process.exit(1) and
  a clear upgrade message when Node <22.5.0 is detected at startup.
  Remove now-redundant checkNodeSqlite() function and its call site.
- doctor.ts: add checkNodeVersion() check to squad doctor diagnostics
  so users can detect the version gap proactively.
- package.json (root, squad-cli, squad-sdk): correct engines field from
  >=20 to >=22.5.0, enabling npm/npx to warn at install time.
- test/cli/doctor.test.ts: add 5 tests for checkNodeVersion pass/fail
  paths; update check-count assertion.

Closes #502

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster bradygaster merged commit b741222 into dev Mar 22, 2026
0 of 2 checks passed
@bradygaster bradygaster deleted the squad/502-node-sqlite-dependency branch March 22, 2026 10:17
bradygaster added a commit that referenced this pull request Mar 22, 2026
Orchestration log for 2026-03-22 session covering:
- #500 economy mode (PR #504)
- #502 node:sqlite fix (PR #506)
- #464 rate limit UX (PR #505)
- #500/#344 governance (PR #503)
- #329/#344 architecture plan (Flight, no PR yet)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
chrislomonico pushed a commit to clomonico/squad that referenced this pull request Mar 26, 2026
)

Suppresses raw coordinator JSON from UI during routing, keeping the ThinkingIndicator visible.

Closes bradygaster#506

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.

bug: Installer missing node:sqlite dependency

1 participant