Repository navigation
fix(executors): decode Composer Cursor </think>-marked visible output - #4554
Merged
diegosouzapw merged 4 commits intoJun 21, 2026
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. |
The composer-* family on Cursor encodes its visible reply inside the `thinking` protobuf field, separated from the (private) chain-of-thought by a final `</think>` marker. OmniRoute was forwarding the whole thinking payload as `reasoning_content` only, so OpenAI-compatible clients saw an empty `message.content` and never displayed the reply. The cursor executor now: - detects Composer models (case-insensitive, tolerates vendor prefix); - splits the thinking payload at the last `</think>` marker; - streams the suffix as `content` deltas (mirrored into `totalText` so the non-streaming aggregator surfaces it as `message.content`); - keeps only the pre-marker hidden reasoning in `reasoning_content`, with the visible portion stripped to avoid duplication. Non-Composer models keep their existing reasoning_content contract. Inspired-by: decolua/9router#1310 Co-authored-by: Noé Rivera <95829890+noestelar@users.noreply.github.com>
diegosouzapw
force-pushed
the
fix/port-pr-1310-cursor-composer-thinking
branch
from
June 21, 2026 21:23
b8b1091 to
e8448b7
Compare
added 3 commits
June 21, 2026 19:05
Composer </think>-marked visible-output decoding adds +62 lines. Baseline bumped to match (wc+1); fast-gate PR->release does not run check:file-size (Hard Rule #9).
This was referenced Jun 21, 2026
Merged
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
…cheaper-inference#4554) Integrated into release/v3.8.33
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
Port of decolua/9router#1310 by @noestelar, adapted JS→TS to OmniRoute's
StreamCtx-based cursor pipeline.The Cursor
composer-*family encodes its visible reply inside thethinkingprotobuf field, separated from the (private) chain-of-thought by a final</think>sentinel. OmniRoute was forwarding the whole thinking payload asreasoning_contentonly, so OpenAI-compatible clients saw an emptymessage.contentand never displayed the reply.Changes
open-sse/executors/cursor.ts:isComposerModel(model)— case-insensitive^composer(?:-|$)/iafter stripping any vendor prefix (cu/composer-2.5✓).visibleComposerContentFromThinking(text)— slice after last</think>,trimStart.composerReasoningRemainder(text)— slice before last</think>(the still-private chain-of-thought).StreamCtxgets acomposerVisibleEmittedLengthcursor so streaming only emits the incremental tail per thinking frame.processFramethinking branch: for Composer models, emit the post-</think>suffix ascontentdeltas (mirrored intoctx.totalTextso the non-streaming aggregator picks it up); for non-Composer models, the existingreasoning_contentcontract is preserved.buildResponseFromCtx: strips the visible suffix fromreasoning_contentfor Composer, so the visible reply is not duplicated betweencontentandreasoning_content.Test plan
tests/unit/cursor-composer-thinking.test.ts(6 tests, all green):contentdeltas, hidden reasoning never leaks ascontentnor asreasoning_content;ctx.totalTextpopulated from</think>-marked thinking;reasoning_content,totalTextstays empty.tests/unit/cursor-streaming.test.ts— 20/20 green (no regression).npx eslint open-sse/executors/cursor.ts tests/unit/cursor-composer-thinking.test.ts— clean.npx tsc -p tsconfig.json --noEmit— no new errors in changed files (5 pre-existing drift errors in unrelated tests).