Skip to content

fix: don't clear turn input before retries - #611

Merged
tibo-openai merged 1 commit into
openai:mainfrom
Coffee-Boyy:bug/retry-with-turn-inputs
Apr 24, 2025
Merged

tibo-openai merged 1 commit into
openai:mainfrom
Coffee-Boyy:bug/retry-with-turn-inputs

Conversation

@Coffee-Boyy

Copy link
Copy Markdown
Contributor

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).

@dnakov

dnakov commented Apr 24, 2025

Copy link
Copy Markdown
Contributor

nice, this was the "separate issue" i was referring to in #563

@tibo-openai

Copy link
Copy Markdown
Collaborator

Very nice, ty!

@tibo-openai
tibo-openai merged commit 622323a into openai:main Apr 24, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex crashed

3 participants