Skip to content

feat: add Atlas Cloud provider - #229

Open
binyangzhu000-sudo wants to merge 1 commit into
davis7dotsh:mainfrom
binyangzhu000-sudo:codex/add-atlas-cloud-provider
Open

feat: add Atlas Cloud provider#229
binyangzhu000-sudo wants to merge 1 commit into
davis7dotsh:mainfrom
binyangzhu000-sudo:codex/add-atlas-cloud-provider

Conversation

@binyangzhu000-sudo

@binyangzhu000-sudo binyangzhu000-sudo commented Aug 3, 2026

Copy link
Copy Markdown

Summary

  • add a first-class atlascloud provider backed by the existing OpenAI-compatible AI SDK adapter
  • use ATLASCLOUD_API_KEY, default to https://api.atlascloud.ai/v1, and allow endpoint overrides through ATLASCLOUD_BASE_URL
  • expose Atlas Cloud in btca connect with a curated DeepSeek V4 Pro model and document the authentication flow

Validation

  • bun run --cwd apps/server check
  • bun run --cwd apps/cli check
  • bun run --cwd apps/server test (53 passed, 6 skipped)
  • bun test apps/cli/src (50 passed)
  • Prettier check for all changed files
  • real AI SDK request through the new provider returned ATLAS_OK with deepseek-ai/deepseek-v4-pro

No 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 check could not start because the external mint executable 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-compat setup.

On the server, a new createAtlasCloud factory registers in the provider registry and uses @ai-sdk/openai-compatible with default base URL https://api.atlascloud.ai/v1. Credentials resolve from OpenCode auth.json or ATLASCLOUD_API_KEY, with optional ATLASCLOUD_BASE_URL for endpoint overrides. Auth status and setup hints follow the same API-key pattern as OpenRouter and MiniMax.

The CLI btca connect flow treats atlascloud like other API-key providers (prompt, save key, setup link to the Atlas console). Connect metadata adds label, curated default model deepseek-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

  • Adds a new atlascloud provider backed by atlascloud.ts, using createOpenAICompatible with credentials from ATLASCLOUD_API_KEY and base URL from ATLASCLOUD_BASE_URL (default: https://api.atlascloud.ai/v1).
  • Registers atlascloud in the provider registry, auth system, and CLI connect flow alongside existing API-key providers.
  • Adds deepseek-ai/deepseek-v4-pro as the curated model and includes setup links and auth guidance in the CLI constants.
  • Updates docs to list ATLASCLOUD_API_KEY and ATLASCLOUD_BASE_URL as 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/models returned the configured model, and a standard request to /v1/chat/completions reached the expected authentication check. The separate /api/v1/models catalog endpoint does not replace /v1 as the inference endpoint.

No defects were found. Safe to merge.

Confidence Score: 5/5

T-Rex T-Rex Logs

What T-Rex did

  • Observed that GET https://api.atlascloud.ai/v1/models returns 125 inference models and exact_configured_model_present: True, while POST https://api.atlascloud.ai/v1/chat/completions without credentials returns 401 with an invalid token.
  • Inspected the relevant code paths and confirmed the base URL is declared in apps/server/src/providers/atlascloud.ts and is passed into createOpenAICompatible to form the chat model.
  • Reviewed the credential-free live endpoint probe source script atlascloud-contract-check.sh to understand how the probe is performed against the Atlas Cloud endpoints.
  • Examined the Atlas Cloud endpoint contract probe output artifact to verify that the probe executed and recorded endpoint interactions as intended.
  • Reviewed the PR Atlas Cloud provider and configured model lines to confirm the base URL and model configuration are established in the PR.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "feat: add Atlas Cloud provider" | Re-trigger Greptile

Signed-off-by: binyangzhu000-sudo <224954946+binyangzhu000-sudo@users.noreply.github.com>
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

@binyangzhu000-sudo is attempting to deploy a commit to the davis7dotsh Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

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

Changes

Atlas Cloud provider integration

Layer / File(s) Summary
Provider runtime and authentication
apps/server/src/providers/atlascloud.ts, apps/server/src/providers/auth.ts, apps/server/src/providers/registry.ts, apps/server/src/providers/atlascloud.test.ts
The server adds the Atlas Cloud factory, API-key and base URL handling, registry registration, authentication hints, and provider tests.
CLI connection metadata and API-key flow
apps/cli/src/connect/constants.ts, apps/cli/src/commands/connect.ts, apps/cli/src/connect/constants.test.ts
The CLI adds the DeepSeek V4 Pro model, Atlas Cloud metadata, setup links, API-key prompting, and metadata tests.
Provider usage documentation
apps/docs/btca.spec.md, apps/docs/guides/authentication.mdx
The documentation describes Atlas Cloud API-key authentication, ATLASCLOUD_API_KEY, and the optional ATLASCLOUD_BASE_URL override.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding the Atlas Cloud provider.
Description check ✅ Passed The description accurately explains the Atlas Cloud provider integration, configuration, CLI support, documentation, and validation.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
apps/server/src/providers/atlascloud.test.ts (2)

12-19: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Exercise the registered factory.

The test verifies that factory exists, but it creates the model with createAtlasCloud directly. A broken PROVIDER_REGISTRY.atlascloud mapping could pass this test. Create the model through factory and 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 win

Test the adapter configuration, not only the constant.

The test does not prove that createAtlasCloud uses the default base URL or honors ATLASCLOUD_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

📥 Commits

Reviewing files that changed from the base of the PR and between 864e5ba and 1fa874c.

📒 Files selected for processing (9)
  • apps/cli/src/commands/connect.ts
  • apps/cli/src/connect/constants.test.ts
  • apps/cli/src/connect/constants.ts
  • apps/docs/btca.spec.md
  • apps/docs/guides/authentication.mdx
  • apps/server/src/providers/atlascloud.test.ts
  • apps/server/src/providers/atlascloud.ts
  • apps/server/src/providers/auth.ts
  • apps/server/src/providers/registry.ts

Comment on lines +8 to +10
afterEach(() => {
delete process.env.ATLASCLOUD_API_KEY;
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment on lines +146 to +147
case 'atlascloud':
return 'Set ATLASCLOUD_API_KEY or run "btca connect -p atlascloud".';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant