Skip to content

fix(thinking): header opt-out of </think> marker for reasoning_content clients (#5312 RC-C, #5245) - #5367

Merged
diegosouzapw merged 2 commits into
release/v3.8.41from
fix/5312-c-think-marker
Jun 29, 2026
Merged

diegosouzapw merged 2 commits into
release/v3.8.41from
fix/5312-c-think-marker

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

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_content while the close marker </think> goes to the content channel (with no opening <think>). A reasoning_content-native client (Cursor) renders reasoning_content separately and shows content verbatim → an orphan </think> at the start of visible text. But clients that depend on the marker (#4633: Claude Code/Cursor composer scan content for 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 header x-omniroute-thinking-marker: off (also on/keep to force-keep) that overrides the UA policy via a new resolveSuppressThinkClose({userAgent, thinkingMarkerHeader}). Header absent ⇒ defers to the existing UA policy ⇒ byte-identical default (no #4633/#5123 regression).

Validation (Hard Rule #18)

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

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
diegosouzapw force-pushed the fix/5312-c-think-marker branch from 2841d6d to 206a8d2 Compare June 29, 2026 15:18
@diegosouzapw
diegosouzapw merged commit 734061f into release/v3.8.41 Jun 29, 2026
1 check was pending
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.
diegosouzapw added a commit that referenced this pull request Jun 29, 2026
Restores opencode-proxy-pool (#5370) + thinking RC-C (#5367) bullets and adds
the thinking A/B/D (#5352) bullet, all under a single header. Additive restore.
@diegosouzapw
diegosouzapw deleted the fix/5312-c-think-marker branch July 1, 2026 19:24
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.
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