[Air #641] test: verify SPIR solo mode emits single consultation task#642
Merged
waleedkadous merged 1 commit intomainfrom Mar 28, 2026
Merged
Conversation
Add two tests to next.test.ts: - Solo mode: when config has models: ['claude'], porch next emits exactly 1 consultation task mentioning only claude (not gemini/codex) - None mode: when config has models: 'none', porch next emits a 'Consultation skipped' task with no consult commands Refactors the loadConfig mock to use vi.hoisted mutable ref so individual tests can override consultation models without affecting other tests.
This was referenced Apr 18, 2026
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
Adds missing test coverage verifying that
porch nextrespects consultation model configuration — specifically solo mode (single model) and none mode (consultation disabled).Implements #641
What Changed
Two new tests in
next.test.ts:loadConfigto returnmodels: ['claude'], assertsporch nextemits exactly 1 consultation task containing onlyclaude(notgeminiorcodex)loadConfigto returnmodels: 'none', assertsporch nextemits a "Consultation skipped" task with noconsult -mcommandsAlso refactored the
loadConfigmock to usevi.hoistedwith a mutable ref (configRef), allowing per-test overrides while keeping the default 3-model behavior for all existing tests. TheafterEachresetsconfigRef.modelsto the default.Key Decisions
vi.hoistedmutable ref pattern instead ofvi.fn().mockReturnValueOnce()because vitest's async mock factories don't properly propagatemockReturnValueOnceoverrides to the imported module reference.N-way consultationsubject, none mode checksConsultation skippedsubject.Test Plan
tsc --noEmit)next.test.tspassReview Notes
Net diff is ~45 lines. The
configRefapproach is minimal and isolated — existing tests are unaffected sinceafterEachresets to defaults.