Skip to content

refactor(openai-shim): extract provider compatibility - #2003

Merged
kevincodex1 merged 5 commits into
Twigpine:mainfrom
jatmn:de-mono1-provider-compat
Jul 22, 2026
Merged

kevincodex1 merged 5 commits into
Twigpine:mainfrom
jatmn:de-mono1-provider-compat

Conversation

@jatmn

@jatmn jatmn commented Jul 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Extracts provider compatibility policy from src/services/api/openaiShim.ts into src/services/api/openaiShim/providerCompatibility.ts.

The module owns provider-host recognition, Anthropic/header filtering, NVIDIA NIM reasoning kwargs, GitHub-mode detection, and Gemini thought-signature handling. The façade delegates those decisions while retaining request orchestration.

All branches share stable source and test extraction seams so adjacent edits remain disjoint after any number of earlier PRs merge.

Independent merge

Source-file budget

src/services/api/openaiShim.ts: +59 / -150 = 209 changed lines, below the 1,500-line source-file cap. Test changes are excluded.

Test migration

  • src/services/api/openaiShim.test.ts: +686 / -794; 15 provider-compatibility test bodies are removed from the monolith.
  • src/services/api/openaiShim/providerCompatibility.test.ts: 606 lines / 13 focused tests.
  • Focused provider-compatibility plus retained façade suites: 223 passed / 654 assertions.
  • After all ten PRs merge, the monolithic test contains only three façade-contract tests.

Validation

  • git diff --check: passed.
  • bun run typecheck: passed.
  • bun run typecheck:type-tests: passed.
  • bun run build: passed.
  • Exact-head host bun run check: build, smoke, bundle, and dead-code checks passed; 7,184 passed / 2 skipped, with only the same 10 pre-existing PowerShell governance failures on Linux.

Prepared according to CONTRIBUTING.md and AGENTS.md.

Summary by CodeRabbit

  • Bug Fixes
    • Improved provider compatibility for Gemini, Cerebras, Mistral, GitHub Models, Anthropic, and NVIDIA NIM.
    • Added safer provider/header handling, including Anthropic header filtering and stricter host/model detection.
    • Preserved Gemini thought-signature metadata across follow-up tool calls and streaming responses.
    • Applied NVIDIA NIM “thinking” chat-template behavior only when reasoning is enabled, and preserved image-based tool results in OpenAI-compatible follow-ups.
  • Tests
    • Added an end-to-end compatibility test suite covering routing, headers, reasoning propagation, and Gemini thought-signature handling in both streaming and non-streaming cases.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Provider compatibility logic was extracted into providerCompatibility.ts, with openaiShim.ts delegating through imports and re-exports. New tests cover provider routing, header filtering, NVIDIA NIM reasoning fields, and Gemini thought-signature handling.

Changes

Provider compatibility extraction

Layer / File(s) Summary
Compatibility helper implementations
src/services/api/openaiShim/providerCompatibility.ts
Adds centralized helpers for GitHub mode, Anthropic header filtering, provider host detection, Gemini thought-signature handling, and NVIDIA NIM thinking fields.
OpenAI shim integration
src/services/api/openaiShim.ts
Replaces local compatibility implementations with delegated helpers and re-exports Mistral host detection.
Compatibility behavior validation
src/services/api/openaiShim/providerCompatibility.test.ts, src/services/api/openaiShim.test.ts
Adds focused compatibility tests and removes or updates overlapping shim tests.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: vasanthdev2004, kevincodex1

🚥 Pre-merge checks | ✅ 5 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
No Hidden Policy Change ⚠️ Warning The refactor also changes NVIDIA NIM policy: thinkingType: 'disabled' now suppresses chat_template_kwargs even when reasoningEffort is set. Document this behavior change explicitly and get maintainer approval; it’s a request-shaping policy change, not just cleanup.
Risk Surface Disclosed ❓ Inconclusive PR prose covers provider-routing/auth-adjacent surfaces, but no reviewer callout of blocker status was present in supplied artifacts. Need the actual review/comment thread or an explicit PR note stating the risk surface and whether it is a blocker.
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title is concise, scoped, and accurately describes extracting provider compatibility from openai-shim.
Description check ✅ Passed The description covers summary, merge context, validation, and test migration, but it omits the template's Impact, Testing checklist, and Notes sections.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 18, 2026
@jatmn jatmn self-assigned this Jul 18, 2026
@jatmn jatmn added the enhancement New feature or request label Jul 18, 2026
@jatmn
jatmn force-pushed the de-mono1-provider-compat branch from d097af8 to 193302a Compare July 18, 2026 16:20

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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/services/api/openaiShim.test.ts (1)

