Skip to content

Conversation

@user-error1
Copy link
Contributor

Added handling for message and content block deltas, including safety checks for open thinking tags.

Results in working reasoning and makes GPT-OSS 80/120b usable in frontends that expect closing thinking tags.

Issue #, if available: #194

Description of changes:

Detects the transition from reasoning content to regular text content and automatically closes the tag. Keepis signature support for models like Claude/DeepSeek that send a signature field. Added a safety check at messageStop to ensure any unclosed tags are properly closed before the stream ends.

This results in working GPT-OSS thinking tags and works well in a frontend like open webui.

p.s. this is my first PR / open source contribution ever and it feels AWESOME! :)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Added handling for message and content block deltas, including safety checks for open thinking tags.

Results in working reasoning and makes GPT-OSS 80/120b usable in frontends that expect closing thinking tags.
@tankeeli
Copy link

@zxkane This is blocking our work as well. Would you mind taking a look at this PR?

@zxkane
Copy link
Member

zxkane commented Nov 20, 2025

Hi @user-error1 , Great work on your first PR! 🎉

@zxkane zxkane linked an issue Nov 20, 2025 that may be closed by this pull request
@zxkane zxkane merged commit ce4cfab into aws-samples:main Nov 20, 2025
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.

GPT-OSS Thinking Tags Don't Close

3 participants