fix(ci): null check in loadFocusPrompt + update E2E squad fixture — fixes #715#723
Merged
agents-squads[bot] merged 2 commits intodevelopfrom Apr 2, 2026
Merged
fix(ci): null check in loadFocusPrompt + update E2E squad fixture — fixes #715#723agents-squads[bot] merged 2 commits intodevelopfrom
agents-squads[bot] merged 2 commits intodevelopfrom
Conversation
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>
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.
Summary
loadFocusPromptinsrc/lib/workflow.tsnow guards againstundefinedreturned by thereadFileSyncmock whenexistsSyncreturnstrue. Addedif (!content) return ''check before.match(). Fixes all 5 failingtest/lib/workflow.test.tstests.test/e2e/first-run.e2e.test.tsStep 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.findProjectRootto squad-parser mock —snapshotGoalsinobservability.tscalls 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.tstests pass. Full unit suite: 1874/1875 passed (1 unrelated flaky cleanup failure inlist.test.ts).Test plan
npm test -- --run test/lib/workflow.test.ts— 16/16 passnpm run build)first-run.e2e.test.ts— requires real CLI binary; fixture matches current scaffold outputCloses #715
Unblocks #712
Generated with Claude Code