8008-8008: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Blocking: restore the NVIDIA streaming tool_stream regression test.

This behavior was not moved into providerCompatibility.test.ts, so deleting the test is unrelated cleanup and leaves NVIDIA streaming requests unprotected. Restore it here or relocate it into the focused suite.

As per coding guidelines, “Keep changes focused on one problem or feature and avoid mixing unrelated cleanup into the same change.”

🤖 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/services/api/openaiShim.test.ts` at line 8008, Restore the deleted
regression test for NVIDIA NIM Z.AI GLM streaming requests with tools, or move
it unchanged into providerCompatibility.test.ts. Ensure it continues asserting
that streaming requests do not send the tool_stream parameter, using the
existing test setup and symbols around the test.

Sources: Coding guidelines, 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/services/api/openaiShim.test.ts`:
- Line 8008: Restore the deleted regression test for NVIDIA NIM Z.AI GLM
streaming requests with tools, or move it unchanged into
providerCompatibility.test.ts. Ensure it continues asserting that streaming
requests do not send the tool_stream parameter, using the existing test setup
and symbols around the test.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9541a0b8-95b6-468b-8e52-a538262661dc

📥 Commits

Reviewing files that changed from the base of the PR and between 4462941 and 193302a.

📒 Files selected for processing (4)
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim/providerCompatibility.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: smoke-and-tests (24.11.x)
  • GitHub Check: smoke-and-tests (22)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

TypeScript code in this repository must use strict mode and ESM imports.

**/*.{ts,tsx}: When changing provider behavior, avoid breaking third-party providers and test the exact provider/model path changed when possible.
Run bun run typecheck and bun run typecheck:type-tests for TypeScript changes.
Run provider tests and provider recommendation tests when changing provider behavior: bun run test:provider and bun run test:provider-recommendation.

Files:

  • src/services/api/openaiShim/providerCompatibility.ts
  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim.test.ts
**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*: Keep changes focused on one problem or feature and avoid mixing unrelated cleanup into the same change.
Preserve existing repository patterns unless intentionally refactoring them.
Update documentation when setup, commands, or user-facing behavior changes.
Review AI-generated changes for correctness, style consistency, unnecessary changes, and adherence to project architecture before submitting them.
Follow the existing code style in touched files.
Prefer small, readable changes over broad rewrites.
Do not reformat unrelated files.
Keep comments useful and concise.
Provider changes must explicitly identify affected providers, limitations, and follow-up work in the pull request description.
Do not assign or use provider tags; provider tags are controlled by maintainers.
Run the relevant validation checks locally before submitting changes; pull requests must pass CI checks.
Run bun run security:pr-scan before submitting a pull request.
Dependency changes require a concrete project benefit, such as fixing a bug, addressing a security issue, or supporting an approved feature.
Do not change the project's language, core runtime, or dependency stack without prior maintainer agreement.

Files:

  • src/services/api/openaiShim/providerCompatibility.ts
  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim.test.ts

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/services/api/openaiShim/providerCompatibility.ts
  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim.test.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add or update tests when a code change affects behavior.

Files:

  • src/services/api/openaiShim/providerCompatibility.ts
  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim.test.ts
{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}

⚙️ CodeRabbit configuration file

{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}: Review provider routing, model selection, env precedence, auth/token handling, OpenAI-compatible shims, retries, proxy behavior, and outbound HTTP behavior with high scrutiny. Block on silent default changes, hidden fallback expansion, credential reuse mistakes, hardcoded provider assumptions, or new network reach that is not intentional and documented.

Files:

  • src/services/api/openaiShim/providerCompatibility.ts
  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim.test.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.test.ts
🔇 Additional comments (4)
src/services/api/openaiShim/providerCompatibility.ts (1)

1-148: LGTM!

src/services/api/openaiShim.ts (1)

262-290: LGTM!

src/services/api/openaiShim/providerCompatibility.test.ts (1)

1-565: LGTM!

src/services/api/openaiShim.test.ts (1)

12-12: LGTM!

Also applies to: 524-524, 1014-1014, 2451-2451, 2814-2814, 4000-4022, 4063-4070, 6939-6939, 7436-7436

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 18, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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/services/api/openaiShim.test.ts (1)

7940-7940: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Restore the NVIDIA NIM tool_stream regression test.

This deletion contradicts the PR objective that the regression remains in the monolith suite, and the new focused suite never asserts that streaming tool calls omit tool_stream.

As per coding guidelines, “test the exact provider/model path changed when possible.” As per path instructions, “Block when risky runtime changes lack focused regression coverage.”

🤖 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/services/api/openaiShim.test.ts` at line 7940, Restore the deleted
regression test in the monolith suite for the NVIDIA NIM Z.AI GLM streaming
request with tools, centered on the existing test title and provider/model path.
Ensure it verifies that streaming tool calls omit the tool_stream parameter,
preserving coverage for regression `#1950`.

Sources: Coding guidelines, 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/services/api/openaiShim.test.ts`:
- Line 7940: Restore the deleted regression test in the monolith suite for the
NVIDIA NIM Z.AI GLM streaming request with tools, centered on the existing test
title and provider/model path. Ensure it verifies that streaming tool calls omit
the tool_stream parameter, preserving coverage for regression `#1950`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ce4a1b48-df2d-40dd-a2b1-8e2d51464713

📥 Commits

Reviewing files that changed from the base of the PR and between 193302a and 9d49d04.

📒 Files selected for processing (4)
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim/providerCompatibility.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: smoke-and-tests (24.11.x)
  • GitHub Check: smoke-and-tests (22)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

TypeScript code in this repository must use strict mode and ESM imports.

**/*.{ts,tsx}: When changing provider behavior, avoid breaking third-party providers and test the exact provider/model path changed when possible.
Run bun run typecheck and bun run typecheck:type-tests for TypeScript changes.
Run provider tests and provider recommendation tests when changing provider behavior: bun run test:provider and bun run test:provider-recommendation.

Files:

  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/providerCompatibility.ts
  • src/services/api/openaiShim.test.ts
**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*: Keep changes focused on one problem or feature and avoid mixing unrelated cleanup into the same change.
Preserve existing repository patterns unless intentionally refactoring them.
Update documentation when setup, commands, or user-facing behavior changes.
Review AI-generated changes for correctness, style consistency, unnecessary changes, and adherence to project architecture before submitting them.
Follow the existing code style in touched files.
Prefer small, readable changes over broad rewrites.
Do not reformat unrelated files.
Keep comments useful and concise.
Provider changes must explicitly identify affected providers, limitations, and follow-up work in the pull request description.
Do not assign or use provider tags; provider tags are controlled by maintainers.
Run the relevant validation checks locally before submitting changes; pull requests must pass CI checks.
Run bun run security:pr-scan before submitting a pull request.
Dependency changes require a concrete project benefit, such as fixing a bug, addressing a security issue, or supporting an approved feature.
Do not change the project's language, core runtime, or dependency stack without prior maintainer agreement.

Files:

  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/providerCompatibility.ts
  • src/services/api/openaiShim.test.ts

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/providerCompatibility.ts
  • src/services/api/openaiShim.test.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add or update tests when a code change affects behavior.

Files:

  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/providerCompatibility.ts
  • src/services/api/openaiShim.test.ts
{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}

⚙️ CodeRabbit configuration file

{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}: Review provider routing, model selection, env precedence, auth/token handling, OpenAI-compatible shims, retries, proxy behavior, and outbound HTTP behavior with high scrutiny. Block on silent default changes, hidden fallback expansion, credential reuse mistakes, hardcoded provider assumptions, or new network reach that is not intentional and documented.

Files:

  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/providerCompatibility.ts
  • src/services/api/openaiShim.test.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.test.ts
🔇 Additional comments (4)
src/services/api/openaiShim/providerCompatibility.ts (1)

1-148: LGTM!

src/services/api/openaiShim.ts (1)

262-290: LGTM!

src/services/api/openaiShim/providerCompatibility.test.ts (1)

1-607: LGTM!

src/services/api/openaiShim.test.ts (1)

12-12: LGTM!

Also applies to: 524-524, 1014-1014, 2450-2451, 2747-2836, 3932-4002, 6870-6872, 7368-7368

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 18, 2026
@jatmn
jatmn force-pushed the de-mono1-provider-compat branch 2 times, most recently from 6b53f6f to d062d8f Compare July 18, 2026 19:01
@jatmn
jatmn force-pushed the de-mono1-provider-compat branch 2 times, most recently from f867e09 to 72bf8a9 Compare July 18, 2026 21:34
@jatmn
jatmn force-pushed the de-mono1-provider-compat branch from 72bf8a9 to d6e9cbf Compare July 22, 2026 01:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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/services/api/openaiShim.ts`:
- Around line 388-401: Move the providerCompatibility import block and the
hasMistralApiHost re-export to the top-level import/export section of
openaiShim.ts, alongside the file’s other module imports. Preserve all imported
symbols and existing behavior; only adjust their placement for navigability.

In `@src/services/api/openaiShim/providerCompatibility.ts`:
- Around line 124-148: Update maybeSetNvidiaNimChatTemplateThinking so
reasoningRequestPlan.thinkingType === 'disabled' always returns before modifying
chat_template_kwargs, regardless of reasoningEffort. Preserve the existing
enablement behavior for enabled thinking and the current skip behavior when no
thinking type or reasoning effort is provided.
🪄 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

Run ID: c86e06f1-d66a-4c7b-a6d1-d6d7f99f5678

📥 Commits

Reviewing files that changed from the base of the PR and between 9d49d04 and d6e9cbf.

📒 Files selected for processing (4)
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim/providerCompatibility.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: smoke-and-tests (22)
  • GitHub Check: smoke-and-tests (24.11.x)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

TypeScript code in this repository must use strict mode and ESM imports.

**/*.{ts,tsx}: Follow the existing code style and architectural patterns in touched TypeScript and TSX files.
Add or update tests when TypeScript or TSX changes affect behavior.
Review AI-generated TypeScript and TSX changes for correctness beyond compilation, consistency with repository architecture and style, unnecessary generated noise, and subtle bugs before submission.

Files:

  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/providerCompatibility.ts
  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.test.ts
**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*: Keep pull requests focused on one problem or feature; do not mix unrelated cleanup, fixes, features, or refactors into the same change.
Preserve existing repository patterns unless intentionally refactoring them, and prefer small, readable changes over broad rewrites.
Do not reformat unrelated files, and keep comments useful and concise.
Update documentation when setup, commands, or user-facing behavior changes.
When changing provider behavior, avoid breaking third-party providers, test the exact provider/model path changed when possible, explicitly identify affected providers, and document limitations or follow-up work.
Do not assign or use provider tags; provider tags are controlled and applied by maintainers.
Run the relevant validation checks locally before submitting; CI-required checks include bun run check, bun run test:full, provider tests when applicable, typechecks, and bun run security:pr-scan. Web changes additionally require bun run web:typecheck and bun run web:build.
Dependency changes must have a concrete project benefit, such as fixing a bug, addressing a security issue, or supporting an approved feature; preference alone is insufficient.
Do not change the project's language, core runtime, dependency stack, or significantly restructure dependencies without prior maintainer agreement.
Before implementing a new feature or other non-trivial change, open an issue to establish scope and alignment with the project roadmap.

Files:

  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/providerCompatibility.ts
  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.test.ts

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/providerCompatibility.ts
  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.test.ts
{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}

⚙️ CodeRabbit configuration file

{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}: Review provider routing, model selection, env precedence, auth/token handling, OpenAI-compatible shims, retries, proxy behavior, and outbound HTTP behavior with high scrutiny. Block on silent default changes, hidden fallback expansion, credential reuse mistakes, hardcoded provider assumptions, or new network reach that is not intentional and documented.

Files:

  • src/services/api/openaiShim.ts
  • src/services/api/openaiShim/providerCompatibility.ts
  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.test.ts
**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Run focused tests for changed behavior and ensure provider-specific changes include the relevant provider tests.

Files:

  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.test.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/services/api/openaiShim/providerCompatibility.test.ts
  • src/services/api/openaiShim.test.ts
🔇 Additional comments (4)
src/services/api/openaiShim/providerCompatibility.ts (1)

1-123: LGTM!

src/services/api/openaiShim.ts (1)

403-416: LGTM!

src/services/api/openaiShim/providerCompatibility.test.ts (1)

1-610: LGTM!

src/services/api/openaiShim.test.ts (1)

585-12050: LGTM!

Comment thread src/services/api/openaiShim.ts Outdated
Comment thread src/services/api/openaiShim/providerCompatibility.ts
@jatmn
jatmn marked this pull request as ready for review July 22, 2026 02:04

@jatmn jatmn left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@kevincodex1
kevincodex1 merged commit df85369 into Twigpine:main Jul 22, 2026
5 checks passed
@jatmn
jatmn deleted the de-mono1-provider-compat branch July 22, 2026 14:28
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