Repository navigation
Studio: pin which rejection site the confirm-stream tests assert - #10284
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
You have reached your Codex usage limits for security reviews. Please try again later. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
(Python 3.13)is red onmainata12162ab5, on one test out of 37,035:The status code and the message assertions pass. Only the API monitor row is missing.
Two rejection sites, and nothing said which one runs
produce_openai_chat_completionsrefuses aconfirm_tool_callsplusstream=falserequest in two places:if _should_validate_before_switch():, so an invalid request never evicts the resident model. This returns before the monitor row is opened, so there is no row._reject, which fails the row that is already open._should_validate_before_switch()is_automatic_model_load_may_run() or _preview_slot_is_owned(). Both read process-wide state. The test never pinned it, so it asserted whichever site the rest of the xdist worker happened to leave reachable.Forcing that predicate true reproduces the CI failure exactly, same line and same error:
#10221 is not at fault
Its change is confined to charset handling in
_fetch_url_raw, and there is no path from that to whether a monitor row exists in the chat completions route. What it did was add 17 parametrized cases, which changes how xdist packs its four workers.That fits every observation. The twelve
maincommits before it are green on this check, it is red exactly at that commit, and the test passes alone, passes with its file serially, passes with its file under-n 4, and did not fail in a full local-n 4run of the suite. It is a latent ordering flake that #10221 happened to shake loose.The change
Pin the predicate and parametrize over both values, so each site is asserted deliberately rather than by accident. Pinning it is what the rest of the suite already does: five times in
test_active_generations.py, and again intest_openai_auto_switch.py.This is not only a determinism fix. The early site was previously reached by luck, so half of this behaviour was never asserted on purpose. It is now.
A second test had the same fragility,
test_confirm_tool_calls_requires_streaming_for_safetensors_tools. A regex scan of the file missed it and running the file with the predicate forced found it, so both are fixed the same way.Verification
The file, under both ambient conditions:
360 rather than the previous 358, from the two added parametrizations. Before this change the second column was 1 failed.
I also ran the whole backend suite with the predicate forced against an unforced run of the same suite, to find any other test resting on it. These two are the only ones.
One thing left alone
The two sites disagree about whether a rejected request is recorded at all, so the same 400 appears in the API monitor or does not, depending on whether an automatic load could have run. That is unrelated to #10221 and predates it. Recording a row at the early site changes what the monitor shows, which wants its own PR rather than being folded into an unblock, so this one documents the split instead of closing it.