Repository navigation
feat: add LongCat as first-class OpenAI-compatible provider - #1986
Conversation
📝 WalkthroughWalkthroughLongCat 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. ChangesLongCat provider support
Estimated code review effort: 4 (Complex) | ~50 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 3❌ Failed checks (1 warning, 2 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ccf4705 to
0f0e73d
Compare
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (2)
src/integrations/generated/integrationArtifacts.generated.tsis excluded by!**/*.generated.*,!**/generated/**,!src/integrations/generated/**src/integrations/generated/integrationManifest.generated.tsis excluded by!**/*.generated.*,!**/generated/**,!src/integrations/generated/**
📒 Files selected for processing (21)
.env.exampleREADME.mdsrc/integrations/brands/longcat.tssrc/integrations/compatibility.test.tssrc/integrations/index.tssrc/integrations/models/longcat.tssrc/integrations/routeMetadata.test.tssrc/integrations/routeMetadata.tssrc/integrations/vendors/longcat.test.tssrc/integrations/vendors/longcat.tssrc/services/api/client.tssrc/services/api/openaiShim.test.tssrc/services/api/openaiShim.tssrc/utils/envFile.tssrc/utils/providerAutoDetect.test.tssrc/utils/providerAutoDetect.tssrc/utils/providerFlag.test.tssrc/utils/providerFlag.tssrc/utils/providerProfile.test.tssrc/utils/providerProfile.tssrc/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.
Runbun run typecheckandbun run typecheck:type-testsfor TypeScript changes.
Run provider tests and provider recommendation tests when changing provider behavior:bun run test:providerandbun run test:provider-recommendation.
Files:
src/utils/providerAutoDetect.test.tssrc/integrations/index.tssrc/integrations/routeMetadata.test.tssrc/integrations/brands/longcat.tssrc/utils/providerProfile.test.tssrc/integrations/compatibility.test.tssrc/integrations/vendors/longcat.tssrc/integrations/models/longcat.tssrc/integrations/vendors/longcat.test.tssrc/utils/envFile.tssrc/utils/providerFlag.test.tssrc/utils/providerFlag.tssrc/services/api/client.tssrc/utils/providerAutoDetect.tssrc/services/api/openaiShim.test.tssrc/services/api/openaiShim.tssrc/utils/providerProfiles.tssrc/utils/providerProfile.tssrc/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.
Runbun run security:pr-scanbefore 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.tssrc/integrations/index.tssrc/integrations/routeMetadata.test.tssrc/integrations/brands/longcat.tssrc/utils/providerProfile.test.tssrc/integrations/compatibility.test.tsREADME.mdsrc/integrations/vendors/longcat.tssrc/integrations/models/longcat.tssrc/integrations/vendors/longcat.test.tssrc/utils/envFile.tssrc/utils/providerFlag.test.tssrc/utils/providerFlag.tssrc/services/api/client.tssrc/utils/providerAutoDetect.tssrc/services/api/openaiShim.test.tssrc/services/api/openaiShim.tssrc/utils/providerProfiles.tssrc/utils/providerProfile.tssrc/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.tssrc/integrations/index.tssrc/integrations/routeMetadata.test.tssrc/integrations/brands/longcat.tssrc/utils/providerProfile.test.tssrc/integrations/compatibility.test.tsREADME.mdsrc/integrations/vendors/longcat.tssrc/integrations/models/longcat.tssrc/integrations/vendors/longcat.test.tssrc/utils/envFile.tssrc/utils/providerFlag.test.tssrc/utils/providerFlag.tssrc/services/api/client.tssrc/utils/providerAutoDetect.tssrc/services/api/openaiShim.test.tssrc/services/api/openaiShim.tssrc/utils/providerProfiles.tssrc/utils/providerProfile.tssrc/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.tssrc/integrations/index.tssrc/integrations/routeMetadata.test.tssrc/integrations/brands/longcat.tssrc/utils/providerProfile.test.tssrc/integrations/compatibility.test.tssrc/integrations/vendors/longcat.tssrc/integrations/models/longcat.tssrc/integrations/vendors/longcat.test.tssrc/utils/envFile.tssrc/utils/providerFlag.test.tssrc/utils/providerFlag.tssrc/services/api/client.tssrc/utils/providerAutoDetect.tssrc/services/api/openaiShim.test.tssrc/services/api/openaiShim.tssrc/utils/providerProfiles.tssrc/utils/providerProfile.tssrc/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.tssrc/integrations/index.tssrc/integrations/routeMetadata.test.tssrc/integrations/brands/longcat.tssrc/utils/providerProfile.test.tssrc/integrations/compatibility.test.tssrc/integrations/vendors/longcat.tssrc/integrations/models/longcat.tssrc/integrations/vendors/longcat.test.tssrc/utils/providerFlag.test.tssrc/utils/providerFlag.tssrc/services/api/client.tssrc/utils/providerAutoDetect.tssrc/services/api/openaiShim.test.tssrc/services/api/openaiShim.tssrc/utils/providerProfiles.tssrc/utils/providerProfile.tssrc/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.tssrc/integrations/routeMetadata.test.tssrc/utils/providerProfile.test.tssrc/integrations/compatibility.test.tssrc/integrations/vendors/longcat.test.tssrc/utils/providerFlag.test.tssrc/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
There was a problem hiding this comment.
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 winCover 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.0fixture assertingthinkingis sent,reasoning_effortis absent, and responsereasoning_contentis 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
📒 Files selected for processing (20)
src/components/ProviderManager.test.tsxsrc/integrations/routeMetadata.test.tssrc/integrations/routeMetadata.tssrc/integrations/vendors/longcat.test.tssrc/integrations/vendors/longcat.tssrc/services/api/claude.lifecycle.test.tssrc/services/api/client.test.tssrc/services/api/openaiShim.test.tssrc/services/api/openaiShim.tssrc/services/compact/compact.test.tssrc/utils/attachments.ultracode.test.tssrc/utils/betas.test.tssrc/utils/context.test.tssrc/utils/effort.ultracode-display.test.tssrc/utils/model/providers.test.tssrc/utils/providerFlag.test.tssrc/utils/providerFlag.tssrc/utils/providerValidation.test.tssrc/utils/providerValidation.tssrc/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.
Runbun run typecheckandbun run typecheck:type-testsfor TypeScript changes.
Run provider tests and provider recommendation tests when changing provider behavior:bun run test:providerandbun run test:provider-recommendation.
Files:
src/utils/status.routes.test.tssrc/utils/effort.ultracode-display.test.tssrc/services/api/claude.lifecycle.test.tssrc/utils/betas.test.tssrc/integrations/routeMetadata.test.tssrc/utils/attachments.ultracode.test.tssrc/utils/context.test.tssrc/utils/providerValidation.test.tssrc/utils/model/providers.test.tssrc/services/compact/compact.test.tssrc/integrations/vendors/longcat.test.tssrc/components/ProviderManager.test.tsxsrc/utils/providerValidation.tssrc/services/api/client.test.tssrc/utils/providerFlag.test.tssrc/integrations/vendors/longcat.tssrc/utils/providerFlag.tssrc/services/api/openaiShim.test.tssrc/integrations/routeMetadata.tssrc/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.
Runbun run security:pr-scanbefore 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.tssrc/utils/effort.ultracode-display.test.tssrc/services/api/claude.lifecycle.test.tssrc/utils/betas.test.tssrc/integrations/routeMetadata.test.tssrc/utils/attachments.ultracode.test.tssrc/utils/context.test.tssrc/utils/providerValidation.test.tssrc/utils/model/providers.test.tssrc/services/compact/compact.test.tssrc/integrations/vendors/longcat.test.tssrc/components/ProviderManager.test.tsxsrc/utils/providerValidation.tssrc/services/api/client.test.tssrc/utils/providerFlag.test.tssrc/integrations/vendors/longcat.tssrc/utils/providerFlag.tssrc/services/api/openaiShim.test.tssrc/integrations/routeMetadata.tssrc/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.tssrc/utils/effort.ultracode-display.test.tssrc/services/api/claude.lifecycle.test.tssrc/utils/betas.test.tssrc/integrations/routeMetadata.test.tssrc/utils/attachments.ultracode.test.tssrc/utils/context.test.tssrc/utils/providerValidation.test.tssrc/utils/model/providers.test.tssrc/services/compact/compact.test.tssrc/integrations/vendors/longcat.test.tssrc/components/ProviderManager.test.tsxsrc/utils/providerValidation.tssrc/services/api/client.test.tssrc/utils/providerFlag.test.tssrc/integrations/vendors/longcat.tssrc/utils/providerFlag.tssrc/services/api/openaiShim.test.tssrc/integrations/routeMetadata.tssrc/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.tssrc/utils/effort.ultracode-display.test.tssrc/services/api/claude.lifecycle.test.tssrc/utils/betas.test.tssrc/integrations/routeMetadata.test.tssrc/utils/attachments.ultracode.test.tssrc/utils/context.test.tssrc/utils/providerValidation.test.tssrc/utils/model/providers.test.tssrc/services/compact/compact.test.tssrc/integrations/vendors/longcat.test.tssrc/components/ProviderManager.test.tsxsrc/utils/providerValidation.tssrc/services/api/client.test.tssrc/utils/providerFlag.test.tssrc/integrations/vendors/longcat.tssrc/utils/providerFlag.tssrc/services/api/openaiShim.test.tssrc/integrations/routeMetadata.tssrc/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.tssrc/utils/effort.ultracode-display.test.tssrc/services/api/claude.lifecycle.test.tssrc/utils/betas.test.tssrc/integrations/routeMetadata.test.tssrc/utils/attachments.ultracode.test.tssrc/utils/context.test.tssrc/utils/providerValidation.test.tssrc/utils/model/providers.test.tssrc/services/compact/compact.test.tssrc/integrations/vendors/longcat.test.tssrc/components/ProviderManager.test.tsxsrc/services/api/client.test.tssrc/utils/providerFlag.test.tssrc/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.tssrc/integrations/routeMetadata.test.tssrc/utils/providerValidation.test.tssrc/utils/model/providers.test.tssrc/integrations/vendors/longcat.test.tssrc/utils/providerValidation.tssrc/services/api/client.test.tssrc/utils/providerFlag.test.tssrc/integrations/vendors/longcat.tssrc/utils/providerFlag.tssrc/services/api/openaiShim.test.tssrc/integrations/routeMetadata.tssrc/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
There was a problem hiding this comment.
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
📒 Files selected for processing (11)
src/integrations/brands/longcat.tssrc/integrations/descriptors.tssrc/integrations/models/longcat.tssrc/integrations/routeMetadata.test.tssrc/integrations/routeMetadata.tssrc/integrations/vendors/longcat.test.tssrc/integrations/vendors/longcat.tssrc/services/api/openaiShim.test.tssrc/services/api/openaiShim.tssrc/services/api/providerConfig.test.tssrc/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.
Runbun run typecheckandbun run typecheck:type-testsfor TypeScript changes.
Run provider tests and provider recommendation tests when changing provider behavior:bun run test:providerandbun run test:provider-recommendation.
Files:
src/integrations/models/longcat.tssrc/integrations/brands/longcat.tssrc/services/api/providerConfig.test.tssrc/integrations/descriptors.tssrc/integrations/routeMetadata.test.tssrc/integrations/vendors/longcat.tssrc/integrations/vendors/longcat.test.tssrc/services/api/providerConfig.tssrc/integrations/routeMetadata.tssrc/services/api/openaiShim.test.tssrc/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.
Runbun run security:pr-scanbefore 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.tssrc/integrations/brands/longcat.tssrc/services/api/providerConfig.test.tssrc/integrations/descriptors.tssrc/integrations/routeMetadata.test.tssrc/integrations/vendors/longcat.tssrc/integrations/vendors/longcat.test.tssrc/services/api/providerConfig.tssrc/integrations/routeMetadata.tssrc/services/api/openaiShim.test.tssrc/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.tssrc/integrations/brands/longcat.tssrc/services/api/providerConfig.test.tssrc/integrations/descriptors.tssrc/integrations/routeMetadata.test.tssrc/integrations/vendors/longcat.tssrc/integrations/vendors/longcat.test.tssrc/services/api/providerConfig.tssrc/integrations/routeMetadata.tssrc/services/api/openaiShim.test.tssrc/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.tssrc/integrations/brands/longcat.tssrc/services/api/providerConfig.test.tssrc/integrations/descriptors.tssrc/integrations/routeMetadata.test.tssrc/integrations/vendors/longcat.tssrc/integrations/vendors/longcat.test.tssrc/services/api/providerConfig.tssrc/integrations/routeMetadata.tssrc/services/api/openaiShim.test.tssrc/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.tssrc/integrations/brands/longcat.tssrc/services/api/providerConfig.test.tssrc/integrations/descriptors.tssrc/integrations/routeMetadata.test.tssrc/integrations/vendors/longcat.tssrc/integrations/vendors/longcat.test.tssrc/services/api/providerConfig.tssrc/integrations/routeMetadata.tssrc/services/api/openaiShim.test.tssrc/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.tssrc/integrations/routeMetadata.test.tssrc/integrations/vendors/longcat.test.tssrc/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!
|
please rebase to main and fix conflicts |
There was a problem hiding this comment.
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 winAdd focused env-file coverage.
Add
loadEnvFileregressions acceptingLONGCAT_API_KEYandOPENAI_AZURE_STYLE; these lines expand accepted--provider-env-filebehavior 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 winSplit the unrelated Azure-style routing work.
The PR objective is LongCat support, but these changes introduce and test independent
OPENAI_AZURE_STYLEpersistence 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
⛔ Files ignored due to path filters (2)
src/integrations/generated/integrationArtifacts.generated.tsis excluded by!**/*.generated.*,!**/generated/**,!src/integrations/generated/**src/integrations/generated/integrationManifest.generated.tsis excluded by!**/*.generated.*,!**/generated/**,!src/integrations/generated/**
📒 Files selected for processing (38)
.env.exampleREADME.mdsrc/components/ProviderManager.test.tsxsrc/integrations/brands/longcat.tssrc/integrations/compatibility.test.tssrc/integrations/descriptors.tssrc/integrations/index.tssrc/integrations/models/longcat.tssrc/integrations/routeMetadata.test.tssrc/integrations/routeMetadata.tssrc/integrations/vendors/longcat.test.tssrc/integrations/vendors/longcat.tssrc/services/api/claude.lifecycle.test.tssrc/services/api/client.test.tssrc/services/api/client.tssrc/services/api/openaiShim.test.tssrc/services/api/openaiShim.tssrc/services/api/providerConfig.test.tssrc/services/api/providerConfig.tssrc/services/compact/compact.test.tssrc/utils/attachments.ultracode.test.tssrc/utils/betas.test.tssrc/utils/context.test.tssrc/utils/effort.ultracode-display.test.tssrc/utils/envFile.tssrc/utils/model/providers.test.tssrc/utils/providerAutoDetect.test.tssrc/utils/providerAutoDetect.tssrc/utils/providerFlag.test.tssrc/utils/providerFlag.tssrc/utils/providerProfile.test.tssrc/utils/providerProfile.tssrc/utils/providerProfiles.tssrc/utils/providerStartupOverrides.test.tssrc/utils/providerStartupOverrides.tssrc/utils/providerValidation.test.tssrc/utils/providerValidation.tssrc/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.tssrc/integrations/index.tssrc/utils/effort.ultracode-display.test.tssrc/integrations/models/longcat.tssrc/integrations/brands/longcat.tssrc/services/api/providerConfig.test.tssrc/services/compact/compact.test.tssrc/components/ProviderManager.test.tsxsrc/utils/betas.test.tssrc/utils/providerAutoDetect.test.tssrc/utils/providerFlag.test.tssrc/utils/providerStartupOverrides.tssrc/services/api/claude.lifecycle.test.tssrc/utils/model/providers.test.tssrc/utils/providerStartupOverrides.test.tssrc/utils/providerValidation.test.tssrc/utils/status.routes.test.tssrc/integrations/routeMetadata.test.tssrc/integrations/vendors/longcat.tssrc/utils/envFile.tssrc/integrations/descriptors.tssrc/utils/context.test.tssrc/utils/providerProfile.test.tssrc/utils/attachments.ultracode.test.tssrc/services/api/providerConfig.tssrc/services/api/client.test.tssrc/integrations/vendors/longcat.test.tssrc/services/api/client.tssrc/utils/providerAutoDetect.tssrc/utils/providerFlag.tssrc/utils/providerValidation.tssrc/utils/providerProfile.tssrc/utils/providerProfiles.tssrc/services/api/openaiShim.test.tssrc/integrations/routeMetadata.tssrc/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 inSECURITY.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.tssrc/integrations/index.tssrc/utils/effort.ultracode-display.test.tssrc/integrations/models/longcat.tssrc/integrations/brands/longcat.tssrc/services/api/providerConfig.test.tssrc/services/compact/compact.test.tssrc/components/ProviderManager.test.tsxsrc/utils/betas.test.tssrc/utils/providerAutoDetect.test.tssrc/utils/providerFlag.test.tssrc/utils/providerStartupOverrides.tssrc/services/api/claude.lifecycle.test.tssrc/utils/model/providers.test.tssrc/utils/providerStartupOverrides.test.tssrc/utils/providerValidation.test.tssrc/utils/status.routes.test.tssrc/integrations/routeMetadata.test.tssrc/integrations/vendors/longcat.tssrc/utils/envFile.tssrc/integrations/descriptors.tssrc/utils/context.test.tssrc/utils/providerProfile.test.tssrc/utils/attachments.ultracode.test.tsREADME.mdsrc/services/api/providerConfig.tssrc/services/api/client.test.tssrc/integrations/vendors/longcat.test.tssrc/services/api/client.tssrc/utils/providerAutoDetect.tssrc/utils/providerFlag.tssrc/utils/providerValidation.tssrc/utils/providerProfile.tssrc/utils/providerProfiles.tssrc/services/api/openaiShim.test.tssrc/integrations/routeMetadata.tssrc/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.tssrc/integrations/index.tssrc/utils/effort.ultracode-display.test.tssrc/integrations/models/longcat.tssrc/integrations/brands/longcat.tssrc/services/api/providerConfig.test.tssrc/services/compact/compact.test.tssrc/components/ProviderManager.test.tsxsrc/utils/betas.test.tssrc/utils/providerAutoDetect.test.tssrc/utils/providerFlag.test.tssrc/utils/providerStartupOverrides.tssrc/services/api/claude.lifecycle.test.tssrc/utils/model/providers.test.tssrc/utils/providerStartupOverrides.test.tssrc/utils/providerValidation.test.tssrc/utils/status.routes.test.tssrc/integrations/routeMetadata.test.tssrc/integrations/vendors/longcat.tssrc/utils/envFile.tssrc/integrations/descriptors.tssrc/utils/context.test.tssrc/utils/providerProfile.test.tssrc/utils/attachments.ultracode.test.tsREADME.mdsrc/services/api/providerConfig.tssrc/services/api/client.test.tssrc/integrations/vendors/longcat.test.tssrc/services/api/client.tssrc/utils/providerAutoDetect.tssrc/utils/providerFlag.tssrc/utils/providerValidation.tssrc/utils/providerProfile.tssrc/utils/providerProfiles.tssrc/services/api/openaiShim.test.tssrc/integrations/routeMetadata.tssrc/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.tssrc/integrations/index.tssrc/integrations/models/longcat.tssrc/integrations/brands/longcat.tssrc/services/api/providerConfig.test.tssrc/utils/providerAutoDetect.test.tssrc/utils/providerFlag.test.tssrc/utils/providerStartupOverrides.tssrc/services/api/claude.lifecycle.test.tssrc/utils/model/providers.test.tssrc/utils/providerStartupOverrides.test.tssrc/utils/providerValidation.test.tssrc/integrations/routeMetadata.test.tssrc/integrations/vendors/longcat.tssrc/integrations/descriptors.tssrc/utils/providerProfile.test.tssrc/services/api/providerConfig.tssrc/services/api/client.test.tssrc/integrations/vendors/longcat.test.tssrc/services/api/client.tssrc/utils/providerAutoDetect.tssrc/utils/providerFlag.tssrc/utils/providerValidation.tssrc/utils/providerProfile.tssrc/utils/providerProfiles.tssrc/services/api/openaiShim.test.tssrc/integrations/routeMetadata.tssrc/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.tssrc/utils/effort.ultracode-display.test.tssrc/services/api/providerConfig.test.tssrc/services/compact/compact.test.tssrc/components/ProviderManager.test.tsxsrc/utils/betas.test.tssrc/utils/providerAutoDetect.test.tssrc/utils/providerFlag.test.tssrc/services/api/claude.lifecycle.test.tssrc/utils/model/providers.test.tssrc/utils/providerStartupOverrides.test.tssrc/utils/providerValidation.test.tssrc/utils/status.routes.test.tssrc/integrations/routeMetadata.test.tssrc/utils/context.test.tssrc/utils/providerProfile.test.tssrc/utils/attachments.ultracode.test.tssrc/services/api/client.test.tssrc/integrations/vendors/longcat.test.tssrc/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 CorrectnessComplete 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
|
bro please rebase to main and fix conflicts |
Register LongCat-2.0 in the integration catalog with LONGCAT_API_KEY auth,
/provider preset support, and zai-compatible thinking controls that emit
thinking:{type} while stripping unverified reasoning_effort fields.
This reverts commit d8b1802.
There was a problem hiding this comment.
♻️ Duplicate comments (2)
.env.example (1)
397-397: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winRemove the extra blank line.
dotenv-linterstill reportsExtraBlankLinehere.🤖 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 winRestore LongCat tool calling.
LongCat documents native tool calling, but this integration strips
toolsbefore transmission and marks the capability unsupported throughout the registry. (longcat.chat)
src/integrations/vendors/longcat.ts#L22-L26: removetoolsfromremoveBodyFields.src/integrations/vendors/longcat.ts#L56-L60: setsupportsFunctionCallingtotrue.src/integrations/brands/longcat.ts#L7-L14: setsupportsFunctionCallingtotrue.src/integrations/models/longcat.ts#L11-L20: setsupportsFunctionCallingtotrue.src/integrations/vendors/longcat.test.ts#L57-L64: assert enabled tool support and thattoolsis 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
⛔ Files ignored due to path filters (2)
src/integrations/generated/integrationArtifacts.generated.tsis excluded by!**/*.generated.*,!**/generated/**,!src/integrations/generated/**src/integrations/generated/integrationManifest.generated.tsis excluded by!**/*.generated.*,!**/generated/**,!src/integrations/generated/**
📒 Files selected for processing (38)
.env.exampleREADME.mdsrc/components/ProviderManager.test.tsxsrc/integrations/brands/longcat.tssrc/integrations/compatibility.test.tssrc/integrations/descriptors.tssrc/integrations/index.tssrc/integrations/models/longcat.tssrc/integrations/routeMetadata.test.tssrc/integrations/routeMetadata.tssrc/integrations/vendors/longcat.test.tssrc/integrations/vendors/longcat.tssrc/services/api/claude.lifecycle.test.tssrc/services/api/client.test.tssrc/services/api/client.tssrc/services/api/openaiShim.test.tssrc/services/api/openaiShim.tssrc/services/api/providerConfig.test.tssrc/services/api/providerConfig.tssrc/services/compact/compact.test.tssrc/utils/attachments.ultracode.test.tssrc/utils/betas.test.tssrc/utils/context.test.tssrc/utils/effort.ultracode-display.test.tssrc/utils/envFile.tssrc/utils/model/providers.test.tssrc/utils/providerAutoDetect.test.tssrc/utils/providerAutoDetect.tssrc/utils/providerFlag.test.tssrc/utils/providerFlag.tssrc/utils/providerProfile.test.tssrc/utils/providerProfile.tssrc/utils/providerProfiles.tssrc/utils/providerStartupOverrides.test.tssrc/utils/providerStartupOverrides.tssrc/utils/providerValidation.test.tssrc/utils/providerValidation.tssrc/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.tssrc/utils/providerStartupOverrides.test.tssrc/integrations/brands/longcat.tssrc/integrations/models/longcat.tssrc/components/ProviderManager.test.tsxsrc/utils/providerStartupOverrides.tssrc/utils/context.test.tssrc/utils/envFile.tssrc/integrations/descriptors.tssrc/integrations/vendors/longcat.tssrc/integrations/index.tssrc/services/compact/compact.test.tssrc/integrations/routeMetadata.test.tssrc/utils/attachments.ultracode.test.tssrc/utils/providerProfile.test.tssrc/utils/providerValidation.test.tssrc/utils/status.routes.test.tssrc/services/api/claude.lifecycle.test.tssrc/utils/model/providers.test.tssrc/integrations/vendors/longcat.test.tssrc/utils/effort.ultracode-display.test.tssrc/services/api/providerConfig.tssrc/utils/providerValidation.tssrc/utils/betas.test.tssrc/services/api/providerConfig.test.tssrc/services/api/client.tssrc/utils/providerAutoDetect.test.tssrc/services/api/client.test.tssrc/utils/providerProfile.tssrc/utils/providerProfiles.tssrc/utils/providerAutoDetect.tssrc/services/api/openaiShim.test.tssrc/utils/providerFlag.test.tssrc/integrations/routeMetadata.tssrc/utils/providerFlag.tssrc/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 inSECURITY.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.tssrc/utils/providerStartupOverrides.test.tssrc/integrations/brands/longcat.tssrc/integrations/models/longcat.tssrc/components/ProviderManager.test.tsxsrc/utils/providerStartupOverrides.tssrc/utils/context.test.tssrc/utils/envFile.tsREADME.mdsrc/integrations/descriptors.tssrc/integrations/vendors/longcat.tssrc/integrations/index.tssrc/services/compact/compact.test.tssrc/integrations/routeMetadata.test.tssrc/utils/attachments.ultracode.test.tssrc/utils/providerProfile.test.tssrc/utils/providerValidation.test.tssrc/utils/status.routes.test.tssrc/services/api/claude.lifecycle.test.tssrc/utils/model/providers.test.tssrc/integrations/vendors/longcat.test.tssrc/utils/effort.ultracode-display.test.tssrc/services/api/providerConfig.tssrc/utils/providerValidation.tssrc/utils/betas.test.tssrc/services/api/providerConfig.test.tssrc/services/api/client.tssrc/utils/providerAutoDetect.test.tssrc/services/api/client.test.tssrc/utils/providerProfile.tssrc/utils/providerProfiles.tssrc/utils/providerAutoDetect.tssrc/services/api/openaiShim.test.tssrc/utils/providerFlag.test.tssrc/integrations/routeMetadata.tssrc/utils/providerFlag.tssrc/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.tssrc/utils/providerStartupOverrides.test.tssrc/integrations/brands/longcat.tssrc/integrations/models/longcat.tssrc/components/ProviderManager.test.tsxsrc/utils/providerStartupOverrides.tssrc/utils/context.test.tssrc/utils/envFile.tsREADME.mdsrc/integrations/descriptors.tssrc/integrations/vendors/longcat.tssrc/integrations/index.tssrc/services/compact/compact.test.tssrc/integrations/routeMetadata.test.tssrc/utils/attachments.ultracode.test.tssrc/utils/providerProfile.test.tssrc/utils/providerValidation.test.tssrc/utils/status.routes.test.tssrc/services/api/claude.lifecycle.test.tssrc/utils/model/providers.test.tssrc/integrations/vendors/longcat.test.tssrc/utils/effort.ultracode-display.test.tssrc/services/api/providerConfig.tssrc/utils/providerValidation.tssrc/utils/betas.test.tssrc/services/api/providerConfig.test.tssrc/services/api/client.tssrc/utils/providerAutoDetect.test.tssrc/services/api/client.test.tssrc/utils/providerProfile.tssrc/utils/providerProfiles.tssrc/utils/providerAutoDetect.tssrc/services/api/openaiShim.test.tssrc/utils/providerFlag.test.tssrc/integrations/routeMetadata.tssrc/utils/providerFlag.tssrc/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.tssrc/utils/providerStartupOverrides.test.tssrc/integrations/brands/longcat.tssrc/integrations/models/longcat.tssrc/utils/providerStartupOverrides.tssrc/integrations/descriptors.tssrc/integrations/vendors/longcat.tssrc/integrations/index.tssrc/integrations/routeMetadata.test.tssrc/utils/providerProfile.test.tssrc/utils/providerValidation.test.tssrc/services/api/claude.lifecycle.test.tssrc/utils/model/providers.test.tssrc/integrations/vendors/longcat.test.tssrc/services/api/providerConfig.tssrc/utils/providerValidation.tssrc/services/api/providerConfig.test.tssrc/services/api/client.tssrc/utils/providerAutoDetect.test.tssrc/services/api/client.test.tssrc/utils/providerProfile.tssrc/utils/providerProfiles.tssrc/utils/providerAutoDetect.tssrc/services/api/openaiShim.test.tssrc/utils/providerFlag.test.tssrc/integrations/routeMetadata.tssrc/utils/providerFlag.tssrc/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.tssrc/utils/providerStartupOverrides.test.tssrc/components/ProviderManager.test.tsxsrc/utils/context.test.tssrc/services/compact/compact.test.tssrc/integrations/routeMetadata.test.tssrc/utils/attachments.ultracode.test.tssrc/utils/providerProfile.test.tssrc/utils/providerValidation.test.tssrc/utils/status.routes.test.tssrc/services/api/claude.lifecycle.test.tssrc/utils/model/providers.test.tssrc/integrations/vendors/longcat.test.tssrc/utils/effort.ultracode-display.test.tssrc/utils/betas.test.tssrc/services/api/providerConfig.test.tssrc/utils/providerAutoDetect.test.tssrc/services/api/client.test.tssrc/services/api/openaiShim.test.tssrc/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
/openaivs/openai/v1/chat/completionsvs 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.
routeAcceptsGenericOpenAICredentialsnow derives fromgetRouteDescriptor(...).setup.dedicatedCredentialsOnly(falling back to allow whenrouteId === null, safely narrowed via the||short-circuit before thegetRouteDescriptorcall), andopenAIApiKeysPoolRaw/copiedProviderCredentialare 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 CorrectnessConfirm tool-calling is intentionally disabled for LongCat and document it.
This gate (skip
body.toolswhenremoveBodyFieldsincludes'tools') combined with theopenaiShim.test.tstest'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 ofLongCat-2.0(and not an overly-broadremoveBodyFieldsconfig) 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
responsesSerializedBodyinstead of the stale chat body), and the 404vision_not_supportedretry 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
resolveProviderRequestforceschat_completionsfor LongCat even whenOPENAI_API_FORMAT=responsesis explicitly set — matches the new precedence inproviderConfig.ts.src/services/api/providerConfig.ts (2)
1078-1101: LGTM!Forcing
requestedApiFormatto'chat_completions'unconditionally when the catalog marks a routerequiredApiFormat: '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 explicitOPENAI_API_FORMATcould slip past a hard catalog requirement).Also applies to: 1117-1130
85-102: 📐 Maintainability & Code QualityGPT-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 inproviderConfig.test.ts(gpt-5.6 tests) andopenaiShim.test.ts(Gemini thinking-block fixture, L3280), and given the maintainer explicitly asked twice in this PR's thread to rebase ontomainand resolve conflicts, this smells like content that leaked in frommainduring 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 onmain.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.tsimplementation.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 +
isLongcatBaseUrldouble 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
|
@kevincodex1 please merge |
Summary
/providervia preset metadata and--provider longcat.LONGCAT_API_KEY(mirrored into the OpenAI-compatible auth path).LongCat-2.0(1M context / 128K max output).thinking: { type: "enabled" | "disabled" }reasoning_efforton the wirereasoning_contentProvider details
https://api.longcat.chat/openaiLongCat-2.0LONGCAT_API_KEY(Bearer)Files
src/integrations/vendors/longcat.tssrc/integrations/models/longcat.tssrc/integrations/brands/longcat.tsTest plan
bun installbun run buildbun run typecheckbun run typecheck:type-testsbun run test:provider(1191 pass)bun test ./src/integrations/vendors/longcat.test.ts ./src/utils/providerFlag.test.ts ./src/utils/providerAutoDetect.test.tsbun run check/bun run test:full(started; aborted mid-run in session — re-run in CI)LONGCAT_API_KEY, runopenclaude --provider longcator/provider→ LongCat, verify chat + thinkingNotes
docs/integrations/how-to/add-vendor.mdandadd-model.md.zai-compatibleserializer path (samethinking:{type}body field as LongCat docs).Summary by CodeRabbit
LONGCAT_API_KEY-based configuration, presets, and provider auto-detection..envexample with LongCat setup details.