Skip to content

Commit 8e993a6

Browse files
committed
fix(cline-pass): repair stale OMP reasoning tiers
1 parent e216617 commit 8e993a6

9 files changed

Lines changed: 52 additions & 37 deletions

File tree

‎docs-site/src/content/docs/ja/reference/adapters.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ interface ProviderAdapter {
3535
プロバイダーが明示的に alias を設定しない限り、`xhigh` と `max` は異なるラベルのまま保ちます。`provider.noReasoningModels` に含まれる id には値を **一切送りません**。
3636
- `delta.content`(テキスト)、`delta.reasoning_content`(thinking)、`delta.tool_calls[]` を
3737
ストリーミングし、`usage` を収集します。
38-
- ClinePass は、ライブ検証済みのゲートウェイ形式 `reasoning: { enabled: true, effort: "low" }`
38+
- ClinePass は、ライブ検証済みのゲートウェイ形式 `reasoning: { enabled: true, effort }`
3939
(reasoning を無効にする場合は `{ enabled: false }`)を使用します。公開 API ドキュメントには
40-
現在このリクエスト形式が明記されていません。アダプターは他の effort リクエストを検証済みの
41-
`low` に調整し、`delta.reasoning_content` または `delta.reasoning` を reasoning delta として扱い、
42-
`stream_options.include_usage` でストリーム usage を要求し、非ストリームのレスポンス envelope からも usage を読み取ります。
40+
現在このリクエスト形式が明記されていません。アダプターは要求された `low`、`medium`、`high`、
41+
`xhigh`、`max` tier をそのまま保持し、`delta.reasoning_content` または `delta.reasoning` を
42+
reasoning delta として扱い、`stream_options.include_usage` でストリーム usage を要求し、非ストリームのレスポンス envelope からも usage を読み取ります。
4343

4444
## `openai-responses`
4545

‎docs-site/src/content/docs/ko/reference/adapters.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ interface ProviderAdapter {
4141
유지합니다. `provider.noReasoningModels`에 든 id에는 값을 **아예 보내지 않습니다**.
4242
- `delta.content`(텍스트), `delta.reasoning_content`(thinking), `delta.tool_calls[]`를
4343
스트리밍하고 `usage`를 수집합니다.
44-
- ClinePass는 라이브로 검증된 게이트웨이 형식 `reasoning: { enabled: true, effort: "low" }`을
45-
사용하며, reasoning을 끌 때는 `{ enabled: false }`를 사용합니다. 공개 API 문서에는 현재 이 요청
46-
형식이 명시되어 있지 않습니다. 어댑터는 다른 effort 요청을 검증된 `low`로 조정하고,
47-
`delta.reasoning_content` 또는 `delta.reasoning`을 reasoning delta로 처리하며,
44+
- ClinePass는 라이브로 검증된 게이트웨이 형식 `reasoning: { enabled: true, effort }`을 사용하며,
45+
reasoning을 끌 때는 `{ enabled: false }`를 사용합니다. 공개 API 문서에는 현재 이 요청 형식이
46+
명시되어 있지 않습니다. 어댑터는 요청한 `low`, `medium`, `high`, `xhigh`, `max` 단계를 그대로
47+
유지하고, `delta.reasoning_content` 또는 `delta.reasoning`을 reasoning delta로 처리하며,
4848
`stream_options.include_usage`로 스트림 usage를 요청하고 비스트림 응답 envelope에서도 usage를 읽습니다.
4949

5050
## `openai-responses`

‎docs-site/src/content/docs/reference/adapters.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ provider — xAI, Kimi, DeepSeek, GLM, Groq, OpenRouter, Ollama (local & cloud),
4141
adapter **omits it entirely** for ids in `provider.noReasoningModels`.
4242
- Streams `delta.content` (text), `delta.reasoning_content` (thinking), and `delta.tool_calls[]`;
4343
collects `usage`.
44-
- ClinePass uses the live-verified gateway format `reasoning: { enabled: true, effort: "low" }`
45-
(or `{ enabled: false }` when reasoning is disabled); its public API docs do not currently specify
46-
this request shape. The adapter clamps other effort requests to the verified `low` tier, accepts
47-
reasoning deltas from either `delta.reasoning_content` or `delta.reasoning`, requests streamed
48-
usage with `stream_options.include_usage`, and reads usage from non-stream response envelopes.
44+
- ClinePass uses the live-verified gateway format `reasoning: { enabled: true, effort }` (or
45+
`{ enabled: false }` when reasoning is disabled); its public API docs do not currently specify
46+
this request shape. The adapter preserves requested `low`, `medium`, `high`, `xhigh`, and `max`
47+
tiers, accepts reasoning deltas from either `delta.reasoning_content` or `delta.reasoning`, requests
48+
streamed usage with `stream_options.include_usage`, and reads usage from non-stream response envelopes.
4949

5050
## `openai-responses`
5151

‎docs-site/src/content/docs/ru/reference/adapters.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ interface ProviderAdapter {
4545
- Стримит `delta.content` (текст), `delta.reasoning_content` (thinking) и `delta.tool_calls[]`;
4646
собирает `usage`.
4747
- ClinePass использует проверенный на живом API формат шлюза
48-
`reasoning: { enabled: true, effort: "low" }` (или `{ enabled: false }`, когда reasoning отключён);
49-
в публичной документации API этот формат запроса пока не указан. Адаптер прижимает другие
50-
уровни effort к проверенному `low`, принимает reasoning delta из `delta.reasoning_content` или
51-
`delta.reasoning`, запрашивает usage потока через `stream_options.include_usage` и читает usage
52-
из envelope нестримингового ответа.
48+
`reasoning: { enabled: true, effort }` (или `{ enabled: false }`, когда reasoning отключён);
49+
в публичной документации API этот формат запроса пока не указан. Адаптер сохраняет запрошенный
50+
уровень `low`, `medium`, `high`, `xhigh` или `max`, принимает reasoning delta из
51+
`delta.reasoning_content` или `delta.reasoning`, запрашивает usage потока через
52+
`stream_options.include_usage` и читает usage из envelope нестримингового ответа.
5353

5454
## `openai-responses`
5555

‎docs-site/src/content/docs/zh-cn/reference/adapters.md‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,10 @@ interface ProviderAdapter {
3838
省略**该参数。
3939
- 流式输出 `delta.content`(文本)、`delta.reasoning_content`(thinking)和
4040
`delta.tool_calls[]`,并收集 `usage`。
41-
- ClinePass 使用经实时验证的网关格式 `reasoning: { enabled: true, effort: "low" }`;关闭
42-
reasoning 时使用 `{ enabled: false }`。其公开 API 文档目前没有说明这一请求格式。adapter 会把
43-
其他 effort 请求限制到已验证的 `low`,把 `delta.reasoning_content` 或 `delta.reasoning`
44-
作为 reasoning delta,通过 `stream_options.include_usage` 请求流式 usage,并从非流式响应
45-
envelope 中读取 usage。
41+
- ClinePass 使用经实时验证的网关格式 `reasoning: { enabled: true, effort }`;关闭 reasoning 时使用
42+
`{ enabled: false }`。其公开 API 文档目前没有说明这一请求格式。adapter 会保留请求的 `low`、
43+
`medium`、`high`、`xhigh` 或 `max` 档位,把 `delta.reasoning_content` 或 `delta.reasoning`
44+
作为 reasoning delta,通过 `stream_options.include_usage` 请求流式 usage,并从非流式响应 envelope 中读取 usage。
4645

4746
## `openai-responses`
4847

‎docs-site/src/content/docs/zh-tw/guides/providers.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,9 @@ preset。儀表板的 **Add provider** picker 會開啟 key provider 的 dashboa
226226
與 [Chat Completions endpoint](https://docs.cline.bot/api/chat-completions),由 Cline Bot Inc. 依
227227
[Cline terms](https://cline.bot/tos) 提供。像 `cline-pass/cline-pass/kimi-k3` 這類 routed id 是刻意設計:
228228
第一段選擇 opencodex provider,後面的 `cline-pass/kimi-k3` 才是送往上游的完整 model slug。ClinePass
229-
quota 由帳號共用,包含 rolling 5-hour、weekly 與 monthly limit。opencodex 目前只宣告 live-verified
230-
`low` reasoning tier;更高 requested tier 會 clamp 到 `low`,直到 gateway 發布或驗證更廣的 ladder。
229+
quota 由帳號共用,包含 rolling 5-hour、weekly 與 monthly limit。2026-08-13 的 live probe 已確認所有
230+
靜態 ClinePass model 在 gateway input 都接受 `low`、`medium`、`high`、`xhigh` 與 `max`。opencodex
231+
會保留 requested tier;backend-specific normalization 由 ClinePass 負責。
231232

232233
**Cline** 使用相同 API key 與 endpoint,但採 pay-as-you-go 用量計費,可使用 100+ 模型,包括
233234
OpenRouter 風格 id,例如 `anthropic/claude-sonnet-4-6`。Cline 的 promotional free model 只提供給 Cline

‎src/providers/derive.ts‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,14 @@ function enrichReasoningSummariesByDestination(prov: OcxProviderConfig): void {
393393
applyReasoningSummaryDefaults(prov, destination?.modelSupportsReasoningSummaries);
394394
}
395395

396+
/** Repair the exact low-only ClinePass ladder generated by older key-login presets. */
397+
export function hasLegacyClinePassReasoningEfforts(name: string, prov: OcxProviderConfig): boolean {
398+
return name === "cline-pass"
399+
&& prov.reasoningWireFormat === "gateway-object"
400+
&& prov.reasoningEfforts?.length === 1
401+
&& prov.reasoningEfforts[0] === "low";
402+
}
403+
396404
export function enrichProviderFromRegistry(name: string, prov: OcxProviderConfig): void {
397405
const entry = PROVIDER_REGISTRY.find(row => row.id === name);
398406
if (!entry || !providerMatchesRegistryTransportWithStaticGuards(name, prov)) {
@@ -426,7 +434,9 @@ export function enrichProviderFromRegistry(name: string, prov: OcxProviderConfig
426434
if (seed.modelInputModalities) prov.modelInputModalities = fillRecordOfArrays(seed.modelInputModalities, prov.modelInputModalities);
427435
if (prov.defaultMaxOutputTokens === undefined && seed.defaultMaxOutputTokens !== undefined) prov.defaultMaxOutputTokens = seed.defaultMaxOutputTokens;
428436
if (!prov.modelMaxOutputTokens && seed.modelMaxOutputTokens) prov.modelMaxOutputTokens = { ...seed.modelMaxOutputTokens };
429-
if (!prov.reasoningEfforts && seed.reasoningEfforts) prov.reasoningEfforts = [...seed.reasoningEfforts];
437+
if ((!prov.reasoningEfforts || hasLegacyClinePassReasoningEfforts(name, prov)) && seed.reasoningEfforts) {
438+
prov.reasoningEfforts = [...seed.reasoningEfforts];
439+
}
430440
if (!prov.modelReasoningEfforts && seed.modelReasoningEfforts) prov.modelReasoningEfforts = cloneRecordOfArrays(seed.modelReasoningEfforts);
431441
if (!prov.modelDefaultReasoningEfforts && seed.modelDefaultReasoningEfforts) prov.modelDefaultReasoningEfforts = { ...seed.modelDefaultReasoningEfforts };
432442
if (!prov.reasoningEffortMap && seed.reasoningEffortMap) prov.reasoningEffortMap = { ...seed.reasoningEffortMap };

‎src/router.ts‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { hasOwnProvider, resolveEnvValue } from "./config";
1212
import { assertProviderDestinationAllowed } from "./lib/destination-policy";
1313
import { redactSecretString, redactUrlForLog } from "./lib/redact";
1414
import { PROVIDER_REGISTRY, providerCodexAccountMode } from "./providers/registry";
15-
import { applyDirectReasoningEffortContracts } from "./providers/derive";
15+
import { applyDirectReasoningEffortContracts, hasLegacyClinePassReasoningEfforts } from "./providers/derive";
1616
import {
1717
providerMatchesRegistryTransportWithStaticGuards,
1818
providerSupportsLiveModelDiscovery,
@@ -286,14 +286,6 @@ export function routedProviderConfig(providerName: string, provider: OcxProvider
286286
const modelReasoningEffortMap = mergeNestedRecord(registryEntry.modelReasoningEffortMap, provider.modelReasoningEffortMap);
287287
const modelReasoningEfforts = mergeStringArrayRecord(registryEntry.modelReasoningEfforts, provider.modelReasoningEfforts);
288288
const modelDefaultReasoningEfforts = mergeRecordFill(registryEntry.modelDefaultReasoningEfforts, provider.modelDefaultReasoningEfforts);
289-
// Key-login used to persist this exact low-only ClinePass capability seed. Once the gateway's
290-
// wider input ladder was live-verified, leaving that generated row untouched would keep old
291-
// installs clamped forever. This branch is reached only after canonical transport matching, so
292-
// same-named custom destinations and every other explicit ladder still retain user precedence.
293-
const repairLegacyClinePassReasoningEfforts = providerName === "cline-pass"
294-
&& provider.reasoningWireFormat === "gateway-object"
295-
&& provider.reasoningEfforts?.length === 1
296-
&& provider.reasoningEfforts[0] === "low";
297289
const modelContextWindows = providerName === OPENAI_API_PROVIDER_ID
298290
? mergePositiveNumberCaps(registryEntry.modelContextWindows, provider.modelContextWindows)
299291
: mergeRecordFill(registryEntry.modelContextWindows, provider.modelContextWindows);
@@ -374,7 +366,7 @@ export function routedProviderConfig(providerName: string, provider: OcxProvider
374366
...(provider.project === undefined && registryEntry.project !== undefined ? { project: registryEntry.project } : {}),
375367
...(provider.location === undefined && registryEntry.location !== undefined ? { location: registryEntry.location } : {}),
376368
...(provider.contextWindow === undefined && registryEntry.contextWindow !== undefined ? { contextWindow: registryEntry.contextWindow } : {}),
377-
...((provider.reasoningEfforts === undefined || repairLegacyClinePassReasoningEfforts)
369+
...((provider.reasoningEfforts === undefined || hasLegacyClinePassReasoningEfforts(providerName, provider))
378370
&& registryEntry.reasoningEfforts !== undefined
379371
? { reasoningEfforts: [...registryEntry.reasoningEfforts] }
380372
: {}),

‎tests/cline-pass-provider.test.ts‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test";
22
import { createOpenAIChatAdapter } from "../src/adapters/openai-chat";
33
import { createTranslatorBudget } from "../src/lib/translator-budget";
44
import { KEY_LOGIN_PROVIDERS } from "../src/oauth/key-providers";
5-
import { providerConfigSeed } from "../src/providers/derive";
5+
import { enrichProviderFromRegistry, providerConfigSeed } from "../src/providers/derive";
66
import { PROVIDER_REGISTRY } from "../src/providers/registry";
77
import { routeModel } from "../src/router";
88
import type { OcxConfig, OcxParsedRequest } from "../src/types";
@@ -88,6 +88,19 @@ describe("ClinePass provider", () => {
8888
expect(seed).not.toHaveProperty("preserveCustomDestination");
8989
});
9090

91+
test("catalog enrichment repairs the low-only ladder persisted by older ClinePass presets", () => {
92+
const stale = providerConfigSeed(registryEntry());
93+
stale.reasoningEfforts = ["low"];
94+
95+
enrichProviderFromRegistry("cline-pass", stale);
96+
97+
expect(stale.reasoningEfforts).toEqual(["low", "medium", "high", "xhigh", "max"]);
98+
99+
const custom = { ...stale, baseUrl: "https://custom.example/v1", reasoningEfforts: ["low"] };
100+
enrichProviderFromRegistry("cline-pass", custom);
101+
expect(custom.reasoningEfforts).toEqual(["low"]);
102+
});
103+
91104
test("routing keeps the full upstream model slug and emits the Cline gateway reasoning object", () => {
92105
const config: OcxConfig = {
93106
port: 10100,

0 commit comments

Comments
 (0)