fix(engine): repair two stale test mocks broken by #1910#1919
Conversation
restart.integration.test.ts's `../pi.js` factory replaces the module wholesale but omits ModelFallbackExhaustedError, which triage.ts references via `err instanceof ModelFallbackExhaustedError` — evaluating the guard threw "No ModelFallbackExhaustedError export is defined on the mock". Added a plain Error-subclass stub (no restart test enters the fallback-exhausted branch). mission-validation-trigger-gap.test.ts's two recovery-path missionStore mocks omit getMission, which Runfusion#1910's mission-active gate now walks (getSlice → getMilestone → getMission) inside resolveFeatureMission. The throw was swallowed by processTaskOutcome's catch, aborting recovery before it ensured assertions / started the validator run — surfacing as ensureFeatureAssertionLinked called 0 times. Added getMission returning an active mission. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTest mocks were updated in two files: mission recovery tests now mock ChangesTest mock fixes
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR repairs two stale engine test mocks.
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(engine): repair two stale test mocks..." | Re-trigger Greptile |
Two engine test files fail on current
main(17c4007). Both are stale test-mock breakages — no production code is touched.1.
restart.integration.test.tsIts
vi.mock("../pi.js", …)factory replaces the module wholesale but omitsModelFallbackExhaustedError.triage.tsguards its catch block witherr instanceof ModelFallbackExhaustedError(imported frompi.js), so evaluating that guard throws "No ModelFallbackExhaustedError export is defined on the mock".Fix: export a plain
Error-subclass stub from the factory. No restart test enters the fallback-exhausted branch, soinstanceofsimply returnsfalse— a faithful stub.2.
reliability-interactions/mission-validation-trigger-gap.test.tsTwo recovery-path
missionStoremocks omitgetMission. #1910's mission-active gate now walksgetSlice → getMilestone → getMissioninsideresolveFeatureMission. The resulting throw is swallowed byprocessTaskOutcome'scatch, aborting recovery before it can ensure assertions / start the validator run — surfacing asensureFeatureAssertionLinkedasserted called-once but seen 0 times.Fix: add
getMissionreturning an active mission to both mocks.Verification
Summary by CodeRabbit