Repository navigation
Make the multi-turn smoke actually assert that history reached the model - #10009
Merged
Merged
Conversation
The four-turn smoke says turns 2 and 4 are answerable only from earlier turns, so a server that drops history fails rather than returning something plausible. Turn 4 does that. Turn 2 did not. "What did I ask before?" reads like the stronger probe but is not one: gemma-3-270m-it, the model this smoke loads, answers "I am doing well! How can I help you today?" whether or not the history is attached. Nothing asserted that reply. The only content checks were "1" in turn 1 and "paris" somewhere in the joined transcript, both satisfied by turns 1 and 3 alone, so a server that dropped every turn before the last still passed. Ask for the answer rather than the question. Measured against llama-server b10687-mix-67dfc8b with the same GGUF the workflow loads, turn 2 becomes "The answer to your previous question was 2.", which cannot be produced without turn 1. Assert it per turn rather than over the joined transcript, since turn 1 already contains "2" and a joined check would pass on a server with no history at all. Verified both directions: the measured transcript passes, and the old turn-2 reply now fails with the history message where it previously passed every assertion.
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. |
added 2 commits
August 30, 2026 11:07
…ures Two things the first pass got wrong. The new assertion broke tests/studio/test_smoke_workflows_share_one_script.py, which is run unfiltered on every pull request by workflow-trigger-lint. Its fixtures still used "you asked about 1+1" for turn 2, which carries no answer, so the determinism and whitespace cases aborted on the history check and the grounding case raised the wrong assertion. Fixtures updated to the new contract, and the grounding test now covers both halves: a dropped turn 2 and a missing city. The assertion itself was also too weak. A hardcoded "2" accepts a turn 2 that contradicts turn 1, "1 + 1 = 3" followed by "the answer was 2", and 2 is guessable by a model that never saw the history. Take the expected value from turn 1's reply instead: the last number in it, since "1 + 1 = 2" restates the operands first. A new test pins that, including the contradiction case. No empty-numbers guard, because the preceding assertion already requires "1" in turn 1, so the list cannot come back empty and a defensive branch there would be unreachable.
Deriving the expected value from turn 1 only buys something if turn 1 is unpredictable. With turn 1 fixed at 1+1 it reduced to hardcoding "2", which a server that dropped history can produce by luck, so the false positive stayed open. Measured the two candidate remedies against llama-server b10687-mix-67dfc8b with the GGUF the workflow loads. Planting an explicit marker does not work on this model: "Remember the number 47. What is 1+1?" followed by "What number did I ask you to remember?" answers "I don't remember the number you asked me to remember." That would have failed the smoke permanently. An unguessable arithmetic answer does work. 58+27 gives "58 + 27 = 95" and turn 2 "The answer to your previous question was 95.", stable across runs, and turn 2 sent with no history at all answers "I am doing well, thank you for asking!", which carries no number and so fails the check as it should. The turn-1 assertion becomes "contains a number" rather than "contains 1", which is what it was really for and no longer depends on which operands are asked.
|
Codex Review: Didn't find any major issues. 👍 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". |
This was referenced Aug 30, 2026
danielhanchen
pushed a commit
that referenced
this pull request
Aug 30, 2026
`GGUF inference smoke` and the Mac inference lane have been red on main and on essentially every open PR. They are two different failures on the same turn. macOS is the assertion, not the server. #10009 moved history grounding onto turn 2, requiring the reply to restate turn 1's number. In the same run that turn 2 came back "You haven't provided the previous question.", turn 4 answered "The capital of France is Paris." -- from a prompt reading "Repeat the city name", which names no city, so history had arrived. Whether a 270M model phrases a recalled number is a property of the model, not of the server's history wiring. #10009's finding is real and stays: 'paris' in the JOINED transcript proves nothing because turn 3 supplies it alone. Asserting the LAST turn, per turn, closes exactly that gap on the turn that works. Sent that prompt with no history, the model answers "Okay, I'm ready." -- measured against llama-server b10360 with the UD-Q4_K_XL file the workflow loads, three times, plus 15/15 conversations where the last turn named the city. Windows is the older near-tie. Two replays are not two identical requests: each turn is built from the reply before it, and the second replay meets the server holding cache and slot state the first left behind, so a near-tied token can land differently without decoding being broken. Both observed answers were correct. The retry for that lives in main() and NOT in check(). check()'s contract is unchanged: every divergence handed to it is still a hard failure, which is why test_a_divergent_second_run_is_a_failure_not_a_warning passes here untouched. That test exists because #5669 turned this into a printed warning on the Linux leg and it went unnoticed for three months, and softening check() would have walked straight back into it. The divergence now raises a Nondeterministic subclass of AssertionError, so main() can retry that one failure and nothing else, and existing pytest.raises(AssertionError) keeps matching. Two guards from #10009 encode the turn-2 design and are updated with it, not around it. Their replacements use the MEASURED history-dropping reply rather than a hypothetical fixture, and a new one pins the macOS transcript as passing while a last turn that cannot name the city still fails. Two more pin the retry itself: a server that disagrees every time still fails and is bounded to ATTEMPTS, and a non-divergence failure is not retried at all. What I could not do: reproduce the Windows tie here. Prompt-cache state (cold, 2-turn, 4-turn primed), six concurrent generations, and thread counts 1 through 16 all gave one identical answer, 12/12 and 15/15. The tie is specific to those runners. tests/studio: 6630 passed, 195 skipped. Live end-to-end on the real GGUF passes. verify_import_hoist, lint_exec_literals and lint_no_parallel_clamp clean.
danielhanchen
added a commit
that referenced
this pull request
Aug 30, 2026
…10025) * Ground the multi-turn smoke on the turn that survives a 270M model `GGUF inference smoke` and the Mac inference lane have been red on main and on essentially every open PR. They are two different failures on the same turn. macOS is the assertion, not the server. #10009 moved history grounding onto turn 2, requiring the reply to restate turn 1's number. In the same run that turn 2 came back "You haven't provided the previous question.", turn 4 answered "The capital of France is Paris." -- from a prompt reading "Repeat the city name", which names no city, so history had arrived. Whether a 270M model phrases a recalled number is a property of the model, not of the server's history wiring. #10009's finding is real and stays: 'paris' in the JOINED transcript proves nothing because turn 3 supplies it alone. Asserting the LAST turn, per turn, closes exactly that gap on the turn that works. Sent that prompt with no history, the model answers "Okay, I'm ready." -- measured against llama-server b10360 with the UD-Q4_K_XL file the workflow loads, three times, plus 15/15 conversations where the last turn named the city. Windows is the older near-tie. Two replays are not two identical requests: each turn is built from the reply before it, and the second replay meets the server holding cache and slot state the first left behind, so a near-tied token can land differently without decoding being broken. Both observed answers were correct. The retry for that lives in main() and NOT in check(). check()'s contract is unchanged: every divergence handed to it is still a hard failure, which is why test_a_divergent_second_run_is_a_failure_not_a_warning passes here untouched. That test exists because #5669 turned this into a printed warning on the Linux leg and it went unnoticed for three months, and softening check() would have walked straight back into it. The divergence now raises a Nondeterministic subclass of AssertionError, so main() can retry that one failure and nothing else, and existing pytest.raises(AssertionError) keeps matching. Two guards from #10009 encode the turn-2 design and are updated with it, not around it. Their replacements use the MEASURED history-dropping reply rather than a hypothetical fixture, and a new one pins the macOS transcript as passing while a last turn that cannot name the city still fails. Two more pin the retry itself: a server that disagrees every time still fails and is bounded to ATTEMPTS, and a non-divergence failure is not retried at all. What I could not do: reproduce the Windows tie here. Prompt-cache state (cold, 2-turn, 4-turn primed), six concurrent generations, and thread counts 1 through 16 all gave one identical answer, 12/12 and 15/15. The tie is specific to those runners. tests/studio: 6630 passed, 195 skipped. Live end-to-end on the real GGUF passes. verify_import_hoist, lint_exec_literals and lint_no_parallel_clamp clean. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: danielhanchen <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@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.
What this fixes
multi_turn_chat.pyopens by saying the conversation is built so that turns 2 and 4 are only answerable from the earlier turns, "so a server that drops history fails here rather than returning something plausible". Turn 4 does that. Turn 2 did not."What did I ask before?"reads like the stronger history probe, butgemma-3-270m-it, the model this smoke loads, answers it with"I am doing well! How can I help you today?"whether or not the history is attached. Nothing asserted that reply. The only content checks were:Turn 1 satisfies the first and turn 3 the second, so a server that dropped every turn before the last one still passed this test.
The change
Turn 2 asks for the answer rather than for the question. Measured against
llama-serverb10687-mix-67dfc8bwith the sameunsloth/gemma-3-270m-it-GGUFUD-Q4_K_XLfile the workflow loads:1 + 1 = 2The answer to your previous question was 2.The capital of France is Paris.The capital of France is Paris.Turn 2 now carries turn 1's answer, and the check asserts it per turn rather than over the joined transcript. That distinction matters: turn 1 already contains
2, so a joined check would pass on a server with no history at all.Verification
Both directions, against the checking half of the script:
"I am doing well! How can I help you today?", now fails withturn 2 must repeat turn 1's answer, so history reached the modelThe three workflows share this one file since #9086, so Linux, macOS and Windows all pick it up.
Note on the determinism failures
GGUF inference smokehas been failing intermittently onmainsince 2026-08-30, always at turn 2, always with the same pair:Two things I ruled out while looking at this, recorded so nobody repeats the work:
apply_patchtool not exposed when launching Codex viaunsloth codex .#9114 is not involved. It was the only commit between the last green run and the first red one, which makes it the obvious suspect, but every hunk it adds toroutes/inference.pylives in_responses_*helpers, and_build_chat_requestis reachable only from_responses_non_streamingand_responses_stream. This smoke uses Chat Completions and the Anthropic Messages API, neither of which touches the Responses path. Itsmodels/inference.pychanges are Responses schemas only.llama-serverwith that GGUF onb10360-mix-87da1a2andb10687-mix-67dfc8b, withcache_promptboth true and false, across three servers at different thread counts and batch sizes, twice each. Every transcript was identical. The known prompt-cache non-determinism in Cache and system prompt on server makes output non-deterministic ggml-org/llama.cpp#4902 fits the signature well, but it did not reproduce here.What the evidence does point at is a near-exact logit tie. All three observed turn-2 answers, including the healthy local one, begin
"I am doing"and diverge at the very next token, which is what a tie looks like on a 270M model. I could not reproduce the flip locally, so I am not claiming this change fixes it, only that the turn it happens on was asserting nothing and testing nothing. If the flake follows the new prompt, the tie theory is wrong and worth reopening.