Skip to content

Strip duplicate channel markers from message headers#5

Merged
bbrowning merged 1 commit into
oss-harmony:mainfrom
bbrowning:strip-extra-channels-fork
May 13, 2026
Merged

Strip duplicate channel markers from message headers#5
bbrowning merged 1 commit into
oss-harmony:mainfrom
bbrowning:strip-extra-channels-fork

Conversation

@bbrowning
Copy link
Copy Markdown

gpt-oss models occasionally emit extra <|channel|> markers in message headers during deep multi-turn conversations. Instead of erroring, the parser now strips all duplicate channel markers after extracting the first one, using the same boundary logic (stop at whitespace or '<') that is used when extracting the first channel marker.

This also marks parse_header_from_string as pub(crate) to allow for direct unit testing, and adds tests of the previous and new behavior to make sure that channels are extracted properly.

gpt-oss models occasionally emit extra <|channel|> markers in message
headers during deep multi-turn conversations. Instead of erroring, the
parser now strips all duplicate channel markers after extracting the
first one, using the same boundary logic (stop at whitespace or '<')
that is used when extracting the first channel marker.

This also marks `parse_header_from_string` as `pub(crate)` to allow for
direct unit testing, and adds tests of the previous and new behavior to
make sure that channels are extracted properly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bbrowning bbrowning merged commit 8216aa8 into oss-harmony:main May 13, 2026
24 checks passed
@bbrowning bbrowning deleted the strip-extra-channels-fork branch May 13, 2026 19:48
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