fix(thinking): header opt-out of </think> marker for reasoning_content clients (#5312 RC-C, #5245) - #5367
Merged
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…t clients (#5312 RC-C, #5245) The </think> close-marker leaked an orphan tag into visible content for reasoning_content-native clients (Cursor). The suppression machinery already existed (UA allowlist, #5348) but Cursor's UA was excluded. Added an explicit request header x-omniroute-thinking-marker: off (on/keep to force-keep) that overrides the UA policy via resolveSuppressThinkClose. Header absent => byte-identical default; #4633 clients still get the marker. Regression guard: think-close-marker-suppress-5245 (#5123 case-b + #4479 green).
diegosouzapw
force-pushed
the
fix/5312-c-think-marker
branch
from
June 29, 2026 15:18
2841d6d to
206a8d2
Compare
diegosouzapw
added a commit
that referenced
this pull request
Jun 29, 2026
Restores cors/grok-web/cli-serve (batch 5) + thinking RC-C (#5367) bullets eaten by sequential squash-merges, dedups the duplicate header. All code landed; additive restore — single header, 13 bullets.
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
…t clients (diegosouzapw#5312 RC-C, diegosouzapw#5245) (diegosouzapw#5367) Integrated into release/v3.8.41 — header opt-out of </think> marker (diegosouzapw#5312 RC-C, diegosouzapw#5245).
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
Restores cors/grok-web/cli-serve (batch 5) + thinking RC-C (diegosouzapw#5367) bullets eaten by sequential squash-merges, dedups the duplicate header. All code landed; additive restore — single header, 13 bullets.
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
Restores opencode-proxy-pool (diegosouzapw#5370) + thinking RC-C (diegosouzapw#5367) bullets and adds the thinking A/B/D (diegosouzapw#5352) bullet, all under a single header. Additive restore.
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.
Implements RC-C of #5312 (shared with #5245) — the follow-up to PR #5352 (A/B/D).
Problem
On the Cursor → Claude OAuth path the Claude thinking stream is split: the body goes to
reasoning_contentwhile the close marker</think>goes to thecontentchannel (with no opening<think>). A reasoning_content-native client (Cursor) rendersreasoning_contentseparately and showscontentverbatim → an orphan</think>at the start of visible text. But clients that depend on the marker (#4633: Claude Code/Cursor composer scancontentfor it) need it kept.Fix
The suppression machinery already existed (
state.suppressThinkClose+ a UA allowlist, #5348) but Cursor's UA was deliberately excluded. This adds an explicit opt-in request headerx-omniroute-thinking-marker: off(alsoon/keepto force-keep) that overrides the UA policy via a newresolveSuppressThinkClose({userAgent, thinkingMarkerHeader}). Header absent ⇒ defers to the existing UA policy ⇒ byte-identical default (no #4633/#5123 regression).Validation (Hard Rule #18)
think-close-marker-suppress-5245.test.ts(7): header off→suppress / on→keep / absent→defer-to-UA; header opts Cursor in and overrides UA; finish-flush path suppressed under the flag; default still emits the marker. Regression:claude-to-openai-think-close-5123(incl. fix(translator): emit </think> close marker for Anthropic thinking blocks #4633 case b) +translator-redacted-thinking-model-aware-4479stay green. typecheck/eslint/file-size clean.