Skip to content

feat(provider): add ClinePass subscription provider - #880

Merged
Wibias merged 11 commits into
lidge-jun:devfrom
n3wr1ch:feat/cline-pass-provider
Aug 3, 2026
Merged

feat(provider): add ClinePass subscription provider#880
Wibias merged 11 commits into
lidge-jun:devfrom
n3wr1ch:feat/cline-pass-provider

Conversation

@n3wr1ch

@n3wr1ch n3wr1ch commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add ClinePass as a canonical API-key provider preset with the 11 model slugs published by Cline
  • preserve full cline-pass/<model> upstream ids and seed context-window and input-modality metadata
  • support the gateway's reasoning object, non-stream response envelope, reasoning deltas, choice-scoped stream errors, and safe numeric error classification
  • expose reasoningWireFormat through the safe management DTO and keep GUI diagnostics, provider docs, and all five documentation locales synchronized

Why

Cline officially supports using ClinePass outside the Cline clients through its OpenAI-compatible Chat Completions API. OpenCodex previously had no canonical preset for that subscription route, so users had to configure the endpoint manually and would lose gateway-specific reasoning, error, and non-stream response behavior.

The adapter fixes are intentionally shared where they describe valid OpenAI-compatible response behavior. Regression coverage protects ordinary non-Cline providers from changes to standard response parsing and pending tool-call termination.

Primary-source evidence

Verified 2026-08-02:

The public API reference does not currently document the reasoning: { enabled, effort } request object or the { success, error, data } non-stream envelope. Those two shapes are explicitly marked in code as live-observed on 2026-08-02. Only the live-accepted low reasoning tier is advertised until Cline documents or validates a broader ladder.

Security and privacy

  • the new credential destination is fixed to https://api.cline.bot/api/v1
  • same-named custom providers retain their custom destination and credential boundary
  • API keys and response bodies are not logged
  • arbitrary upstream metadata is discarded; only a bounded request id with an allowlisted character set is retained, and secret-shaped values are rejected by the existing redactor
  • reasoningWireFormat is added only to the existing non-secret management DTO allowlist

This provider preset changes a credential destination and therefore requires explicit security review before merge.

Validation

  • bun run typecheck
  • bun run test — 6,973 passed, 8 skipped, 0 failed
  • focused ClinePass/OpenAI Chat/management/request-log tests — 156 passed, 0 failed
  • bun run privacy:scan
  • cd gui && bun test tests — 493 passed, 0 failed
  • cd gui && bun run lint
  • cd gui && bun run build
  • cd docs-site && bun install --frozen-lockfile
  • cd docs-site && bun run build — 206 pages built

Summary by CodeRabbit

  • New Features

    • Added ClinePass as a built-in provider with model routing, supported modalities, subscription details, and usage limits.
    • Added support for gateways using object-based reasoning settings, including automatic provider configuration.
    • Improved reasoning metadata and response handling for streaming, wrapped responses, usage details, and errors.
  • Documentation

    • Updated setup guides and provider catalogs across supported languages to reflect 67 built-in presets and document ClinePass.
  • Bug Fixes

    • Improved request logging, validation, and upstream error handling, including boolean reasoning values and request identifiers.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change adds the ClinePass provider preset, gateway-object reasoning configuration, hardened OpenAI-compatible response handling, boolean reasoning diagnostics, tests, and localized documentation.

Changes

ClinePass gateway integration

