fix(sse): suppress </think> by default on Chat Completions (#8245) - #8309
Merged
diegosouzapw merged 1 commit intoJul 24, 2026
Conversation
…apw#8245) Claude→OpenAI translation was emitting a literal </think> into delta.content for ordinary Chat Completions clients. Reasoning already ships as reasoning_content, so default to suppress and keep x-omniroute-thinking-marker: on as the diegosouzapw#4633 opt-in.
Contributor
Author
CI note — Quality Gates failures look pre-existing on
|
| Job | Failure | Related to #8245? |
|---|---|---|
| Unit Tests (shards) | ReferenceError: PROVIDER_BREAKER_FAILURE_STATUSES is not defined at src/sse/handlers/chat.ts:1340 (+ unrelated catalog/i18n drift) |
No |
| Vitest | auto/glm assertion in provider-family-combos.test.ts |
No |
| Fast Quality Gates | Stale allowlist entry open-sse/executors/muse-spark-web.ts in check:error-helper |
No |
| Docs Gates | Env sync: chaos/notion/VNC vars missing from .env.example |
No |
| ESLint warnings | lint:json --max-warnings 0 base noise |
No |
Same Quality Gates pattern is also red on recently merged tip PRs (e.g. #8296, #8287), so this looks like current release/v3.8.49 tip CI rather than a regression from this PR.
Happy to rebase once tip is green, or adjust if reviewers want anything else on the #8245 path itself.
Owner
|
Merged into |
This was referenced Jul 25, 2026
Merged
HouMinXi
pushed a commit
to HouMinXi/OmniRoute
that referenced
this pull request
Aug 2, 2026
…apw#8245) (diegosouzapw#8309) Claude→OpenAI translation was emitting a literal </think> into delta.content for ordinary Chat Completions clients. Reasoning already ships as reasoning_content, so default to suppress and keep x-omniroute-thinking-marker: on as the diegosouzapw#4633 opt-in.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…apw#8245) (diegosouzapw#8309) Claude→OpenAI translation was emitting a literal </think> into delta.content for ordinary Chat Completions clients. Reasoning already ships as reasoning_content, so default to suppress and keep x-omniroute-thinking-marker: on as the diegosouzapw#4633 opt-in.
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.
Summary
resolveSuppressThinkClose()so OpenAI Chat Completions suppresses the Claude→OpenAI</think>close marker by default (fix(api): </think> leaks into OpenAI Chat Completions content on Claude-format providers #8245). Ordinary clients were getting a literal</think>indelta.contenteven though reasoning already ships asreasoning_content.x-omniroute-thinking-marker: onas the explicit opt-in for legacy content-scanning clients (fix(translator): emit </think> close marker for Anthropic thinking blocks #4633).</think>close marker for Responses API clients #7747). Headeroffstill suppresses; UA allowlist kept for directshouldSuppressThinkCloseMarkercallers only.Closes #8245
Test plan
node --import tsx/esm --test tests/unit/think-close-marker-suppress-5245.test.ts tests/unit/think-close-marker-responses-format.test.ts tests/unit/claude-to-openai-think-close-5123.test.ts tests/unit/anthropic-stream-thinking-close-marker.test.ts tests/unit/glm-think-close-marker-leak.test.ts(20/20 pass)</think>indelta.content;reasoning_contentstill presentx-omniroute-thinking-marker: on: marker emitted for fix(translator): emit </think> close marker for Anthropic thinking blocks #4633 clients/v1/responsespath still suppresses even with headeron