Skip to content

feat: add LongCat as first-class OpenAI-compatible provider - #1986

Merged
kevincodex1 merged 20 commits into
Twigpine:mainfrom
jatmn:longcat
Jul 20, 2026
Merged

kevincodex1 merged 20 commits into
Twigpine:mainfrom
jatmn:longcat

Conversation

@jatmn

@jatmn jatmn commented Jul 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add LongCat as a first-class OpenAI-compatible provider (vendor + brand + model descriptors).
  • Expose LongCat in /provider via preset metadata and --provider longcat.
  • Auth with dedicated LONGCAT_API_KEY (mirrored into the OpenAI-compatible auth path).
  • Catalog model: LongCat-2.0 (1M context / 128K max output).
  • Full thinking support via existing Z.AI-compatible request shaping:
    • request body: thinking: { type: "enabled" | "disabled" }
    • strip unverified reasoning_effort on the wire
    • preserve response reasoning_content

Provider details

Item Value
Base URL https://api.longcat.chat/openai
Model LongCat-2.0
Auth LONGCAT_API_KEY (Bearer)
Endpoint OpenAI chat completions only
Docs https://longcat.chat/platform/docs/

Files

  • src/integrations/vendors/longcat.ts
  • src/integrations/models/longcat.ts
  • src/integrations/brands/longcat.ts
  • generated integration artifacts
  • provider flag / auto-detect / profile / client env wiring
  • tests for vendor registration and provider flag behavior

Test plan

  • bun install
  • bun run build
  • bun run typecheck
  • bun run typecheck:type-tests
  • bun run test:provider (1191 pass)
  • focused: bun test ./src/integrations/vendors/longcat.test.ts ./src/utils/providerFlag.test.ts ./src/utils/providerAutoDetect.test.ts
  • bun run check / bun run test:full (started; aborted mid-run in session — re-run in CI)
  • Manual: set LONGCAT_API_KEY, run openclaude --provider longcat or /provider → LongCat, verify chat + thinking

Notes

  • Follows docs/integrations/how-to/add-vendor.md and add-model.md.
  • Thinking control reuses the existing zai-compatible serializer path (same thinking:{type} body field as LongCat docs).
  • No Anthropic LongCat endpoint in this PR (OpenAI path only).

Summary by CodeRabbit

  • New Features
    • Added LongCat provider support (LongCat-2.0) with LONGCAT_API_KEY-based configuration, presets, and provider auto-detection.
  • Documentation
    • Updated the supported-providers docs and .env example with LongCat setup details.
  • Bug Fixes
    • Improved LongCat endpoint detection/URL normalization and ensured correct request routing.
    • Refined credential precedence and environment scoping to prevent cross-provider leakage.
    • Enforced stricter request shaping, including rejecting image inputs when unsupported.

@jatmn jatmn self-assigned this Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

LongCat is added as an OpenAI-compatible provider with integration metadata, route validation, environment detection, credential scoping, profile persistence, API-client defaults, request handling, tests, and documentation.

Changes

LongCat provider support