Layer / File(s) Summary
Gateway reasoning configuration and diagnostics
src/types.ts, src/adapters/base.ts, src/providers/*, src/server/*, src/usage/log.ts, gui/src/*, docs-site/src/content/docs/*/reference/configuration/providers.md
Adds reasoningWireFormat?: "gateway-object" and propagates it through provider configuration. Reasoning logs and persisted usage support validated boolean wire values.
ClinePass registry and documentation
src/providers/registry.ts, tests/provider-registry-parity.test.ts, tests/cline-pass-provider.test.ts, docs-site/src/content/docs/*/guides/providers.md, docs-site/src/content/docs/*/getting-started/quickstart.md, docs-site/src/content/docs/*/reference/adapters.md
Adds ClinePass models, routing, modalities, limits, endpoint metadata, and low-only gateway reasoning. Updates provider counts and localized documentation.
OpenAI-compatible request and response handling
src/adapters/openai-chat.ts, tests/openai-chat-eof.test.ts, tests/openai-chat-hardening.test.ts
Serializes gateway-object reasoning, unwraps responses, normalizes errors, handles alternate reasoning fields and finish reasons, preserves usage, and avoids fabricated tool-call completions.
Reasoning diagnostics validation
tests/request-log.test.ts, tests/usage-log.test.ts, tests/server-auth.test.ts
Validates boolean reasoning logging, usage normalization, and sanitized configuration output.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant openaiChatAdapter
  participant ClinePassGateway
  participant RequestLog
  Client->>openaiChatAdapter: Send provider request
  openaiChatAdapter->>ClinePassGateway: Send gateway-object reasoning payload
  ClinePassGateway-->>openaiChatAdapter: Return wrapped response or normalized error data
  openaiChatAdapter->>RequestLog: Record reasoning wire fields and usage
  openaiChatAdapter-->>Client: Emit reasoning, completion, usage, or error events
Loading

Possibly related PRs

  • lidge-jun/opencodex#385: Both changes add an API-key provider preset and update provider-registry parity expectations.
  • lidge-jun/opencodex#483: Both changes improve structured upstream error handling in src/adapters/openai-chat.ts.
  • lidge-jun/opencodex#494: Both changes extend reasoning-wire diagnostics across adapters, logs, persisted usage, and the Logs UI.

Suggested reviewers: ingwannu, lidge-jun, wibias

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding the ClinePass subscription provider.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 2, 2026
@n3wr1ch
n3wr1ch marked this pull request as ready for review August 2, 2026 09:54

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs-site/src/content/docs/guides/providers.md`:
- Around line 193-210: Update the openai-chat adapter reference in the primary
and ja, ko, ru, and zh-cn localized documents to document ClinePass, including
its reasoning object format, the live-verified low reasoning clamp, reasoning
deltas, and usage handling. Use the existing provider guide’s ClinePass facts
and keep the documentation consistent across all adapter references.

In `@src/adapters/base.ts`:
- Around line 51-56: Update the reasoningLog type in the adapter base definition
to a discriminated union keyed by wireField, pairing each field with its valid
wireValue type: boolean only for "reasoning.enabled", numeric values for
"thinking_budget", and string values for the remaining reasoning fields.
Preserve effectiveEffort on every union member so producers and
recordAdapterReasoning retain the existing diagnostics contract.

In `@src/router.ts`:
- Around line 279-281: Add a route test for a matching ClinePass provider whose
config explicitly sets reasoningWireFormat to "gateway-object". Assert that
routeModel() preserves this explicit value rather than replacing it with the
registry entry, alongside the existing registry-backfill and
non-matching-provider cases in cline-pass-provider.test.ts.

In `@src/usage/log.ts`:
- Around line 271-277: Update normalizeUsageAttempt and normalizeUsageEntry so
boolean reasoningWireValue is preserved only when the corresponding
reasoningWireField equals "reasoning.enabled", matching recordAdapterReasoning;
continue accepting string values and non-negative finite numeric values through
their existing paths, and omit mismatched boolean pairs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 97bd7df2-f305-4852-beef-9753dc6a982b

📥 Commits

Reviewing files that changed from the base of the PR and between f9b9440 and fef239b.

📒 Files selected for processing (33)
  • docs-site/src/content/docs/getting-started/quickstart.md
  • docs-site/src/content/docs/guides/providers.md
  • docs-site/src/content/docs/ja/getting-started/quickstart.md
  • docs-site/src/content/docs/ja/guides/providers.md
  • docs-site/src/content/docs/ja/reference/configuration/providers.md
  • docs-site/src/content/docs/ko/getting-started/quickstart.md
  • docs-site/src/content/docs/ko/guides/providers.md
  • docs-site/src/content/docs/ko/reference/configuration/providers.md
  • docs-site/src/content/docs/reference/configuration/providers.md
  • docs-site/src/content/docs/ru/getting-started/quickstart.md
  • docs-site/src/content/docs/ru/guides/providers.md
  • docs-site/src/content/docs/ru/reference/configuration/providers.md
  • docs-site/src/content/docs/zh-cn/getting-started/quickstart.md
  • docs-site/src/content/docs/zh-cn/guides/providers.md
  • docs-site/src/content/docs/zh-cn/reference/configuration/providers.md
  • gui/src/hooks/useJsonConfigEditor.ts
  • gui/src/pages/Logs.tsx
  • gui/src/pages/providers-shared.ts
  • src/adapters/base.ts
  • src/adapters/openai-chat.ts
  • src/providers/derive.ts
  • src/providers/registry.ts
  • src/router.ts
  • src/server/auth-cors.ts
  • src/server/request-log.ts
  • src/types.ts
  • src/usage/log.ts
  • tests/cline-pass-provider.test.ts
  • tests/openai-chat-eof.test.ts
  • tests/openai-chat-hardening.test.ts
  • tests/provider-registry-parity.test.ts
  • tests/request-log.test.ts
  • tests/server-auth.test.ts

Comment thread docs-site/src/content/docs/guides/providers.md Outdated
Comment thread src/adapters/base.ts Outdated
Comment thread src/router.ts
Comment thread src/usage/log.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/adapters/openai-chat.ts`:
- Around line 105-115: In src/adapters/openai-chat.ts lines 105-115, update
upstreamErrorEvent to sanitize rawMessage for credential-shaped API keys, bearer
tokens, and OAuth values before constructing message, while preserving benign
text and replacing secrets with a fixed redaction marker. In
tests/cline-pass-provider.test.ts lines 241-245, add a secret-shaped upstream
error fixture and assert the emitted message does not contain the original
secret.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: fcb349ea-76da-45c0-9858-4b7ef18e1afe

📥 Commits

Reviewing files that changed from the base of the PR and between 0bedc56 and ac9a858.

📒 Files selected for processing (2)
  • src/adapters/openai-chat.ts
  • tests/cline-pass-provider.test.ts

Comment thread src/adapters/openai-chat.ts Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/adapters/openai-chat.ts (1)

1050-1054: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Preserve usage in the failure-envelope fallback.

If json.success === false and the unwrapped payload has no error, this return occurs before usage is parsed. A malformed failure response that includes usage therefore loses that metadata, while the later no-choice and no-message branches preserve it.

Move usage extraction before this check and include it in the fallback error. Add a regression fixture with success: false, usage, and no error.

Proposed fix
       const payload = unwrapChatCompletionPayload(json);
+      const usage = usageFromOpenAIChat(payload.usage as Record<string, unknown> | undefined);
       if (json.success === false && payload.error === undefined) {
-        return [{ type: "error", message: "upstream reported failure without an error payload" }];
+        return [{
+          type: "error",
+          message: "upstream reported failure without an error payload",
+          ...(usage ? { usage } : {}),
+        }];
       }
-      const usage = usageFromOpenAIChat(payload.usage as Record<string, unknown> | undefined);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/adapters/openai-chat.ts` around lines 1050 - 1054, In the response
handling flow around unwrapChatCompletionPayload, extract usage before the
json.success === false fallback check and include the parsed usage in that error
result. Preserve existing behavior for normal failure and no-choice/no-message
paths, and add a regression fixture covering success: false with usage present
but no error.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/adapters/openai-chat.ts`:
- Around line 1050-1054: In the response handling flow around
unwrapChatCompletionPayload, extract usage before the json.success === false
fallback check and include the parsed usage in that error result. Preserve
existing behavior for normal failure and no-choice/no-message paths, and add a
regression fixture covering success: false with usage present but no error.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6f01aa80-dd5b-4b24-82e7-2bb5be8f9cd5

📥 Commits

Reviewing files that changed from the base of the PR and between ac9a858 and e87af97.

📒 Files selected for processing (2)
  • src/adapters/openai-chat.ts
  • tests/cline-pass-provider.test.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/adapters/openai-chat.ts (2)

850-856: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use explicit error-presence checks.

In src/adapters/openai-chat.ts, Line 850 and Line 1059 use truthiness to detect errors. This skips numeric 0 and empty-string errors, even though the adapter now classifies numeric and string upstream errors. In the streaming path, the adapter can then emit a successful done event. In the non-stream path, it reports the wrong no-choices error. Handle only missing or null values as absent, and pass other values to upstreamErrorEvent.

As per path instructions, add focused Bun regressions under tests/** for streaming and non-streaming error payloads.

Also applies to: 1052-1060

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/adapters/openai-chat.ts` around lines 850 - 856, Replace truthiness-based
error checks in the streaming branch around chunk.error and the non-streaming
branch near the corresponding error handling with explicit checks that treat
only missing or null values as absent; pass numeric 0 and empty-string payloads
to upstreamErrorEvent. Add focused Bun regressions under tests/** covering both
streaming and non-streaming numeric/string upstream error payloads, including
the streaming terminate/error event and correct non-stream error behavior.

Source: Path instructions


865-873: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Validate response choice shapes before dereferencing.

In src/adapters/openai-chat.ts, Line 870 allows choices: {} to pass the stream guard. Line 871 then reads choices[0].finish_reason and throws. In the non-stream path, Line 1072 accepts choices: [null], and Line 1073 dereferences the null value. These malformed upstream responses reject the request with an uncaught TypeError instead of a normalized adapter error.

Check Array.isArray(choices) and validate that the first choice is a non-null object before reading finish_reason, delta, message, or error. Preserve usage-only frames when choices is absent, but terminate with a normalized malformed-response error for invalid choice shapes.

As per path instructions, add focused Bun regressions under tests/** for invalid stream and non-stream choice shapes.

Also applies to: 1063-1074

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/adapters/openai-chat.ts` around lines 865 - 873, Validate response shapes
in the streaming and non-streaming parsing paths around the choices handling:
require choices to be an array when present and require its first entry to be a
non-null object before accessing finish_reason, delta, message, or error.
Preserve usage-only frames when choices is absent, but route malformed
choices—including an empty object or [null]—through the adapter’s normalized
malformed-response error handling. Add focused Bun regressions under tests/**
covering invalid stream and non-stream choice shapes.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/adapters/openai-chat.ts`:
- Around line 850-856: Replace truthiness-based error checks in the streaming
branch around chunk.error and the non-streaming branch near the corresponding
error handling with explicit checks that treat only missing or null values as
absent; pass numeric 0 and empty-string payloads to upstreamErrorEvent. Add
focused Bun regressions under tests/** covering both streaming and non-streaming
numeric/string upstream error payloads, including the streaming terminate/error
event and correct non-stream error behavior.
- Around line 865-873: Validate response shapes in the streaming and
non-streaming parsing paths around the choices handling: require choices to be
an array when present and require its first entry to be a non-null object before
accessing finish_reason, delta, message, or error. Preserve usage-only frames
when choices is absent, but route malformed choices—including an empty object or
[null]—through the adapter’s normalized malformed-response error handling. Add
focused Bun regressions under tests/** covering invalid stream and non-stream
choice shapes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9f420986-e319-44fb-b27f-1d4f3ea97844

📥 Commits

Reviewing files that changed from the base of the PR and between e87af97 and 5ae77cb.

📒 Files selected for processing (2)
  • src/adapters/openai-chat.ts
  • tests/cline-pass-provider.test.ts

Wibias commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

[shipping-github] Verdict: approve-comment

PR: #880 — feat(provider): add ClinePass subscription provider
Head: a1cea886 on dev (mergeStateStatus: clean)

Semantic propagation

  • Concepts audited: reasoningWireFormat gateway capability; boolean reasoning wire diagnostics; ClinePass + Cline registry presets; shared non-stream envelope/error normalization; stopReason on non-stream done; bounded request-id retention in error messages
  • Authoritative sources: src/types.ts (OcxProviderConfig.reasoningWireFormat), src/providers/registry.ts (cline-pass/cline entries; external Cline docs cited in-code), src/adapters/base.ts (AdapterRequest.reasoningLog), OpenAI-compatible Chat Completions contract plus the observed Cline envelope
  • Producers and consumers checked: registry → derive seed/enrich/key-login → router backfill → adapter request build + stream/non-stream parsing → request-log + usage-log normalization → bridge error/stopReason classification → GUI config types + Logs display → docs in all 5 locales
  • Public/derived representations checked: safe management DTO allowlist (auth-cors.ts), GUI config editor + providers-shared types, provider icon aliases, docs preset counts (68 presets / 57 key-based verified exactly against the registry)
  • Material variant partitions checked: gateway-object × {none, low, clamped high, noReasoningModels} vs standard × {thinking_budget, thinking.type, reasoning_effort}; cline-pass image vs text-only models; direct / wrapped / failure envelopes; string / numeric / choice-scoped errors; same-named custom providers (transport match fails closed via preserveCustomDestination)
  • Positive and negative assertions checked: reasoning_effort absent for gateway-object; boolean wire value only for reasoning.enabled; secret-shaped request ids rejected; malformed choice shapes normalized; docs counts exact
  • Unmapped surfaces: none
  • Unproven equivalence assumptions: none
  • Representation mismatches: none
  • Variant coverage gaps: none
  • Axis verdict: pass

Linked: none

Usefulness

Real user value: a canonical ClinePass preset with the 11 documented subscription slugs, a Cline usage-billing preset, and shared adapter hardening (non-stream {success, error, data} envelope, delta.reasoning, choice-scoped stream errors, numeric/string error classification, secret redaction, usage retention on failure envelopes, pending tool-call discard on terminal errors). The adapter changes are shared only where they describe valid OpenAI-compatible behavior, with regression coverage protecting ordinary providers.

Bugs / correctness

  • Method: bug-review.md — Bugbot: n/a-unavailable (Codex host); complementary: done (silent_failures / resource_leaks / edge_cases + error-mapping / finally must-probes)
  • Findings: none blocking. Malformed upstream shapes (choices: {}, [null], error: 0, error: "") now yield normalized errors instead of uncaught TypeErrors; truncated tool-call streams fail closed; finally blocks never mask the original error
  • Fixed this session: none (prior fixes verified in code + tests on this head)

Security

  • Scope reviewed: credential destination (api.cline.bot/api/v1 fixed), same-name custom-provider boundary, request-id allowlist/redaction, safe DTO allowlist, logging/privacy, shared error normalization
  • Findings: none confirmed
  • Fixed this session: none

Spec / standards

  • Spec source: PR body; the diff matches the claimed scope including the additional cline preset the body documents
  • Gaps: none code-level. Two observations: the auto-generated CodeRabbit summary in the body still says "67 presets" (docs and registry say 68), and the dev merge carries devlog/ plan files that upstream dev tracks as a plain directory (the submodule description in AGENTS.md appears stale upstream); neither is changed by this PR

Reviews

  • Owners/maintainers: no human reviews posted yet; requested reviewers are @Wibias @Ingwannu @lidge-jun
  • Bots (CodeRabbit): cleared. All 5 inline threads and both outside-diff findings carry "Addressed in commit ..." markers; I verified each fix in the current code and its regression tests (usage retention, discriminated reasoningLog union, explicit-value route test, boolean pairing gate, error redaction)

Base / CI

  • Behind/conflicts: updated from dev twice in this review — af1d366e (dev 84efd2460) and a1cea886 (dev c72acb3e); no conflicts, mergeable_state: clean
  • Required checks: green on a1cea886ubuntu, macos, windows, npm-global ×3, select windows runner, react-doctor, enforce-target, label
  • Local tip compile/tests: bun x tsc --noEmit pass; focused ClinePass/OpenAI-chat/log suite 136/136; full suite shows no new failures vs the pre-merge baseline (remaining failures are sandbox temp-dir ACL artifacts that reproduce identically on clean dev); privacy:scan pass; GUI tests 525/525, lint and build pass

Gate

No draft/WIP/do-not-merge; enforce-target green. The ship-gate.mjs result is unknown rather than ready only because branch-protection rulesets and review-thread resolution state cannot be queried without authenticated GraphQL from this review machine; the CodeRabbit threads carry the bot's own "Addressed" markers and were code-verified. dev has since landed 8 workflow-only commits (CI sharding, PR #899) that were intentionally not folded into this provider PR; GitHub reports mergeable: true with no conflicts.

Simplification (approved)

Approved candidates C1-C6 applied and validated, no rollback needed:

  • 9a5b1363refactor(openai-chat): extracted stopReasonFor, reasoningTextFrom, invalidChoicesEvent; unified tool-call closing (closeToolCalls) and the terminal stream error sequence (terminateWithError); removed discardToolCalls
  • 20ea4242refactor(usage): single-sourced the reasoning wire-value pairing rule (isValidReasoningWireValue) across the live capture path and both persisted normalizers

Validation on the post-simplification head: typecheck, 136/136 focused tests, full-suite no-regression, privacy scan, GUI tests/lint/build — all green; each commit is independently revertable. The complete full review was re-run on the exact post-simplification head with simplification disabled.

Bottom line

Useful, well-tested provider addition with no confirmed bugs or security findings, all bot feedback addressed, CI green on a dev-merged head. Approve on this evidence; the only unverified items are GitHub-side (ruleset/thread-resolution state) that this machine cannot query — a maintainer's final look before merge covers them. If dev keeps moving, one more routine base refresh at merge time keeps it current.

n3wr1ch and others added 11 commits August 3, 2026 05:19
… helpers

Behavior-preserving simplification of the ClinePass adapter changes:
- stopReasonFor() single-sources the finish_reason mapping used by the
  stream, EOF-residual, and non-stream done events.
- reasoningTextFrom() shares the reasoning_content/reasoning delta
  extraction between stream and non-stream paths.
- invalidChoicesEvent() replaces the three identical invalid-choices
  error constructions.
- closeToolCalls() unifies the flush/discard/finally call-closing loops,
  and terminateWithError() shares the terminal stream error sequence.
isValidReasoningWireValue() now owns the value-shape invariant shared by
recordAdapterReasoning and both persisted-usage normalizers, so the
boolean-only-for-reasoning.enabled pairing cannot drift between the live
capture path and persisted rows.
@Wibias
Wibias force-pushed the feat/cline-pass-provider branch from a1cea88 to 6f1efd7 Compare August 3, 2026 03:21

Wibias commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Thanks @n3wr1ch — merging this.

Why it helps: opencodex gets a canonical ClinePass preset with the 11 documented subscription slugs plus a Cline usage-billing preset, so users can point Codex and Claude at Cline's gateway without hand-rolled config. It also hardens the shared openai-chat adapter for the gateway's non-stream envelope, reasoning deltas, choice-scoped stream errors, and credential redaction, with regression tests and all five doc locales covered.

Ship it.

@Wibias
Wibias merged commit fa51fce into lidge-jun:dev Aug 3, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants