feat: add Atlas Cloud provider - #229
Conversation
Signed-off-by: binyangzhu000-sudo <224954946+binyangzhu000-sudo@users.noreply.github.com>
|
@binyangzhu000-sudo is attempting to deploy a commit to the davis7dotsh Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughAtlas Cloud is added as an OpenAI-compatible provider with API-key authentication. The server registers the provider, the CLI supports connection setup and model metadata, and documentation describes environment variables and direct API-key configuration. ChangesAtlas Cloud provider integration
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
apps/server/src/providers/atlascloud.test.ts (2)
12-19: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winExercise the registered factory.
The test verifies that
factoryexists, but it creates the model withcreateAtlasClouddirectly. A brokenPROVIDER_REGISTRY.atlascloudmapping could pass this test. Create the model throughfactoryand assert the provider and model ID.🤖 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 `@apps/server/src/providers/atlascloud.test.ts` around lines 12 - 19, Update the test around getProviderFactory('atlascloud') to create the model through the retrieved factory instead of calling createAtlasCloud directly, while preserving the existing provider and modelId assertions.
17-20: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winTest the adapter configuration, not only the constant.
The test does not prove that
createAtlasClouduses the default base URL or honorsATLASCLOUD_BASE_URL. Add a mocked request test that verifies the request URL and authorization header for the default and override paths.🤖 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 `@apps/server/src/providers/atlascloud.test.ts` around lines 17 - 20, Extend the tests around createAtlasCloud to mock the outgoing request and verify that the default configuration uses ATLAS_CLOUD_BASE_URL with the expected authorization header. Add a separate test with ATLASCLOUD_BASE_URL overridden to confirm requests use the custom URL, while preserving the existing provider and model assertions.
🤖 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 `@apps/server/src/providers/atlascloud.test.ts`:
- Around line 8-10: Update the test cleanup around the ATLASCLOUD_API_KEY
environment variable: capture its pre-test value and have afterEach restore that
value when it existed, deleting the variable only when it was previously unset.
Preserve isolation without discarding shared process state.
In `@apps/server/src/providers/auth.ts`:
- Around line 146-147: Update the atlascloud authentication hint in the provider
error-message switch to use a supported connect invocation, or modify
runConnectCommand so args.provider is honored without requiring args.model;
ensure the advertised btca connect -p atlascloud command directly selects Atlas
Cloud instead of opening the generic provider selector.
---
Nitpick comments:
In `@apps/server/src/providers/atlascloud.test.ts`:
- Around line 12-19: Update the test around getProviderFactory('atlascloud') to
create the model through the retrieved factory instead of calling
createAtlasCloud directly, while preserving the existing provider and modelId
assertions.
- Around line 17-20: Extend the tests around createAtlasCloud to mock the
outgoing request and verify that the default configuration uses
ATLAS_CLOUD_BASE_URL with the expected authorization header. Add a separate test
with ATLASCLOUD_BASE_URL overridden to confirm requests use the custom URL,
while preserving the existing provider and model assertions.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8d3b952e-ae31-4fa0-aedd-5aa484302f3f
📒 Files selected for processing (9)
apps/cli/src/commands/connect.tsapps/cli/src/connect/constants.test.tsapps/cli/src/connect/constants.tsapps/docs/btca.spec.mdapps/docs/guides/authentication.mdxapps/server/src/providers/atlascloud.test.tsapps/server/src/providers/atlascloud.tsapps/server/src/providers/auth.tsapps/server/src/providers/registry.ts
| afterEach(() => { | ||
| delete process.env.ATLASCLOUD_API_KEY; | ||
| }); |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Restore the previous environment value after the test.
afterEach always deletes process.env.ATLASCLOUD_API_KEY. If the test process already contains this variable, later tests lose shared state. Capture the previous value and restore it after each test.
🤖 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 `@apps/server/src/providers/atlascloud.test.ts` around lines 8 - 10, Update the
test cleanup around the ATLASCLOUD_API_KEY environment variable: capture its
pre-test value and have afterEach restore that value when it existed, deleting
the variable only when it was previously unset. Preserve isolation without
discarding shared process state.
| case 'atlascloud': | ||
| return 'Set ATLASCLOUD_API_KEY or run "btca connect -p atlascloud".'; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Make the provider-only authentication command effective.
The hint advertises btca connect -p atlascloud. In apps/cli/src/commands/connect.ts, runConnectCommand only uses args.provider in the args.provider && args.model branch at Lines 212-213. Without a model, the command ignores the provider and opens the generic provider selector. Either honor provider-only arguments or change this hint to the supported invocation.
🤖 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 `@apps/server/src/providers/auth.ts` around lines 146 - 147, Update the
atlascloud authentication hint in the provider error-message switch to use a
supported connect invocation, or modify runConnectCommand so args.provider is
honored without requiring args.model; ensure the advertised btca connect -p
atlascloud command directly selects Atlas Cloud instead of opening the generic
provider selector.
Summary
atlascloudprovider backed by the existing OpenAI-compatible AI SDK adapterATLASCLOUD_API_KEY, default tohttps://api.atlascloud.ai/v1, and allow endpoint overrides throughATLASCLOUD_BASE_URLbtca connectwith a curated DeepSeek V4 Pro model and document the authentication flowValidation
bun run --cwd apps/server checkbun run --cwd apps/cli checkbun run --cwd apps/server test(53 passed, 6 skipped)bun test apps/cli/src(50 passed)ATLAS_OKwithdeepseek-ai/deepseek-v4-proNo dependencies or lockfiles changed. I did not run a build because the repository AGENTS.md explicitly prohibits dev/build commands.
bun run --cwd apps/docs checkcould not start because the externalmintexecutable is not installed in this environment.Note
Low Risk
Additive provider integration mirroring existing OpenRouter/openai-compat patterns; no changes to core request handling or shared auth beyond a new provider ID.
Overview
Adds Atlas Cloud as a first-class AI provider so users can route requests through Atlas’s OpenAI-compatible API instead of only generic
openai-compatsetup.On the server, a new
createAtlasCloudfactory registers in the provider registry and uses@ai-sdk/openai-compatiblewith default base URLhttps://api.atlascloud.ai/v1. Credentials resolve from OpenCodeauth.jsonorATLASCLOUD_API_KEY, with optionalATLASCLOUD_BASE_URLfor endpoint overrides. Auth status and setup hints follow the same API-key pattern as OpenRouter and MiniMax.The CLI
btca connectflow treatsatlascloudlike other API-key providers (prompt, save key, setup link to the Atlas console). Connect metadata adds label, curated default modeldeepseek-ai/deepseek-v4-pro, model catalog URL, and auth guidance. Docs (btca.spec.md, authentication guide) list the provider and env vars.Tests cover registry registration, model binding, and env-based auth for the new provider.
Reviewed by Cursor Bugbot for commit 1fa874c. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add Atlas Cloud as an OpenAI-compatible provider
atlascloudprovider backed byatlascloud.ts, usingcreateOpenAICompatiblewith credentials fromATLASCLOUD_API_KEYand base URL fromATLASCLOUD_BASE_URL(default:https://api.atlascloud.ai/v1).atlascloudin the provider registry, auth system, and CLI connect flow alongside existing API-key providers.deepseek-ai/deepseek-v4-proas the curated model and includes setup links and auth guidance in the CLI constants.ATLASCLOUD_API_KEYandATLASCLOUD_BASE_URLas supported environment variables.Macroscope summarized 1fa874c.
Greptile Summary
Adds Atlas Cloud as an API-key-authenticated OpenAI-compatible provider, including provider registration, CLI connection guidance, environment overrides, and a curated DeepSeek V4 Pro model.
The Atlas Cloud inference endpoint concern was disproved by a live credential-free check:
GET https://api.atlascloud.ai/v1/modelsreturned the configured model, and a standard request to/v1/chat/completionsreached the expected authentication check. The separate/api/v1/modelscatalog endpoint does not replace/v1as the inference endpoint.No defects were found. Safe to merge.
Confidence Score: 5/5
What T-Rex did
Reviews (1): Last reviewed commit: "feat: add Atlas Cloud provider" | Re-trigger Greptile