Layer / File(s) Summary
Integration contracts and route resolution
.env.example, README.md, src/integrations/...
Adds LongCat brand, model, vendor registration, endpoint validation, env-only and base-URL route resolution, boundary checks, compatibility coverage, and setup documentation.
OpenAI-compatible execution and request shaping
src/services/api/client.ts, src/services/api/openaiShim.ts, src/services/api/providerConfig.ts, src/integrations/descriptors.ts
Applies LongCat defaults, rejects unsupported images, filters request fields, restricts generic credential fallback, normalizes endpoints, and enforces chat-completions transport.
Provider detection, flags, and validation
src/utils/envFile.ts, src/utils/providerAutoDetect*, src/utils/providerFlag*, src/utils/providerValidation*
Detects LONGCAT_API_KEY, supports the longcat provider flag, conditionally mirrors credentials, permits environment-file loading, and enforces provider-boundary validation.
Profile persistence and environment propagation
src/utils/providerProfile*, src/utils/providerProfiles.ts, src/utils/providerStartupOverrides*
Adds LongCat profile fields, cleanup, route-scoped credential propagation, and persisted startup environment handling.
Test isolation updates
src/services/*test.ts, src/utils/*test.ts, src/components/ProviderManager.test.tsx
Extends test snapshots, cleanup, restoration, and preset expectations for LongCat environment state.

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

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: kevincodex1, chioarub

🚥 Pre-merge checks | ✅ 4 | ❌ 3

❌ Failed checks (1 warning, 2 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Risk Surface Disclosed ❓ Inconclusive PR touches auth, provider routing, outbound requests, and startup env handling, but I couldn’t verify any review comment explicitly calling out risk/blocker status. Provide the reviewer thread or review notes that explicitly state the LongCat risk surface and whether it is blocking.
No Hidden Policy Change ❓ Inconclusive placeholder2 need investigation2
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately matches the main change: adding LongCat as a first-class OpenAI-compatible provider.
Description check ✅ Passed The description covers the summary, provider details, files, testing, and notes, with only the template's Impact section missing.
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.

@jatmn jatmn added the new: provider/gateway Request to add a new provider or gateway label Jul 16, 2026
@jatmn
jatmn force-pushed the longcat branch 2 times, most recently from ccf4705 to 0f0e73d Compare July 18, 2026 00:35

@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/integrations/routeMetadata.ts`:
- Around line 379-383: Update isLongcatBaseUrl() in
src/integrations/routeMetadata.ts:379-383 to accept the documented /openai and
/openai/ base paths while preserving existing /openai/v1 and nested-path
matches. Add or update coverage in src/integrations/routeMetadata.test.ts:71-79
for both /openai and /openai/, confirming LongCat resolution and LONGCAT_API_KEY
mirroring.

In `@src/integrations/vendors/longcat.ts`:
- Around line 25-26: The LongCat integration currently strips native
tool-calling data and its test still expects the model to be unsupported. In
src/integrations/vendors/longcat.ts lines 25-26, remove tools from
removeBodyFields so it is passed through; in
src/integrations/vendors/longcat.test.ts lines 55-62, update expectations to
mark tool support enabled and verify serialized tool calls.
🪄 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: ee881e04-c6db-455f-8365-221c1fa77f80

📥 Commits

Reviewing files that changed from the base of the PR and between 0effa0f and 0f0e73d.

⛔ Files ignored due to path filters (2)
  • src/integrations/generated/integrationArtifacts.generated.ts is excluded by !**/*.generated.*, !**/generated/**, !src/integrations/generated/**
  • src/integrations/generated/integrationManifest.generated.ts is excluded by !**/*.generated.*, !**/generated/**, !src/integrations/generated/**
📒 Files selected for processing (21)
  • .env.example
  • README.md
  • src/integrations/brands/longcat.ts
  • src/integrations/compatibility.test.ts
  • src/integrations/index.ts
  • src/integrations/models/longcat.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/routeMetadata.ts
  • src/integrations/vendors/longcat.test.ts
  • src/integrations/vendors/longcat.ts
  • src/services/api/client.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
  • src/utils/envFile.ts
  • src/utils/providerAutoDetect.test.ts
  • src/utils/providerAutoDetect.ts
  • src/utils/providerFlag.test.ts
  • src/utils/providerFlag.ts
  • src/utils/providerProfile.test.ts
  • src/utils/providerProfile.ts
  • src/utils/providerProfiles.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: smoke-and-tests (24.11.x)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{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/utils/providerAutoDetect.test.ts
  • src/integrations/index.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/brands/longcat.ts
  • src/utils/providerProfile.test.ts
  • src/integrations/compatibility.test.ts
  • src/integrations/vendors/longcat.ts
  • src/integrations/models/longcat.ts
  • src/integrations/vendors/longcat.test.ts
  • src/utils/envFile.ts
  • src/utils/providerFlag.test.ts
  • src/utils/providerFlag.ts
  • src/services/api/client.ts
  • src/utils/providerAutoDetect.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
  • src/utils/providerProfiles.ts
  • src/utils/providerProfile.ts
  • src/integrations/routeMetadata.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/utils/providerAutoDetect.test.ts
  • src/integrations/index.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/brands/longcat.ts
  • src/utils/providerProfile.test.ts
  • src/integrations/compatibility.test.ts
  • README.md
  • src/integrations/vendors/longcat.ts
  • src/integrations/models/longcat.ts
  • src/integrations/vendors/longcat.test.ts
  • src/utils/envFile.ts
  • src/utils/providerFlag.test.ts
  • src/utils/providerFlag.ts
  • src/services/api/client.ts
  • src/utils/providerAutoDetect.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
  • src/utils/providerProfiles.ts
  • src/utils/providerProfile.ts
  • src/integrations/routeMetadata.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/utils/providerAutoDetect.test.ts
  • src/integrations/index.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/brands/longcat.ts
  • src/utils/providerProfile.test.ts
  • src/integrations/compatibility.test.ts
  • README.md
  • src/integrations/vendors/longcat.ts
  • src/integrations/models/longcat.ts
  • src/integrations/vendors/longcat.test.ts
  • src/utils/envFile.ts
  • src/utils/providerFlag.test.ts
  • src/utils/providerFlag.ts
  • src/services/api/client.ts
  • src/utils/providerAutoDetect.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
  • src/utils/providerProfiles.ts
  • src/utils/providerProfile.ts
  • src/integrations/routeMetadata.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add or update tests when a code change affects behavior.

Files:

  • src/utils/providerAutoDetect.test.ts
  • src/integrations/index.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/brands/longcat.ts
  • src/utils/providerProfile.test.ts
  • src/integrations/compatibility.test.ts
  • src/integrations/vendors/longcat.ts
  • src/integrations/models/longcat.ts
  • src/integrations/vendors/longcat.test.ts
  • src/utils/envFile.ts
  • src/utils/providerFlag.test.ts
  • src/utils/providerFlag.ts
  • src/services/api/client.ts
  • src/utils/providerAutoDetect.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
  • src/utils/providerProfiles.ts
  • src/utils/providerProfile.ts
  • src/integrations/routeMetadata.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/utils/providerAutoDetect.test.ts
  • src/integrations/index.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/brands/longcat.ts
  • src/utils/providerProfile.test.ts
  • src/integrations/compatibility.test.ts
  • src/integrations/vendors/longcat.ts
  • src/integrations/models/longcat.ts
  • src/integrations/vendors/longcat.test.ts
  • src/utils/providerFlag.test.ts
  • src/utils/providerFlag.ts
  • src/services/api/client.ts
  • src/utils/providerAutoDetect.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
  • src/utils/providerProfiles.ts
  • src/utils/providerProfile.ts
  • src/integrations/routeMetadata.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/utils/providerAutoDetect.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/utils/providerProfile.test.ts
  • src/integrations/compatibility.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/utils/providerFlag.test.ts
  • src/services/api/openaiShim.test.ts
{README.md,CONTRIBUTING.md,docs/**,.github/pull_request_template.md}

⚙️ CodeRabbit configuration file

{README.md,CONTRIBUTING.md,docs/**,.github/pull_request_template.md}: Review docs for accuracy against current code behavior. Flag security or provider claims that overpromise, stale install commands, missing setup caveats, and instructions that could push users toward unsafe credential handling. Keep purely wording-level suggestions non-blocking.

Files:

  • README.md
🪛 dotenv-linter (4.0.0)
.env.example

[warning] 381-381: [ExtraBlankLine] Extra blank line detected

(ExtraBlankLine)

🔇 Additional comments (13)
.env.example (1)

367-383: LGTM!

README.md (1)

253-253: LGTM!

src/integrations/brands/longcat.ts (1)

1-15: LGTM!

src/integrations/models/longcat.ts (1)

1-21: LGTM!

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

52-52: LGTM!

Also applies to: 468-468, 512-512, 4011-4039

src/utils/envFile.ts (1)

75-75: LGTM!

src/utils/providerAutoDetect.test.ts (1)

151-157: LGTM!

src/utils/providerAutoDetect.ts (1)

21-25: LGTM!

Also applies to: 53-53, 213-219

src/utils/providerFlag.test.ts (1)

42-42: LGTM!

Also applies to: 90-90, 270-270, 756-801

src/utils/providerFlag.ts (1)

25-25: LGTM!

Also applies to: 51-51, 324-326, 588-608

src/integrations/index.ts (1)

142-142: LGTM!

src/integrations/compatibility.test.ts (1)

53-53: LGTM!

src/utils/providerProfile.test.ts (1)

311-337: LGTM!

Also applies to: 709-724

Comment thread src/integrations/routeMetadata.ts
Comment thread src/integrations/vendors/longcat.ts
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)

4011-4121: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Cover LongCat’s reasoning wire contract.

These tests cover auth, URLs, and tools, but not the changed user-visible reasoning behavior. Add an exact LongCat-2.0 fixture asserting thinking is sent, reasoning_effort is absent, and response reasoning_content is preserved in the Anthropic result.

As per coding guidelines, “When changing provider behavior, avoid breaking third-party providers and test the exact provider/model path changed when possible.” As per path instructions, “Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.”

🤖 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` around lines 4011 - 4121, Add a focused
LongCat-2.0 reasoning-wire regression test alongside the existing LongCat tests,
exercising the exact provider/model path through the relevant client request and
response flow. Assert the outbound payload includes thinking, omits
reasoning_effort, and verify response reasoning_content is preserved in the
resulting Anthropic-format response.

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`:
- Around line 4011-4121: Add a focused LongCat-2.0 reasoning-wire regression
test alongside the existing LongCat tests, exercising the exact provider/model
path through the relevant client request and response flow. Assert the outbound
payload includes thinking, omits reasoning_effort, and verify response
reasoning_content is preserved in the resulting Anthropic-format response.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 79a8b50b-171b-4ed9-8b27-159a41d30438

📥 Commits

Reviewing files that changed from the base of the PR and between 0f0e73d and 9981eb8.

📒 Files selected for processing (20)
  • src/components/ProviderManager.test.tsx
  • src/integrations/routeMetadata.test.ts
  • src/integrations/routeMetadata.ts
  • src/integrations/vendors/longcat.test.ts
  • src/integrations/vendors/longcat.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/services/api/client.test.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
  • src/services/compact/compact.test.ts
  • src/utils/attachments.ultracode.test.ts
  • src/utils/betas.test.ts
  • src/utils/context.test.ts
  • src/utils/effort.ultracode-display.test.ts
  • src/utils/model/providers.test.ts
  • src/utils/providerFlag.test.ts
  • src/utils/providerFlag.ts
  • src/utils/providerValidation.test.ts
  • src/utils/providerValidation.ts
  • src/utils/status.routes.test.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 (6)
**/*.{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/utils/status.routes.test.ts
  • src/utils/effort.ultracode-display.test.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/utils/betas.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/utils/attachments.ultracode.test.ts
  • src/utils/context.test.ts
  • src/utils/providerValidation.test.ts
  • src/utils/model/providers.test.ts
  • src/services/compact/compact.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/components/ProviderManager.test.tsx
  • src/utils/providerValidation.ts
  • src/services/api/client.test.ts
  • src/utils/providerFlag.test.ts
  • src/integrations/vendors/longcat.ts
  • src/utils/providerFlag.ts
  • src/services/api/openaiShim.test.ts
  • src/integrations/routeMetadata.ts
  • src/services/api/openaiShim.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/utils/status.routes.test.ts
  • src/utils/effort.ultracode-display.test.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/utils/betas.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/utils/attachments.ultracode.test.ts
  • src/utils/context.test.ts
  • src/utils/providerValidation.test.ts
  • src/utils/model/providers.test.ts
  • src/services/compact/compact.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/components/ProviderManager.test.tsx
  • src/utils/providerValidation.ts
  • src/services/api/client.test.ts
  • src/utils/providerFlag.test.ts
  • src/integrations/vendors/longcat.ts
  • src/utils/providerFlag.ts
  • src/services/api/openaiShim.test.ts
  • src/integrations/routeMetadata.ts
  • src/services/api/openaiShim.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/utils/status.routes.test.ts
  • src/utils/effort.ultracode-display.test.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/utils/betas.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/utils/attachments.ultracode.test.ts
  • src/utils/context.test.ts
  • src/utils/providerValidation.test.ts
  • src/utils/model/providers.test.ts
  • src/services/compact/compact.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/components/ProviderManager.test.tsx
  • src/utils/providerValidation.ts
  • src/services/api/client.test.ts
  • src/utils/providerFlag.test.ts
  • src/integrations/vendors/longcat.ts
  • src/utils/providerFlag.ts
  • src/services/api/openaiShim.test.ts
  • src/integrations/routeMetadata.ts
  • src/services/api/openaiShim.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add or update tests when a code change affects behavior.

Files:

  • src/utils/status.routes.test.ts
  • src/utils/effort.ultracode-display.test.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/utils/betas.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/utils/attachments.ultracode.test.ts
  • src/utils/context.test.ts
  • src/utils/providerValidation.test.ts
  • src/utils/model/providers.test.ts
  • src/services/compact/compact.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/components/ProviderManager.test.tsx
  • src/utils/providerValidation.ts
  • src/services/api/client.test.ts
  • src/utils/providerFlag.test.ts
  • src/integrations/vendors/longcat.ts
  • src/utils/providerFlag.ts
  • src/services/api/openaiShim.test.ts
  • src/integrations/routeMetadata.ts
  • src/services/api/openaiShim.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/utils/status.routes.test.ts
  • src/utils/effort.ultracode-display.test.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/utils/betas.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/utils/attachments.ultracode.test.ts
  • src/utils/context.test.ts
  • src/utils/providerValidation.test.ts
  • src/utils/model/providers.test.ts
  • src/services/compact/compact.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/components/ProviderManager.test.tsx
  • src/services/api/client.test.ts
  • src/utils/providerFlag.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/claude.lifecycle.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/utils/providerValidation.test.ts
  • src/utils/model/providers.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/utils/providerValidation.ts
  • src/services/api/client.test.ts
  • src/utils/providerFlag.test.ts
  • src/integrations/vendors/longcat.ts
  • src/utils/providerFlag.ts
  • src/services/api/openaiShim.test.ts
  • src/integrations/routeMetadata.ts
  • src/services/api/openaiShim.ts
src/components/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Use React + Ink for terminal UI components under src/components/.

Files:

  • src/components/ProviderManager.test.tsx
🔇 Additional comments (19)
src/utils/providerValidation.ts (1)

19-19: LGTM!

Also applies to: 281-284

src/utils/providerValidation.test.ts (1)

34-34: LGTM!

Also applies to: 180-187

src/services/api/claude.lifecycle.test.ts (1)

45-45: LGTM!

src/utils/status.routes.test.ts (1)

27-27: LGTM!

src/services/compact/compact.test.ts (1)

296-296: LGTM!

src/utils/attachments.ultracode.test.ts (1)

24-24: LGTM!

src/utils/betas.test.ts (1)

46-46: LGTM!

src/utils/context.test.ts (1)

32-32: LGTM!

Also applies to: 53-53, 130-134

src/utils/effort.ultracode-display.test.ts (1)

36-36: LGTM!

src/utils/model/providers.test.ts (1)

17-17: LGTM!

Also applies to: 66-66

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

68-68: LGTM!

Also applies to: 121-121, 161-161, 209-209

src/components/ProviderManager.test.tsx (1)

145-145: LGTM!

src/integrations/vendors/longcat.ts (1)

3-67: LGTM!

src/integrations/routeMetadata.ts (1)

371-389: LGTM!

src/integrations/routeMetadata.test.ts (1)

10-10: LGTM!

Also applies to: 71-82

src/integrations/vendors/longcat.test.ts (1)

16-90: LGTM!

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

3954-3992: LGTM!

Also applies to: 4261-4333, 4486-4503

src/utils/providerFlag.ts (1)

25-25: LGTM!

Also applies to: 51-51, 324-326, 588-614

src/utils/providerFlag.test.ts (1)

42-42: LGTM!

Also applies to: 90-90, 270-270, 775-789

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.

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/services/api/openaiShim.ts`:
- Around line 4275-4276: Update routeAcceptsGenericOpenAICredentials to derive
eligibility from the current route descriptor’s setup.dedicatedCredentialsOnly
flag, allowing generic OpenAI credentials only when the route is not
dedicated-credentials-only; preserve the existing route-specific behavior
otherwise. Add a regression test covering an existing dedicated-only route and
verifying OPENAI_API_KEY/OPENAI_API_KEYS are not used.
🪄 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: 2c166c6b-cd0f-4a3d-be4e-c3c5037ea9f9

📥 Commits

Reviewing files that changed from the base of the PR and between 9981eb8 and 974b624.

📒 Files selected for processing (11)
  • src/integrations/brands/longcat.ts
  • src/integrations/descriptors.ts
  • src/integrations/models/longcat.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/routeMetadata.ts
  • src/integrations/vendors/longcat.test.ts
  • src/integrations/vendors/longcat.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/providerConfig.test.ts
  • src/services/api/providerConfig.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}: 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/integrations/models/longcat.ts
  • src/integrations/brands/longcat.ts
  • src/services/api/providerConfig.test.ts
  • src/integrations/descriptors.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/vendors/longcat.ts
  • src/integrations/vendors/longcat.test.ts
  • src/services/api/providerConfig.ts
  • src/integrations/routeMetadata.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.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/integrations/models/longcat.ts
  • src/integrations/brands/longcat.ts
  • src/services/api/providerConfig.test.ts
  • src/integrations/descriptors.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/vendors/longcat.ts
  • src/integrations/vendors/longcat.test.ts
  • src/services/api/providerConfig.ts
  • src/integrations/routeMetadata.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.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/integrations/models/longcat.ts
  • src/integrations/brands/longcat.ts
  • src/services/api/providerConfig.test.ts
  • src/integrations/descriptors.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/vendors/longcat.ts
  • src/integrations/vendors/longcat.test.ts
  • src/services/api/providerConfig.ts
  • src/integrations/routeMetadata.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add or update tests when a code change affects behavior.

Files:

  • src/integrations/models/longcat.ts
  • src/integrations/brands/longcat.ts
  • src/services/api/providerConfig.test.ts
  • src/integrations/descriptors.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/vendors/longcat.ts
  • src/integrations/vendors/longcat.test.ts
  • src/services/api/providerConfig.ts
  • src/integrations/routeMetadata.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.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/integrations/models/longcat.ts
  • src/integrations/brands/longcat.ts
  • src/services/api/providerConfig.test.ts
  • src/integrations/descriptors.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/vendors/longcat.ts
  • src/integrations/vendors/longcat.test.ts
  • src/services/api/providerConfig.ts
  • src/integrations/routeMetadata.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.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/providerConfig.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/services/api/openaiShim.test.ts
🔇 Additional comments (11)
src/integrations/brands/longcat.ts (1)

9-9: LGTM!

src/integrations/models/longcat.ts (1)

13-13: LGTM!

src/integrations/vendors/longcat.ts (1)

22-26: LGTM!

Also applies to: 58-58

src/integrations/routeMetadata.ts (1)

384-384: LGTM!

src/integrations/routeMetadata.test.ts (1)

10-10: LGTM!

Also applies to: 71-83

src/integrations/vendors/longcat.test.ts (1)

63-63: LGTM!

Also applies to: 76-86

src/integrations/descriptors.ts (1)

46-47: LGTM!

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

911-944: LGTM!

Also applies to: 994-1010, 1124-1130, 1188-1211, 1261-1261, 1362-1362, 3848-3848, 3968-3972, 4309-4309, 4499-4518

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

971-977: LGTM!

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

2614-2614: LGTM!

Also applies to: 4027-4204

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

28-40: LGTM!

Comment thread src/services/api/openaiShim.ts Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 18, 2026

@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.

@jatmn
jatmn marked this pull request as ready for review July 18, 2026 03:43
@kevincodex1

Copy link
Copy Markdown
Member

please rebase to main and fix conflicts

@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: 1

Caution

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

⚠️ Outside diff range comments (2)
src/utils/envFile.ts (1)

75-101: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Add focused env-file coverage.

Add loadEnvFile regressions accepting LONGCAT_API_KEY and OPENAI_AZURE_STYLE; these lines expand accepted --provider-env-file behavior without a supplied test update.

As per coding guidelines, “Add or update tests when a change affects behavior.”

🤖 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/utils/envFile.ts` around lines 75 - 101, Add focused regression coverage
for loadEnvFile in src/utils/envFile.ts by testing env files containing
LONGCAT_API_KEY and OPENAI_AZURE_STYLE. Verify both variables are accepted
through --provider-env-file behavior, preserving existing loadEnvFile test
patterns and avoiding unrelated changes.

Source: Coding guidelines

src/utils/providerProfile.ts (1)

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

Split the unrelated Azure-style routing work.

The PR objective is LongCat support, but these changes introduce and test independent OPENAI_AZURE_STYLE persistence behavior. Move the Azure feature to a dedicated PR so the LongCat integration remains reviewable and safely rollbackable.

  • src/utils/providerProfile.ts#L1896-L1907: move persisted Azure-style launch selection and its supporting profile-env changes.
  • src/utils/providerProfiles.ts#L291-L348: move Azure-style profile persistence, alignment, and environment propagation.
  • src/utils/providerProfile.test.ts#L726-L754: move the Azure-style regression coverage with that dedicated change.

As per coding guidelines, “Keep pull requests focused on one issue or one clearly scoped improvement.” As per path instructions, “keep changes focused on one problem.”

🤖 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/utils/providerProfile.ts` around lines 1896 - 1907, Remove the unrelated
Azure-style persistence and routing work from the LongCat change and defer it to
a dedicated PR. In src/utils/providerProfile.ts lines 1896-1907, remove the
persisted Azure-style launch selection and environment propagation; in
src/utils/providerProfiles.ts lines 291-348, remove the Azure-style profile
persistence and alignment changes; and in src/utils/providerProfile.test.ts
lines 726-754, remove the corresponding Azure-style regression tests. Keep only
LongCat-related changes in this PR.

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.

Inline comments:
In @.env.example:
- Line 397: Remove the extra blank line in .env.example so dotenv-linter no
longer reports an ExtraBlankLine warning.

---

Outside diff comments:
In `@src/utils/envFile.ts`:
- Around line 75-101: Add focused regression coverage for loadEnvFile in
src/utils/envFile.ts by testing env files containing LONGCAT_API_KEY and
OPENAI_AZURE_STYLE. Verify both variables are accepted through
--provider-env-file behavior, preserving existing loadEnvFile test patterns and
avoiding unrelated changes.

In `@src/utils/providerProfile.ts`:
- Around line 1896-1907: Remove the unrelated Azure-style persistence and
routing work from the LongCat change and defer it to a dedicated PR. In
src/utils/providerProfile.ts lines 1896-1907, remove the persisted Azure-style
launch selection and environment propagation; in src/utils/providerProfiles.ts
lines 291-348, remove the Azure-style profile persistence and alignment changes;
and in src/utils/providerProfile.test.ts lines 726-754, remove the corresponding
Azure-style regression tests. Keep only LongCat-related changes in this PR.
🪄 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: ffa6bcae-6ffc-497c-94c2-eeb84a797828

📥 Commits

Reviewing files that changed from the base of the PR and between 729e8f8 and 44218f1.

⛔ Files ignored due to path filters (2)
  • src/integrations/generated/integrationArtifacts.generated.ts is excluded by !**/*.generated.*, !**/generated/**, !src/integrations/generated/**
  • src/integrations/generated/integrationManifest.generated.ts is excluded by !**/*.generated.*, !**/generated/**, !src/integrations/generated/**
📒 Files selected for processing (38)
  • .env.example
  • README.md
  • src/components/ProviderManager.test.tsx
  • src/integrations/brands/longcat.ts
  • src/integrations/compatibility.test.ts
  • src/integrations/descriptors.ts
  • src/integrations/index.ts
  • src/integrations/models/longcat.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/routeMetadata.ts
  • src/integrations/vendors/longcat.test.ts
  • src/integrations/vendors/longcat.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/services/api/client.test.ts
  • src/services/api/client.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/providerConfig.test.ts
  • src/services/api/providerConfig.ts
  • src/services/compact/compact.test.ts
  • src/utils/attachments.ultracode.test.ts
  • src/utils/betas.test.ts
  • src/utils/context.test.ts
  • src/utils/effort.ultracode-display.test.ts
  • src/utils/envFile.ts
  • src/utils/model/providers.test.ts
  • src/utils/providerAutoDetect.test.ts
  • src/utils/providerAutoDetect.ts
  • src/utils/providerFlag.test.ts
  • src/utils/providerFlag.ts
  • src/utils/providerProfile.test.ts
  • src/utils/providerProfile.ts
  • src/utils/providerProfiles.ts
  • src/utils/providerStartupOverrides.test.ts
  • src/utils/providerStartupOverrides.ts
  • src/utils/providerValidation.test.ts
  • src/utils/providerValidation.ts
  • src/utils/status.routes.test.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 (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

**/*.{ts,tsx}: Provider changes must follow the documented integration patterns and avoid inconsistent behavior across provider paths.
When changing provider behavior, avoid breaking third-party providers and test the exact provider/model path changed when possible.
Review AI-generated code for correctness, style consistency, unnecessary changes, and adherence to project architecture before submission.
Run multiple rounds of self-review on AI-generated code; compilation alone is insufficient to establish correctness.

Files:

  • src/integrations/compatibility.test.ts
  • src/integrations/index.ts
  • src/utils/effort.ultracode-display.test.ts
  • src/integrations/models/longcat.ts
  • src/integrations/brands/longcat.ts
  • src/services/api/providerConfig.test.ts
  • src/services/compact/compact.test.ts
  • src/components/ProviderManager.test.tsx
  • src/utils/betas.test.ts
  • src/utils/providerAutoDetect.test.ts
  • src/utils/providerFlag.test.ts
  • src/utils/providerStartupOverrides.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/utils/model/providers.test.ts
  • src/utils/providerStartupOverrides.test.ts
  • src/utils/providerValidation.test.ts
  • src/utils/status.routes.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/vendors/longcat.ts
  • src/utils/envFile.ts
  • src/integrations/descriptors.ts
  • src/utils/context.test.ts
  • src/utils/providerProfile.test.ts
  • src/utils/attachments.ultracode.test.ts
  • src/services/api/providerConfig.ts
  • src/services/api/client.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/services/api/client.ts
  • src/utils/providerAutoDetect.ts
  • src/utils/providerFlag.ts
  • src/utils/providerValidation.ts
  • src/utils/providerProfile.ts
  • src/utils/providerProfiles.ts
  • src/services/api/openaiShim.test.ts
  • src/integrations/routeMetadata.ts
  • src/services/api/openaiShim.ts
**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*: Keep pull requests focused on one issue or one clearly scoped improvement; avoid unrelated cleanup, fixes, features, or refactors in the same change.
Preserve existing repository patterns unless intentionally refactoring them, and stay within the project's existing language, runtime, dependency, and architectural direction.
Add or update tests when a change affects behavior.
Update documentation when setup, commands, or user-facing behavior changes.
Follow the existing code style in touched files.
Prefer small, readable changes over broad rewrites.
Do not reformat unrelated files merely because they are nearby.
Keep comments useful and concise.
Run the narrowest meaningful validation command for the touched area before opening a pull request, and ensure relevant CI checks pass before merge.
Provider-change pull requests must identify affected providers, state the tested provider/model path, and document limitations or follow-up work.
Do not assign or use provider tags; provider tags are controlled and applied by maintainers.
Security reports must follow the instructions in SECURITY.md.
PR descriptions must explain what changed and why, user or developer impact, exact checks run, and include relevant issue links; UI, terminal presentation, or VS Code extension changes require screenshots.
PR authors must address CodeRabbit findings before maintainer review proceeds.

Files:

  • src/integrations/compatibility.test.ts
  • src/integrations/index.ts
  • src/utils/effort.ultracode-display.test.ts
  • src/integrations/models/longcat.ts
  • src/integrations/brands/longcat.ts
  • src/services/api/providerConfig.test.ts
  • src/services/compact/compact.test.ts
  • src/components/ProviderManager.test.tsx
  • src/utils/betas.test.ts
  • src/utils/providerAutoDetect.test.ts
  • src/utils/providerFlag.test.ts
  • src/utils/providerStartupOverrides.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/utils/model/providers.test.ts
  • src/utils/providerStartupOverrides.test.ts
  • src/utils/providerValidation.test.ts
  • src/utils/status.routes.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/vendors/longcat.ts
  • src/utils/envFile.ts
  • src/integrations/descriptors.ts
  • src/utils/context.test.ts
  • src/utils/providerProfile.test.ts
  • src/utils/attachments.ultracode.test.ts
  • README.md
  • src/services/api/providerConfig.ts
  • src/services/api/client.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/services/api/client.ts
  • src/utils/providerAutoDetect.ts
  • src/utils/providerFlag.ts
  • src/utils/providerValidation.ts
  • src/utils/providerProfile.ts
  • src/utils/providerProfiles.ts
  • src/services/api/openaiShim.test.ts
  • src/integrations/routeMetadata.ts
  • src/services/api/openaiShim.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/integrations/compatibility.test.ts
  • src/integrations/index.ts
  • src/utils/effort.ultracode-display.test.ts
  • src/integrations/models/longcat.ts
  • src/integrations/brands/longcat.ts
  • src/services/api/providerConfig.test.ts
  • src/services/compact/compact.test.ts
  • src/components/ProviderManager.test.tsx
  • src/utils/betas.test.ts
  • src/utils/providerAutoDetect.test.ts
  • src/utils/providerFlag.test.ts
  • src/utils/providerStartupOverrides.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/utils/model/providers.test.ts
  • src/utils/providerStartupOverrides.test.ts
  • src/utils/providerValidation.test.ts
  • src/utils/status.routes.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/vendors/longcat.ts
  • src/utils/envFile.ts
  • src/integrations/descriptors.ts
  • src/utils/context.test.ts
  • src/utils/providerProfile.test.ts
  • src/utils/attachments.ultracode.test.ts
  • README.md
  • src/services/api/providerConfig.ts
  • src/services/api/client.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/services/api/client.ts
  • src/utils/providerAutoDetect.ts
  • src/utils/providerFlag.ts
  • src/utils/providerValidation.ts
  • src/utils/providerProfile.ts
  • src/utils/providerProfiles.ts
  • src/services/api/openaiShim.test.ts
  • src/integrations/routeMetadata.ts
  • src/services/api/openaiShim.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/integrations/compatibility.test.ts
  • src/integrations/index.ts
  • src/integrations/models/longcat.ts
  • src/integrations/brands/longcat.ts
  • src/services/api/providerConfig.test.ts
  • src/utils/providerAutoDetect.test.ts
  • src/utils/providerFlag.test.ts
  • src/utils/providerStartupOverrides.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/utils/model/providers.test.ts
  • src/utils/providerStartupOverrides.test.ts
  • src/utils/providerValidation.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/vendors/longcat.ts
  • src/integrations/descriptors.ts
  • src/utils/providerProfile.test.ts
  • src/services/api/providerConfig.ts
  • src/services/api/client.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/services/api/client.ts
  • src/utils/providerAutoDetect.ts
  • src/utils/providerFlag.ts
  • src/utils/providerValidation.ts
  • src/utils/providerProfile.ts
  • src/utils/providerProfiles.ts
  • src/services/api/openaiShim.test.ts
  • src/integrations/routeMetadata.ts
  • src/services/api/openaiShim.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/integrations/compatibility.test.ts
  • src/utils/effort.ultracode-display.test.ts
  • src/services/api/providerConfig.test.ts
  • src/services/compact/compact.test.ts
  • src/components/ProviderManager.test.tsx
  • src/utils/betas.test.ts
  • src/utils/providerAutoDetect.test.ts
  • src/utils/providerFlag.test.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/utils/model/providers.test.ts
  • src/utils/providerStartupOverrides.test.ts
  • src/utils/providerValidation.test.ts
  • src/utils/status.routes.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/utils/context.test.ts
  • src/utils/providerProfile.test.ts
  • src/utils/attachments.ultracode.test.ts
  • src/services/api/client.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/services/api/openaiShim.test.ts
src/components/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Use React + Ink for terminal UI components under src/components/.

Files:

  • src/components/ProviderManager.test.tsx
{README.md,CONTRIBUTING.md,docs/**,.github/pull_request_template.md}

⚙️ CodeRabbit configuration file

{README.md,CONTRIBUTING.md,docs/**,.github/pull_request_template.md}: Review docs for accuracy against current code behavior. Flag security or provider claims that overpromise, stale install commands, missing setup caveats, and instructions that could push users toward unsafe credential handling. Keep purely wording-level suggestions non-blocking.

Files:

  • README.md
🪛 dotenv-linter (4.0.0)
.env.example

[warning] 397-397: [ExtraBlankLine] Extra blank line detected

(ExtraBlankLine)

🔇 Additional comments (40)
src/services/compact/compact.test.ts (1)

296-296: LGTM!

src/utils/attachments.ultracode.test.ts (1)

24-24: LGTM!

src/utils/betas.test.ts (1)

46-46: LGTM!

src/utils/context.test.ts (1)

32-32: LGTM!

Also applies to: 53-53, 130-134

src/utils/effort.ultracode-display.test.ts (1)

36-36: LGTM!

src/utils/model/providers.test.ts (1)

17-17: LGTM!

Also applies to: 66-66

src/components/ProviderManager.test.tsx (1)

145-145: LGTM!

Also applies to: 702-702

.env.example (1)

383-396: LGTM!

Also applies to: 398-399

src/integrations/descriptors.ts (1)

46-47: LGTM!

src/integrations/routeMetadata.test.ts (1)

10-10: LGTM!

Also applies to: 71-91

src/integrations/routeMetadata.ts (1)

371-391: LGTM!

Also applies to: 510-526, 705-705, 727-751, 777-777, 815-818, 1005-1008, 1041-1043

src/utils/status.routes.test.ts (1)

27-27: LGTM!

src/utils/providerFlag.ts (1)

25-25: LGTM!

Also applies to: 51-51, 324-326, 352-357, 404-404, 475-475, 597-624

src/utils/providerValidation.ts (1)

19-19: LGTM!

Also applies to: 281-284

src/utils/providerValidation.test.ts (1)

34-34: LGTM!

Also applies to: 180-186

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

42-42: LGTM!

Also applies to: 202-205, 231-234, 252-255, 288-291, 325-355, 370-373, 395-447, 491-492, 510-512

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

59-69: LGTM!

Also applies to: 122-122, 156-163, 202-202, 212-212, 640-640, 685-685, 1598-1833

README.md (1)

253-253: LGTM!

src/integrations/brands/longcat.ts (1)

1-15: LGTM!

src/integrations/models/longcat.ts (1)

1-21: LGTM!

src/integrations/vendors/longcat.ts (2)

7-8: 🎯 Functional Correctness

Complete the pending provider-path verification.

Exercise LongCat-2.0 on the configured Chat Completions route and record the result and limitations before merge; the PR summary still marks manual verification as pending. As per coding guidelines, “test the exact provider/model path changed when possible.” As per path instructions, “If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.”

Sources: Coding guidelines, Path instructions


1-6: LGTM!

Also applies to: 9-67

src/integrations/index.ts (1)

142-142: LGTM!

src/integrations/compatibility.test.ts (1)

53-53: LGTM!

src/integrations/vendors/longcat.test.ts (1)

1-88: LGTM!

src/utils/providerProfile.ts (1)

27-27: LGTM!

Also applies to: 115-115, 201-201, 1351-1352, 1969-1969, 1985-1990

src/utils/providerProfiles.ts (1)

53-53: LGTM!

Also applies to: 227-235, 783-786, 997-999, 1341-1343, 1410-1412

src/utils/providerProfile.test.ts (1)

311-338: LGTM!

Also applies to: 709-724

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

4707-4712: Credential eligibility is now descriptor-driven (dedicatedCredentialsOnly !== true) and the generic OpenAI fallback is correctly gated, closing the earlier isolation regression. Verified against the LongCat and dedicated-only ClinePass regression tests.

Also applies to: 4767-4780


59-60: LGTM!

Also applies to: 1281-1314, 1364-1380, 1494-1500, 1558-1558, 1575-1581, 1631-1631, 1732-1732, 4269-4269, 4400-4404, 4743-4743, 4920-4939

src/utils/providerAutoDetect.ts (1)

21-25: LGTM!

Also applies to: 53-53, 213-219

src/utils/providerAutoDetect.test.ts (1)

151-157: LGTM!

src/utils/providerFlag.test.ts (1)

30-30: LGTM!

Also applies to: 43-43, 79-79, 92-92, 272-272, 458-465, 766-826

src/services/api/claude.lifecycle.test.ts (1)

45-45: LGTM!

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

28-41: LGTM!

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

1031-1050: LGTM!

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

4678-4866: Solid coverage: image rejection, URL normalization variants, dedicated-credential precedence, and the dedicated-only pool-fallback guard all map directly to the shim behavior. Nice regression net for the credential-isolation path.


58-66: LGTM!

Also applies to: 417-457, 493-576, 647-1308, 2212-2231, 3121-3140, 3280-3280

src/utils/providerStartupOverrides.ts (1)

44-44: LGTM!

src/utils/providerStartupOverrides.test.ts (1)

25-25: LGTM!

Also applies to: 49-49

Comment thread .env.example
@jatmn

jatmn commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator Author

@kevincodex1

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 19, 2026
@kevincodex1

Copy link
Copy Markdown
Member

bro please rebase to main and fix conflicts

@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.

♻️ Duplicate comments (2)
.env.example (1)

397-397: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove the extra blank line.

dotenv-linter still reports ExtraBlankLine here.

🤖 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 @.env.example at line 397, Remove the extra blank line at the reported
location in .env.example so dotenv-linter no longer reports ExtraBlankLine.

Source: Linters/SAST tools

src/integrations/vendors/longcat.ts (1)

22-26: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Restore LongCat tool calling.

LongCat documents native tool calling, but this integration strips tools before transmission and marks the capability unsupported throughout the registry. (longcat.chat)

  • src/integrations/vendors/longcat.ts#L22-L26: remove tools from removeBodyFields.
  • src/integrations/vendors/longcat.ts#L56-L60: set supportsFunctionCalling to true.
  • src/integrations/brands/longcat.ts#L7-L14: set supportsFunctionCalling to true.
  • src/integrations/models/longcat.ts#L11-L20: set supportsFunctionCalling to true.
  • src/integrations/vendors/longcat.test.ts#L57-L64: assert enabled tool support and that tools is not removed.

As per coding guidelines, provider changes must “avoid inconsistent behavior across provider paths” and test the exact provider/model path when possible.

🤖 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/integrations/vendors/longcat.ts` around lines 22 - 26, Restore LongCat
tool-calling support consistently: in src/integrations/vendors/longcat.ts:22-26,
remove tools from removeBodyFields; set supportsFunctionCalling to true in
src/integrations/vendors/longcat.ts:56-60,
src/integrations/brands/longcat.ts:7-14, and
src/integrations/models/longcat.ts:11-20; update
src/integrations/vendors/longcat.test.ts:57-64 to assert tool support is enabled
and tools is not removed, covering the exact provider/model path.

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.

Duplicate comments:
In @.env.example:
- Line 397: Remove the extra blank line at the reported location in .env.example
so dotenv-linter no longer reports ExtraBlankLine.

In `@src/integrations/vendors/longcat.ts`:
- Around line 22-26: Restore LongCat tool-calling support consistently: in
src/integrations/vendors/longcat.ts:22-26, remove tools from removeBodyFields;
set supportsFunctionCalling to true in
src/integrations/vendors/longcat.ts:56-60,
src/integrations/brands/longcat.ts:7-14, and
src/integrations/models/longcat.ts:11-20; update
src/integrations/vendors/longcat.test.ts:57-64 to assert tool support is enabled
and tools is not removed, covering the exact provider/model path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1d16982d-9f8b-46dc-a7f4-93feff4bc392

📥 Commits

Reviewing files that changed from the base of the PR and between 44218f1 and 1731c3d.

⛔ Files ignored due to path filters (2)
  • src/integrations/generated/integrationArtifacts.generated.ts is excluded by !**/*.generated.*, !**/generated/**, !src/integrations/generated/**
  • src/integrations/generated/integrationManifest.generated.ts is excluded by !**/*.generated.*, !**/generated/**, !src/integrations/generated/**
📒 Files selected for processing (38)
  • .env.example
  • README.md
  • src/components/ProviderManager.test.tsx
  • src/integrations/brands/longcat.ts
  • src/integrations/compatibility.test.ts
  • src/integrations/descriptors.ts
  • src/integrations/index.ts
  • src/integrations/models/longcat.ts
  • src/integrations/routeMetadata.test.ts
  • src/integrations/routeMetadata.ts
  • src/integrations/vendors/longcat.test.ts
  • src/integrations/vendors/longcat.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/services/api/client.test.ts
  • src/services/api/client.ts
  • src/services/api/openaiShim.test.ts
  • src/services/api/openaiShim.ts
  • src/services/api/providerConfig.test.ts
  • src/services/api/providerConfig.ts
  • src/services/compact/compact.test.ts
  • src/utils/attachments.ultracode.test.ts
  • src/utils/betas.test.ts
  • src/utils/context.test.ts
  • src/utils/effort.ultracode-display.test.ts
  • src/utils/envFile.ts
  • src/utils/model/providers.test.ts
  • src/utils/providerAutoDetect.test.ts
  • src/utils/providerAutoDetect.ts
  • src/utils/providerFlag.test.ts
  • src/utils/providerFlag.ts
  • src/utils/providerProfile.test.ts
  • src/utils/providerProfile.ts
  • src/utils/providerProfiles.ts
  • src/utils/providerStartupOverrides.test.ts
  • src/utils/providerStartupOverrides.ts
  • src/utils/providerValidation.test.ts
  • src/utils/providerValidation.ts
  • src/utils/status.routes.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: smoke-and-tests (22)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

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

**/*.{ts,tsx}: Provider changes must follow the documented integration patterns and avoid inconsistent behavior across provider paths.
When changing provider behavior, avoid breaking third-party providers and test the exact provider/model path changed when possible.
Review AI-generated code for correctness, style consistency, unnecessary changes, and adherence to project architecture before submission.
Run multiple rounds of self-review on AI-generated code; compilation alone is insufficient to establish correctness.

Files:

  • src/integrations/compatibility.test.ts
  • src/utils/providerStartupOverrides.test.ts
  • src/integrations/brands/longcat.ts
  • src/integrations/models/longcat.ts
  • src/components/ProviderManager.test.tsx
  • src/utils/providerStartupOverrides.ts
  • src/utils/context.test.ts
  • src/utils/envFile.ts
  • src/integrations/descriptors.ts
  • src/integrations/vendors/longcat.ts
  • src/integrations/index.ts
  • src/services/compact/compact.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/utils/attachments.ultracode.test.ts
  • src/utils/providerProfile.test.ts
  • src/utils/providerValidation.test.ts
  • src/utils/status.routes.test.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/utils/model/providers.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/utils/effort.ultracode-display.test.ts
  • src/services/api/providerConfig.ts
  • src/utils/providerValidation.ts
  • src/utils/betas.test.ts
  • src/services/api/providerConfig.test.ts
  • src/services/api/client.ts
  • src/utils/providerAutoDetect.test.ts
  • src/services/api/client.test.ts
  • src/utils/providerProfile.ts
  • src/utils/providerProfiles.ts
  • src/utils/providerAutoDetect.ts
  • src/services/api/openaiShim.test.ts
  • src/utils/providerFlag.test.ts
  • src/integrations/routeMetadata.ts
  • src/utils/providerFlag.ts
  • src/services/api/openaiShim.ts
**/*

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*: Keep pull requests focused on one issue or one clearly scoped improvement; avoid unrelated cleanup, fixes, features, or refactors in the same change.
Preserve existing repository patterns unless intentionally refactoring them, and stay within the project's existing language, runtime, dependency, and architectural direction.
Add or update tests when a change affects behavior.
Update documentation when setup, commands, or user-facing behavior changes.
Follow the existing code style in touched files.
Prefer small, readable changes over broad rewrites.
Do not reformat unrelated files merely because they are nearby.
Keep comments useful and concise.
Run the narrowest meaningful validation command for the touched area before opening a pull request, and ensure relevant CI checks pass before merge.
Provider-change pull requests must identify affected providers, state the tested provider/model path, and document limitations or follow-up work.
Do not assign or use provider tags; provider tags are controlled and applied by maintainers.
Security reports must follow the instructions in SECURITY.md.
PR descriptions must explain what changed and why, user or developer impact, exact checks run, and include relevant issue links; UI, terminal presentation, or VS Code extension changes require screenshots.
PR authors must address CodeRabbit findings before maintainer review proceeds.

Files:

  • src/integrations/compatibility.test.ts
  • src/utils/providerStartupOverrides.test.ts
  • src/integrations/brands/longcat.ts
  • src/integrations/models/longcat.ts
  • src/components/ProviderManager.test.tsx
  • src/utils/providerStartupOverrides.ts
  • src/utils/context.test.ts
  • src/utils/envFile.ts
  • README.md
  • src/integrations/descriptors.ts
  • src/integrations/vendors/longcat.ts
  • src/integrations/index.ts
  • src/services/compact/compact.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/utils/attachments.ultracode.test.ts
  • src/utils/providerProfile.test.ts
  • src/utils/providerValidation.test.ts
  • src/utils/status.routes.test.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/utils/model/providers.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/utils/effort.ultracode-display.test.ts
  • src/services/api/providerConfig.ts
  • src/utils/providerValidation.ts
  • src/utils/betas.test.ts
  • src/services/api/providerConfig.test.ts
  • src/services/api/client.ts
  • src/utils/providerAutoDetect.test.ts
  • src/services/api/client.test.ts
  • src/utils/providerProfile.ts
  • src/utils/providerProfiles.ts
  • src/utils/providerAutoDetect.ts
  • src/services/api/openaiShim.test.ts
  • src/utils/providerFlag.test.ts
  • src/integrations/routeMetadata.ts
  • src/utils/providerFlag.ts
  • src/services/api/openaiShim.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/integrations/compatibility.test.ts
  • src/utils/providerStartupOverrides.test.ts
  • src/integrations/brands/longcat.ts
  • src/integrations/models/longcat.ts
  • src/components/ProviderManager.test.tsx
  • src/utils/providerStartupOverrides.ts
  • src/utils/context.test.ts
  • src/utils/envFile.ts
  • README.md
  • src/integrations/descriptors.ts
  • src/integrations/vendors/longcat.ts
  • src/integrations/index.ts
  • src/services/compact/compact.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/utils/attachments.ultracode.test.ts
  • src/utils/providerProfile.test.ts
  • src/utils/providerValidation.test.ts
  • src/utils/status.routes.test.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/utils/model/providers.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/utils/effort.ultracode-display.test.ts
  • src/services/api/providerConfig.ts
  • src/utils/providerValidation.ts
  • src/utils/betas.test.ts
  • src/services/api/providerConfig.test.ts
  • src/services/api/client.ts
  • src/utils/providerAutoDetect.test.ts
  • src/services/api/client.test.ts
  • src/utils/providerProfile.ts
  • src/utils/providerProfiles.ts
  • src/utils/providerAutoDetect.ts
  • src/services/api/openaiShim.test.ts
  • src/utils/providerFlag.test.ts
  • src/integrations/routeMetadata.ts
  • src/utils/providerFlag.ts
  • src/services/api/openaiShim.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/integrations/compatibility.test.ts
  • src/utils/providerStartupOverrides.test.ts
  • src/integrations/brands/longcat.ts
  • src/integrations/models/longcat.ts
  • src/utils/providerStartupOverrides.ts
  • src/integrations/descriptors.ts
  • src/integrations/vendors/longcat.ts
  • src/integrations/index.ts
  • src/integrations/routeMetadata.test.ts
  • src/utils/providerProfile.test.ts
  • src/utils/providerValidation.test.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/utils/model/providers.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/services/api/providerConfig.ts
  • src/utils/providerValidation.ts
  • src/services/api/providerConfig.test.ts
  • src/services/api/client.ts
  • src/utils/providerAutoDetect.test.ts
  • src/services/api/client.test.ts
  • src/utils/providerProfile.ts
  • src/utils/providerProfiles.ts
  • src/utils/providerAutoDetect.ts
  • src/services/api/openaiShim.test.ts
  • src/utils/providerFlag.test.ts
  • src/integrations/routeMetadata.ts
  • src/utils/providerFlag.ts
  • src/services/api/openaiShim.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/integrations/compatibility.test.ts
  • src/utils/providerStartupOverrides.test.ts
  • src/components/ProviderManager.test.tsx
  • src/utils/context.test.ts
  • src/services/compact/compact.test.ts
  • src/integrations/routeMetadata.test.ts
  • src/utils/attachments.ultracode.test.ts
  • src/utils/providerProfile.test.ts
  • src/utils/providerValidation.test.ts
  • src/utils/status.routes.test.ts
  • src/services/api/claude.lifecycle.test.ts
  • src/utils/model/providers.test.ts
  • src/integrations/vendors/longcat.test.ts
  • src/utils/effort.ultracode-display.test.ts
  • src/utils/betas.test.ts
  • src/services/api/providerConfig.test.ts
  • src/utils/providerAutoDetect.test.ts
  • src/services/api/client.test.ts
  • src/services/api/openaiShim.test.ts
  • src/utils/providerFlag.test.ts
src/components/**/*.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Use React + Ink for terminal UI components under src/components/.

Files:

  • src/components/ProviderManager.test.tsx
{README.md,CONTRIBUTING.md,docs/**,.github/pull_request_template.md}

⚙️ CodeRabbit configuration file

{README.md,CONTRIBUTING.md,docs/**,.github/pull_request_template.md}: Review docs for accuracy against current code behavior. Flag security or provider claims that overpromise, stale install commands, missing setup caveats, and instructions that could push users toward unsafe credential handling. Keep purely wording-level suggestions non-blocking.

Files:

  • README.md
🪛 dotenv-linter (4.0.0)
.env.example

[warning] 397-397: [ExtraBlankLine] Extra blank line detected

(ExtraBlankLine)

🔇 Additional comments (32)
src/services/api/claude.lifecycle.test.ts (1)

45-45: LGTM!

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

69-69: LGTM!

Also applies to: 122-122, 163-163, 212-212

src/services/compact/compact.test.ts (1)

296-296: LGTM!

src/utils/attachments.ultracode.test.ts (1)

24-24: LGTM!

src/utils/betas.test.ts (1)

46-46: LGTM!

src/utils/context.test.ts (1)

32-32: LGTM!

Also applies to: 53-53, 130-134, 414-445

src/utils/effort.ultracode-display.test.ts (1)

36-36: LGTM!

src/utils/model/providers.test.ts (1)

17-17: LGTM!

Also applies to: 66-66

src/components/ProviderManager.test.tsx (1)

126-126: LGTM!

Also applies to: 145-145, 271-271, 467-467, 925-925, 949-956, 972-972, 983-983, 996-996, 1036-1036, 1049-1056, 1091-1091

src/utils/envFile.ts (1)

75-75: LGTM!

src/utils/providerAutoDetect.ts (1)

21-25: LGTM!

Also applies to: 53-53, 213-218

src/utils/providerAutoDetect.test.ts (1)

151-156: LGTM!

src/utils/providerFlag.test.ts (1)

43-43: LGTM!

Also applies to: 92-92, 272-272, 766-826

src/utils/providerFlag.ts (1)

25-25: LGTM!

Also applies to: 51-51, 324-326, 597-623

src/utils/providerValidation.test.ts (1)

34-34: LGTM!

Also applies to: 180-185

src/utils/status.routes.test.ts (1)

27-27: LGTM!

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

42-42: LGTM!

Also applies to: 331-355, 491-492, 510-512

src/utils/providerStartupOverrides.ts (1)

44-44: LGTM!

src/utils/providerStartupOverrides.test.ts (1)

25-25: LGTM!

Also applies to: 49-49

src/utils/providerValidation.ts (1)

19-19: LGTM!

Also applies to: 281-284

src/integrations/descriptors.ts (1)

46-47: LGTM!

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

59-60: LGTM!

Image-input rejection, transport-aware compression helpers, and the LongCat /openai vs /openai/v1/chat/completions vs CodeBuddy-endpoint normalization all check out against the added test matrix (bare URL, trailing slash, pre-built endpoint, CodeBuddy endpoint).

Also applies to: 1274-1895, 4364-4364, 5030-5049


4817-4890: Credential-scoping fix confirmed, with regression test.

routeAcceptsGenericOpenAICredentials now derives from getRouteDescriptor(...).setup.dedicatedCredentialsOnly (falling back to allow when routeId === null, safely narrowed via the || short-circuit before the getRouteDescriptor call), and openAIApiKeysPoolRaw/copiedProviderCredential are correctly gated on it. Traced through all new LongCat/ClinePass tests and the precedence holds in every case (dedicated key wins over a copied provider key, pool never leaks to a dedicated-only route). The previously-requested regression test (dedicated-only ClinePass route never falls back to generic OpenAI credentials) is present.

Also applies to: 4853-4853


4496-4500: 🎯 Functional Correctness

Confirm tool-calling is intentionally disabled for LongCat and document it.

This gate (skip body.tools when removeBodyFields includes 'tools') combined with the openaiShim.test.ts test 'longcat provider flag strips unsupported tool definitions' means LongCat requests never carry tool/function definitions. For a coding-agent CLI where Bash/Edit/Read tool calls are core functionality, silently dropping all tools is a major capability gap that isn't mentioned in the PR summary. Please confirm this is an intentional, documented limitation of LongCat-2.0 (and not an overly-broad removeBodyFields config) and add it to the provider's setup docs/PR description per the limitations-and-follow-up requirement for provider-change PRs.

As per path instructions, "Provider-change pull requests must identify affected providers, state the tested provider/model path, and document limitations or follow-up work."


5077-5166: LGTM!

Self-heal request-URL dedup, the responses-retry body/image-classification consistency fix (using responsesSerializedBody instead of the stale chat body), and the 404 vision_not_supported retry widening are sound and don't regress existing local-provider paths.

Also applies to: 5440-5504, 5560-5568

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

28-41: LGTM!

Correctly asserts resolveProviderRequest forces chat_completions for LongCat even when OPENAI_API_FORMAT=responses is explicitly set — matches the new precedence in providerConfig.ts.

src/services/api/providerConfig.ts (2)

1078-1101: LGTM!

Forcing requestedApiFormat to 'chat_completions' unconditionally when the catalog marks a route requiredApiFormat: 'chat_completions' correctly fixes the LongCat-forcing requirement and, as a side effect, closes the same override hole for any other chat_completions-only route (previously an explicit OPENAI_API_FORMAT could slip past a hard catalog requirement).

Also applies to: 1117-1130


85-102: 📐 Maintainability & Code Quality

GPT-5.6/Codex alias changes look unrelated to the LongCat objective — likely rebase spillover.

This addition (and reasoningFromAlias, [1m] tag stripping, GPT5_FAMILY_RE/isCodexEligibleGpt5Model) is Codex/OpenAI-alias-specific and has nothing to do with LongCat. Combined with the equivalent unrelated content in providerConfig.test.ts (gpt-5.6 tests) and openaiShim.test.ts (Gemini thinking-block fixture, L3280), and given the maintainer explicitly asked twice in this PR's thread to rebase onto main and resolve conflicts, this smells like content that leaked in from main during a rebase rather than intentional scope for this PR. Please confirm this diff is cleanly rebased and doesn't duplicate/diverge from what's already on main.

As per path instructions, "Keep pull requests focused on one issue or one clearly scoped improvement; avoid unrelated cleanup, fixes, features, or refactors in the same change."

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

58-59: LGTM!

Env isolation additions are symmetric with existing patterns, and the LongCat test cluster (credential precedence, image rejection, URL normalization variants, tool stripping) all trace correctly against the openaiShim.ts implementation.

Also applies to: 521-522, 568-569, 4678-4868

src/utils/providerProfile.ts (1)

28-28: LGTM!

Credential env-key wiring is consistent with the existing dedicated-vendor pattern, and the route-id + isLongcatBaseUrl double guard correctly prevents a stale persisted route marker from carrying the dedicated key to a retargeted endpoint — matches the added test coverage.

Also applies to: 116-116, 202-202, 1352-1353, 2052-2052, 2068-2073

src/utils/providerProfiles.ts (1)

56-56: LGTM!

Also applies to: 230-241, 812-815, 1026-1028, 1381-1383, 1450-1452

src/utils/providerProfile.test.ts (1)

312-338: LGTM!

Also applies to: 1085-1101

@jatmn

jatmn commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator Author

@kevincodex1 please merge

@kevincodex1 kevincodex1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@kevincodex1
kevincodex1 merged commit 8f81e48 into Twigpine:main Jul 20, 2026
5 checks passed
@jatmn
jatmn deleted the longcat branch July 20, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new: provider/gateway Request to add a new provider or gateway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants