Reset Responses stub output for each new request - #282
Open
sylvesterkaczmarek wants to merge 3 commits into
Open
Reset Responses stub output for each new request#282sylvesterkaczmarek wants to merge 3 commits into
sylvesterkaczmarek wants to merge 3 commits into
Conversation
|
Note You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Make the Responses API stub backend restart its deterministic fake-token sequence for every new API request.
The stub accepts the standard
new_requestflag but currently ignores it, while its token position lives in the module-globaltoken_queue. A second request therefore starts wherever the previous request stopped rather than from the beginning of the stub response.Fixes #281.
Fix
Reset
token_queuetofake_tokens.copy()whennew_request=Truebefore returning the first token.Regression coverage
Adds a deterministic test that:
fake_tokens[0].The fake response content, automatic wraparound behavior, setup interface, and simulated latency are otherwise unchanged.