test(mimo): add advanced streaming scenario tests for Mimo provider#220
test(mimo): add advanced streaming scenario tests for Mimo provider#220proyectoauraorg wants to merge 1 commit into
Conversation
|
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 (1)
📝 WalkthroughWalkthroughAdds streaming-focused tests to MiMoHandler that validate multi-chunk text concatenation, mixed reasoning/text/tool-call delta handling, suppression of ChangesMiMoHandler streaming tests
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/api/providers/__tests__/mimo.spec.ts (1)
734-739: ⚡ Quick winTighten the “without stream option” assertion to enforce omission.
This currently passes for
stream: false, which is different from omittingstream. AsserttoBeUndefined()to match the test intent.Suggested diff
it("should call create without stream option", async () => { await handler.completePrompt("What is 2+2?") const params = mockCreate.mock.calls[0][0] - expect(params.stream).toBeFalsy() + expect(params.stream).toBeUndefined() })🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/api/providers/__tests__/mimo.spec.ts` around lines 734 - 739, The test currently asserts params.stream is falsy which allows stream: false; change the assertion to require the property be omitted by asserting params.stream is undefined. In the "should call create without stream option" test that calls handler.completePrompt("What is 2+2?"), replace expect(params.stream).toBeFalsy() with an assertion that params.stream === undefined (e.g., expect(params.stream).toBeUndefined()) so mockCreate's first call payload truly omits the stream field.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/api/providers/__tests__/mimo.spec.ts`:
- Around line 734-739: The test currently asserts params.stream is falsy which
allows stream: false; change the assertion to require the property be omitted by
asserting params.stream is undefined. In the "should call create without stream
option" test that calls handler.completePrompt("What is 2+2?"), replace
expect(params.stream).toBeFalsy() with an assertion that params.stream ===
undefined (e.g., expect(params.stream).toBeUndefined()) so mockCreate's first
call payload truly omits the stream field.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 11ea96de-b39f-4470-9377-8aa8a745c05a
📒 Files selected for processing (1)
src/api/providers/__tests__/mimo.spec.ts
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Rebased onto main. The completePrompt coverage from the original PR is now provided by the merged Zoo-Code-Org#210, so this focuses on its net-new contribution: 4 advanced streaming resilience tests (multi-chunk text concatenation, interleaved reasoning + tool calls, missing usage in final chunk, and zero-valued cache tokens). 49 tests pass. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
c30b488 to
f5060db
Compare
|
Rebased onto latest `main` to resolve the conflict with the now-merged #210. Since #210 already lands comprehensive `completePrompt` coverage, I dropped the overlapping `completePrompt` block from this PR and kept its net-new contribution: 4 advanced streaming resilience tests (multi-chunk text concatenation, interleaved reasoning + tool calls, missing usage in the final chunk, and zero-valued cache tokens). 49 tests pass locally. Ready for review. |
|
Re: the `toBeFalsy()` → `toBeUndefined()` nitpick — that assertion lived in the `completePrompt` block, which I dropped during the rebase since #210 already covers it. The remaining `advanced streaming` tests use `toBeUndefined()` already, so this one is moot now. Thanks @coderabbitai 🙏 |
|
Tip For best results, initiate chat on the files or code changes.
(ノ◕ヮ◕)ノ*:・゚✧🐰 |
Summary
completePromptmethod and advanced streaming behaviorTest Coverage
completePromptwith various message types (text, image, PDF, cache control)Summary by CodeRabbit