Repository navigation
fix: don't clear turn input before retries - #611
Merged
Merged
Conversation
Contributor
|
nice, this was the "separate issue" i was referring to in #563 |
Collaborator
|
Very nice, ty! |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The current turn input in the agent loop is being discarded before consuming the stream events which causes the stream reconnect (after rate limit failure) to not include the inputs. Since the new stream includes the previous response ID, it triggers a bad request exception considering the input doesn't match what OpenAI has stored on the server side and subsequently a very confusing error message of:
No tool output found for function call call_xyz.This should fix #586.
Testing
I have a personal project that I'm working on that runs multiple Codex CLIs in parallel and often runs into rate limit errors (as seen in the OpenAI logs). After making this change, I am no longer experiencing Codex crashing and it was able to retry and handle everything gracefully until completion (even though I still see rate limiting in the OpenAI logs).