Skip to content

fix: strip leaked thinking tags from openai compat content#1380

Closed
Alix-007 wants to merge 1 commit intosipeed:mainfrom
Alix-007:fix/issue-1235-strip-thinking-tags
Closed

fix: strip leaked thinking tags from openai compat content#1380
Alix-007 wants to merge 1 commit intosipeed:mainfrom
Alix-007:fix/issue-1235-strip-thinking-tags

Conversation

@Alix-007
Copy link
Contributor

Summary

  • sanitize <think>, <thinking>, <thought>, <reasoning>, and <final> wrappers from assistant content
  • handle escaped unicode angle-bracket forms like \u003c
  • drop trailing unclosed reasoning blocks to avoid leaking internal text

Fixes #1235

Testing

  • go test ./pkg/providers/openai_compat

@CLAassistant
Copy link

CLAassistant commented Mar 11, 2026

CLA assistant check
All committers have signed the CLA.

@sipeed-bot sipeed-bot bot added type: bug Something isn't working domain: provider go Pull requests that update go code labels Mar 11, 2026
@yinwm
Copy link
Collaborator

yinwm commented Mar 11, 2026

关闭重复 PR,使用 #1237

@yinwm yinwm closed this Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: provider go Pull requests that update go code type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(openai_compat): strip leaked Thinking/Final tags from content

3 participants