Repository navigation
Conversation
openai-harmony and oss-harmony both install the openai_harmony module. vLLM >= 0.32 requires oss-harmony while renderers required openai-harmony, so environments with both held two packages writing the same files, and whichever installed last supplied the native code. oss-harmony renders commentary headers channel-first (<|channel|>commentary to=functions.x). Which order gpt-oss handles best in history is contested, so the renderer keeps the recipient-first header it has always produced for tool calls and tool results. Rendered tokens are unchanged, and identical on either harmony build. The parity oracle is harmony itself, so it applies the same header order; tests/test_gpt_oss.py pins it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Skipped Macroscope could not complete its approvability analysis for this PR. Approvability analysis did not return a structured decision, so this PR cannot be approved automatically. You can add or adjust custom eligibility rules. Learn more. |
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.
Problem
openai-harmonyandoss-harmonyboth install theopenai_harmonymodule. renderers requiredopenai-harmony, and vLLM >= 0.32 requiresoss-harmony(vLLM #55128). So any environment with both, prime-rl's included, held two packages writing the same files, and whichever installed last supplied the native code. In prime-rl's locked env the.soon disk is openai-harmony 0.0.8's, so vLLM runs 0.0.8 code too, even though it asks for the fork.What the fork changes (0.0.8 → 0.0.11, Rust only; the Python layer is identical)
<|channel|>commentary to=functions.xinstead ofto=functions.x<|channel|>commentary. This applies to tool results as well as tool calls.jsoncontent type gets a real<|constrain|>token.<|channel|>markers. On 0.0.8 they end up in the recipient, e.g.functions.bash<|channel|>commentary.Change
Depend on
oss-harmony>=0.0.11.Keep the gpt-oss renderer's tokens unchanged. Which header order gpt-oss handles best in history is contested:
_use_legacy_tool_call_headers).So
_render_messagekeeps the recipient-first header for tool calls and tool results, encoding header text the way harmony does (no special-token parsing).The parity oracle is harmony itself, so it applies the same header order (
harmony_recipient_first). That rewrite is a no-op on 0.0.8.tests/test_gpt_oss.pypins the header as a literal string.Drop the
openai-harmonypins from the example scripts and note the SGLang collision inexamples/README.md. SGLang pinsopenai-harmony==0.0.4.Verification
-k "gpt-oss or gpt_oss or harmony": 230 passed, 3 skipped on oss-harmony and on openai-harmony 0.0.8.Not in scope
renderersnow produces the same tokens on either harmony build, so oss-harmony could move behind an extra to keep plainrenderersinstallable next to SGLang. That's a call about SGLang support, and this PR leaves it alone.🤖 Generated with Claude Code
Note
Medium Risk
Changes core gpt-oss tokenization for tool turns and the harmony dependency, which affects vLLM co-install and training/serving parity; behavior is guarded by parity tests and a dedicated header test.
Overview
Switches the package dependency from
openai-harmonytooss-harmony>=0.0.11(vLLM’s fork) and refreshesuv.lock, with comments explaining the sharedopenai_harmonymodule clash with SGLang’s pinnedopenai-harmony.GptOssRendereradds_render_messageso commentary tool-call and tool-result headers stay recipient-first (to=…before<|channel|>) even though oss-harmony emits channel-first headers.render()andbridge_to_next_turnroute per-message rendering through that helper so output tokens stay aligned with the prior openai-harmony contract.Tests gain
harmony_recipient_firston the harmony parity oracle andtests/test_gpt_oss.pyto pin header ordering. Example scripts drop explicitopenai-harmonyPEP 723 pins;examples/README.mddocuments the SGLang harmony collision.Reviewed by Cursor Bugbot for commit 5dc6315. Bugbot is set up for automated code reviews on this repo. Configure here.