Repository navigation
bug: non-openai mode - fix for gemini content: null, fix 429 to throw before stream - #563
Conversation
|
Thanks a bunch, this looks like it took quite a bit of work to get right. There is a lot moving around and changing here and that's not an issue in itself, but I would like to see some new tests to cover the change in behavior here and ensure we don't have subsequent regressions. Could you take a look at that? |
|
@tibo-openai It's mostly formatting changes. i just moved the completion.create call outside, which removed the try/catch block and added an if to check if there is content so its not null. Everything else is the same. |
|
Could you still explain why the test needs to be removed? |
| } | ||
| }); | ||
|
|
||
| it("should handle errors gracefully", async () => { |
There was a problem hiding this comment.
Could you document why we want to remove this one?
There was a problem hiding this comment.
the try/catch wasn't allowing errors to propagate to the agent-loop, which has the rate limit and other handling. I took the error test out because it shouldn't gracefully handle the errors.
I'll write some more tests, I want to record snapshots from the different providers and test against those. Up to you if you want to wait a but for those, but this PR fixes gemini right now that people have been complaining about :)
There was a problem hiding this comment.
This makes sense to me, will merge.
Gemini's API is finicky, it 400's without an error when you pass content: null
Also fixed the rate limiting issues by throwing outside of the iterator.
I think there's a separate issue with the second isRateLimit check in agent-loop - turnInput is cleared by that time, so it retries without the last message.