Skip to content

fix(ci): null check in loadFocusPrompt + update E2E squad fixture — fixes #715#723

Merged
agents-squads[bot] merged 2 commits intodevelopfrom
fix/issue-715
Apr 2, 2026
Merged

fix(ci): null check in loadFocusPrompt + update E2E squad fixture — fixes #715#723
agents-squads[bot] merged 2 commits intodevelopfrom
fix/issue-715

Conversation

@agents-squads
Copy link
Copy Markdown
Contributor

@agents-squads agents-squads bot commented Apr 2, 2026

Summary

  • Failure 1 fixed: loadFocusPrompt in src/lib/workflow.ts now guards against undefined returned by the readFileSync mock when existsSync returns true. Added if (!content) return '' check before .match(). Fixes all 5 failing test/lib/workflow.test.ts tests.
  • Failure 2 fixed: test/e2e/first-run.e2e.test.ts Step 3b fixture updated to expect 5 squads (['company', 'demo', 'intelligence', 'product', 'research']) and 15 agents, reflecting the demo squad added in ux: squads init should include a working starter agent — no hello-world after init #689.
  • Follow-up fix: Added missing findProjectRoot to squad-parser mock — snapshotGoals in observability.ts calls this symbol, which was absent from the vitest mock and caused all workflow tests to fail with module import errors.

Test Results

All 16 workflow.test.ts tests pass. Full unit suite: 1874/1875 passed (1 unrelated flaky cleanup failure in list.test.ts).

Test plan

  • npm test -- --run test/lib/workflow.test.ts — 16/16 pass
  • Full unit suite passes (1874 tests)
  • Build succeeds (npm run build)
  • E2E first-run.e2e.test.ts — requires real CLI binary; fixture matches current scaffold output

Closes #715
Unblocks #712

Generated with Claude Code

Jorge Vidaurre and others added 2 commits April 1, 2026 22:20
5 workflow tests were crashing with 'Cannot read properties of undefined
(reading match)' because readFileSync mock returns undefined when existsSync
returns true. Added defensive guard — loadFocusPrompt returns empty string
when content is falsy. Safe in production too.

Also updates first-run e2e test to expect 5 squads (4 core + demo) and
15 agents, reflecting the demo squad added in #689.
snapshotGoals (observability.ts) calls findProjectRoot, which is now
used by runConversation. The mock was missing this export, causing all
workflow tests to fail with vitest module mock errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@agents-squads agents-squads bot requested a review from kokevidaurre as a code owner April 2, 2026 01:21
@agents-squads agents-squads bot merged commit bec4652 into develop Apr 2, 2026
11 checks passed
@agents-squads agents-squads bot deleted the fix/issue-715 branch April 2, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants