Skip to content

Add test pinning gpt-oss developer block to openai-harmony - #19241

Merged
danielhanchen merged 3 commits into
mainfrom
gptoss-harmony-developer-guard
Nov 24, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
gptoss-harmony-developer-guard

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Adds a regression test that pins the gpt-oss developer block rendered by get_chat_template(tokenizer, "gpt-oss") (and the gptoss alias) to the output of OpenAI's reference Harmony renderer, openai-harmony, which vLLM uses for gpt-oss.

The official Hugging Face chat_template.jinja appends \n\n after the developer instructions even when no tools are given (side effect of openai/gpt-oss-120b discussion #85). Harmony does not. Unsloth main already matches Harmony, but porting the HF template again (as in #19090) would silently change the last token before <|end|> from . to .\n\n for every gpt-oss fine-tune with a system prompt, so training would no longer match what vLLM and Ollama serve.

Test cases (system and developer role, both template aliases):

Case Expected developer block
Instructions, no tools # Instructions\n\nBe helpful.<|end|>
Instructions and tools # Instructions\n\nBe helpful.\n\n# Tools ...<|end|>
Tools, no instructions # Tools ...<|end|>

The expected strings were rendered with openai-harmony 0.0.8. A second test re-renders them with the live library when it is installed (skipped otherwise), so the literals cannot drift from Harmony.

Verification:

Test only, no library code changes.

@danielhanchen danielhanchen self-assigned this Nov 24, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T12:52:53.016295Z ec4b171 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: ec4b171301

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 37b701c into main Nov 24, 2026
6 of 23 checks passed
@danielhanchen
danielhanchen deleted the gptoss-harmony-developer-guard branch November 24, 2026 12:58
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