Fix Grok account-rotation continuation during an active turn - #12
Conversation
Bare sendUserMessage during an active turn throws Pi core's Extension "<runtime>" already-processing error. deliverAs followUp queues when streaming and still starts a turn when idle.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughAccount rotation continuation messages now use ChangesRotation delivery
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~5 minutes Change: Bug fix Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
|
| expect(test.sendUserMessage).toHaveBeenCalledWith(ROTATION_CONTINUATION, { | ||
| deliverAs: 'followUp', | ||
| }); |
There was a problem hiding this comment.
Follow-up lifecycle remains untested
These assertions only check the arguments passed to a bare vi.fn(). They do not reproduce an active turn, the previous already-processing error, or follow-up delivery while streaming and idle. A regression in the queueing lifecycle could therefore pass these tests. The same concern applies to the assertion at lines 265–267; add a lifecycle-level test that models active-turn queueing and the subsequent continuation delivery.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Hey, thanks for the pr! |
Bare
sendUserMessageduring an active turn throws Pi core's Extension<runtime>already-processing error. Deliver the rotation continuation as a followUp so it queues while streaming and still starts a turn when idle.src/provider/rotation.ts: send the continuation with{ deliverAs: 'followUp' }tests/provider/rotation.test.ts: assert the queueing optionFull suite: 295/295 (vitest, TZ=UTC).
Summary by CodeRabbit