Skip to content

fix: unwrap Cline response envelope - #6046

Merged
diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.44from
KooshaPari:fix/5956-cline-response-envelope
Jul 3, 2026
Merged

diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.44from
KooshaPari:fix/5956-cline-response-envelope

Conversation

@KooshaPari

Copy link
Copy Markdown
Contributor

Fixes the remaining non-streaming Cline response-envelope path from #5956.

Cline can return OpenAI-compatible chat completions wrapped as { success, data: { choices, usage, ... } }. The normal non-streaming path checked the top-level body for empty content and translated the top-level body, so wrapped Cline responses could be treated as malformed/empty instead of as chat completions.

Changes:

  • unwrap Cline { data: { choices } } envelopes immediately after provider envelope handling and before empty-content detection, logging, usage extraction, and response translation
  • keep malformed or non-Cline envelopes unchanged
  • add focused unit coverage for valid and malformed envelopes
  • add the new unit test to Stryker tap coverage and rebaseline inherited release/v3.8.44 file-size drift

Local validation:

  • npm exec --yes tsx -- --test tests/unit/cline-response-envelope.test.ts tests/unit/usage-extractor.test.ts
  • node scripts/check/check-file-size.mjs
  • node scripts/check/check-mutation-test-coverage.mjs --strict
  • git diff --check

Context:

@KooshaPari
KooshaPari requested a review from diegosouzapw as a code owner July 3, 2026 04:44
@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!

KooshaPari added a commit to KooshaPari/OmniRoute that referenced this pull request Jul 3, 2026
…rip, parseAutoConfig leaf, cline envelope (#264)

Bundles four upstream translator/SSE fixes into the fork:

- fix(translator/kiro): wrap system-origin content in <system-reminder>
  tags before merging into the Kiro/CodeWhisperer user message, so the
  system prompt no longer leaks as raw user text (diegosouzapw#6053).
- fix(translator/gemini): strip `multipleOf` from antigravity/gemini tool
  schemas at every level (top-level, nested, array items) — Gemini's
  OpenAPI 3.0 subset rejects it with a hard 400 (diegosouzapw#6052).
- refactor(sse): extract the pure `parseAutoConfig` leaf from combo.ts
  into open-sse/services/combo/autoConfig.ts (diegosouzapw#6049).
- fix(sse/cline): unwrap the Cline non-streaming response envelope so a
  content array of Anthropic-style text blocks is not misclassified as
  502 empty_choices (diegosouzapw#6046).

diegosouzapw#6002 (autoCombo fitness-source stabilize) is already on fork main via
diegosouzapw#5890 — not re-applied here.

Co-authored-by: VitzS7ven <209032696+VitzS7@users.noreply.github.com>
Co-authored-by: Muhammad Salsabil <74514963+abil0321@users.noreply.github.com>
Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@outlook.com>
# Conflicts:
#	config/quality/file-size-baseline.json
@diegosouzapw
diegosouzapw merged commit 772fea3 into diegosouzapw:release/v3.8.44 Jul 3, 2026
1 of 3 checks passed
hajilok added a commit to hajilok/OmniRoute that referenced this pull request Jul 3, 2026
…uth)

Per maintainer review (diegosouzapw#5924 comment): layer the OAuth login path onto diegosouzapw#5942's shipped API-key provider instead of re-adding clinepass. Resolved conflicts: keep diegosouzapw#5942's API-key registry + diegosouzapw#6046's chatCore envelope unwrap (drop my re-adds); make the executor conditional (OAuth credential -> buildClineHeaders workos:/X-CLIENT-*, API-key -> plain Bearer + Cline headers). Dual-auth wiring: clinepass in OAUTH_PROVIDERS catalog + OAuth flow map (clinepass: cline) reusing the Cline WorkOS flow, OAuthModal forceManual, Cline refresh path.

Verified: typecheck/lint clean, check-provider-consistency OK, docs-counts-sync 245, clinepass + oauth-providers-config tests 37/37; clinepass header shape confirmed (apiKey plain Bearer, oauth workos: + X-CLIENT-*). Golden translate-path snapshot updated (Linux-canonical; local OS noise only).
@diegosouzapw diegosouzapw mentioned this pull request Jul 4, 2026
@KooshaPari
KooshaPari deleted the fix/5956-cline-response-envelope branch August 13, 2026 06:53
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
Co-authored-by: KooshaPari <KooshaPari@users.noreply.github.com>
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.

2 participants