Skip to content

One multi-turn smoke script for all three operating systems - #9086

Merged
danielhanchen merged 6 commits into
mainfrom
consolidate-smoke-multiturn
Aug 17, 2026
Merged

danielhanchen merged 6 commits into
mainfrom
consolidate-smoke-multiturn

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

The multi-turn chat check ran inline in studio-inference-smoke.yml, studio-mac-inference-smoke.yml and studio-windows-inference-smoke.yml as three copies of the same script. Being three copies is how one of them stopped checking.

What the copies had done

On 2026-05-22, an unrelated event-loop fix (#5669) turned the Linux copy's determinism assertion into a printed warning:

if a.strip() != b.strip():
    determinism_failures.append(...)
...
print(f"[{label}] WARN non-determinism at temperature=0.0 across ...")

macOS and Windows kept the assertion. Diffed against each other, those two are identical in logic; the only differences across all three are that warning and a few comments Windows had dropped. Nothing compared them, so for three months the leg that runs on every pull request was the one not asserting, while the two that still asserted run rarely.

The same shape shows up elsewhere in the triple: each leg now asserts things the others do not (finish_reason == "tool_calls" only on Linux, status2 == 200 only on macOS). Those blocks have diverged much further and are not touched here.

What this does

  • Moves the script to .github/scripts/studio_smoke/multi_turn_chat.py; all three legs call it. Nothing in it was platform specific, and the only thing that differed per caller was the port, which it already read from BASE_URL. Removes 264 lines of YAML heredoc.
  • Keeps the strict form, which is what two of the three legs still had and the better reasoned of the two: the comparison is on stripped text because llama-server varies a final newline between identical greedy runs depending on where the stream is closed.
  • Reads no environment and imports no SDK at module level, so the checking half is importable and testable without a server.

The tests

tests/studio/test_smoke_workflows_share_one_script.py exercises the check rather than grepping it: divergence between the two runs raises, trailing whitespace alone does not, an empty reply raises, and a transcript with no history grounding raises. Mutation tested both ways:

  • reverting the script to the warning form fails test_a_divergent_second_run_is_a_failure_not_a_warning
  • re-inlining a copy into the Linux leg fails test_every_leg_runs_the_shared_script and test_no_leg_has_grown_its_own_copy_back

It runs from workflow-trigger-lint.yml, which carries no paths filter, because a pull request that re-inlines one leg edits a workflow and nothing else, and no paths filter in the repo matches .github/workflows/**.

One thing to be explicit about

This re-enables on Linux an assertion that has not run there since May. If greedy decoding at temperature 0.0 with a fixed seed is genuinely not reproducible on that leg, it will now fail rather than print a warning. That is the right way round, and it is better as one failure in one file than as three copies to reconcile afterwards.

The check ran inline in the Linux, macOS and Windows smoke workflows as three copies of
the same script, and being three copies is how one of them stopped checking. On
2026-05-22 an unrelated event-loop fix (#5669) turned the Linux copy's determinism
assertion into a printed warning. macOS and Windows kept it, and are otherwise identical
in logic: diffed, the only differences are that warning and some comments Windows had
dropped. Nothing compared the three, so for three months the leg that runs on every pull
request was the one not asserting, while the two that still asserted run rarely.

The script moves to .github/scripts/studio_smoke/multi_turn_chat.py and all three call
it. Nothing in it was platform specific; the only thing that differed per caller is the
port, which it already read from BASE_URL. That removes 264 lines of YAML heredoc.

It reads no environment and imports no SDK at module level, so the checking half is
importable, and the new tests exercise it rather than grepping it: divergence between
the two runs raises, trailing whitespace alone does not, an empty reply raises, and a
transcript with no history grounding raises. Reverting the script to the warning form
fails one of them; re-inlining a copy into a leg fails two.

Worth stating plainly: this re-enables on Linux an assertion that has not run there
since May. If greedy decoding is genuinely not reproducible on that leg, it will now
fail rather than print. That is the right way round, and it will be one failure in one
place rather than three copies to reconcile.

The guard runs from workflow-trigger-lint.yml, which carries no paths filter, because a
pull request that re-inlines one leg edits a workflow and nothing else.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 9d75b05328

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ad5e1cc9e8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

def check(label: str, first: list[str], second: list[str]) -> None:
for i, (a, b) in enumerate(zip(first, second), start = 1):
print(f"[{label} turn {i}] {a!r}")
assert a, f"{label}: empty turn {i} response"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject an empty reply from the second run

When the second greedy run returns no text while the first returns only tolerated whitespace (for example, "\n" versus ""), this assertion succeeds and the stripped comparison also succeeds, so the smoke test prints OK despite an empty second response. The previous Linux inline check explicitly asserted b, while the new unit test only covers an empty first response; validate the second reply before comparing the two runs.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, and it is a regression I introduced in the consolidation rather than something either copy had. The Linux version asserted both replies; the macOS version I took the strict determinism check from asserts only the first, and I kept that half along with it.

The pair you name is exactly the blind spot: "\n" against "" strips to "" on both sides, so the comparison passes and the smoke test prints OK for a server that stopped answering halfway through.

Fixed in eb6f0e6. The test now covers an empty second run and that specific whitespace-against-nothing pair; dropping the new assertion fails it.

The stripped comparison cannot tell the two apart: a second run returning "" against a
first returning "\n" compares EQUAL, so a server that stopped answering halfway through
printed OK. The Linux copy asserted both before this was consolidated; the macOS copy it
was taken from asserted only the first, and I kept that half.

The test now covers an empty SECOND run and the exact whitespace-against-nothing pair the
comparison is blind to. Dropping the new assertion fails it.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: d8a0d7ba33

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@danielhanchen
danielhanchen merged commit fa6be35 into main Aug 17, 2026
30 of 32 checks passed
@danielhanchen
danielhanchen deleted the consolidate-smoke-multiturn branch August 17, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant