Skip to content

feat: add Atlas Cloud LLM provider - #21

Open
binyangzhu000-sudo wants to merge 6 commits into
framerslab:masterfrom
binyangzhu000-sudo:codex/add-atlascloud-provider
Open

feat: add Atlas Cloud LLM provider#21
binyangzhu000-sudo wants to merge 6 commits into
framerslab:masterfrom
binyangzhu000-sudo:codex/add-atlascloud-provider

Conversation

@binyangzhu000-sudo

@binyangzhu000-sudo binyangzhu000-sudo commented Jul 15, 2026

Copy link
Copy Markdown

Summary

  • add an atlascloud OpenAI-compatible LLM provider wrapper with Atlas Cloud defaults
  • register Atlas Cloud in provider manager, env resolution, auto-detection, provider defaults, response-format handling, and provider assignment defaults
  • document Atlas Cloud in the LLM provider guide and update provider counts without adding sponsor, logo, credits, or partner placement

Validation

  • ./node_modules/.bin/vitest run src/core/llm/providers/__tests__/OpenAICompatProviders.test.ts src/api/runtime/__tests__/provider-defaults.test.ts src/api/runtime/__tests__/responseFormatForProvider.test.ts tests/api/model.spec.ts src/orchestration/pipeline/query/__tests__/platform-knowledge.test.ts (88 tests passed)
  • ./node_modules/.bin/tsc --noEmit
  • ./node_modules/.bin/eslint "src/**/*.ts" (passes with existing warnings)
  • git diff --check
  • verified Atlas public model catalog includes deepseek-ai/deepseek-v4-pro and qwen/qwen3.5-flash

Note: pnpm install --frozen-lockfile completed dependency resolution and ran the repository build successfully, but exited afterward with ERR_PNPM_IGNORED_BUILDS because this local pnpm setup requires approving build scripts for optional native dependencies.

Summary by Sourcery

Add Atlas Cloud as an OpenAI-compatible LLM provider and wire it into runtime defaults, auto-detection, provider assignment, and JSON response-format handling.

New Features:

  • Introduce AtlasCloudProvider wrapper using the OpenAI transport with Atlas-specific credentials, endpoint, and model catalog.
  • Support Atlas Cloud as a first-class provider in AIModelProviderManager and environment-based provider resolution.

Enhancements:

  • Extend provider defaults, auto-detect order, and provider-assignment engine to include Atlas Cloud models for text and budget routing.
  • Treat Atlas Cloud as a strict JSON schema-capable provider alongside OpenRouter for structured outputs.
  • Update tests and platform knowledge corpus to cover Atlas Cloud behavior and reflect the expanded provider count.
  • Refresh README, architecture docs, and LLM provider guide to document Atlas Cloud and bump the supported provider count to twelve.

Tests:

  • Add and update unit, integration, and e2e tests for Atlas Cloud initialization, auto-detection, model resolution, response-format selection, and platform knowledge messaging.

Summary by CodeRabbit

  • New Features

    • Added built-in support for Atlas Cloud as the 12th LLM provider.
    • Atlas Cloud is automatically detected when ATLASCLOUD_API_KEY is configured, with optional base URL customization.
    • Added default model selection for different workloads and support for structured JSON responses.
    • Included Atlas Cloud in provider assignment and routing options.
  • Documentation

    • Updated product, architecture, and provider documentation to reflect 12 supported providers and Atlas Cloud configuration details.

@sourcery-ai

sourcery-ai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a new OpenAI-compatible Atlas Cloud LLM provider and wires it into the runtime: provider manager, env resolution, auto-detection, provider defaults, response-format handling, provider assignment, tests, docs, and platform knowledge copy are all updated to treat Atlas Cloud as the 12th first-class provider.

File-Level Changes

Change Details Files
Introduce AtlasCloudProvider as an OpenAI-compatible provider wrapper and delegate transport to OpenAIProvider while defining Atlas-specific config and model catalog.
  • Implement AtlasCloudProvider class that conforms to IProvider and wraps OpenAIProvider for chat completions and streaming.
  • Define AtlasCloudProviderConfig with Atlas-specific API key, base URL, default model, and timeout options.
  • Add an Atlas Cloud model catalog constant with deepseek-ai/deepseek-v4-pro and qwen/qwen3.5-flash metadata, capabilities, and context sizes.
  • Implement listAvailableModels, getModelInfo, checkHealth, shutdown, and an explicit error for unsupported embeddings.
src/core/llm/providers/implementations/AtlasCloudProvider.ts
Register Atlas Cloud in the provider manager, environment mapping, provider defaults, auto-detection order, and provider assignment engine.
  • Extend ProviderConfigEntry union to include AtlasCloudProviderConfig and add atlascloud case in AIModelProviderManager provider factory.
  • Add atlascloud text/cheap defaults to PROVIDER_DEFAULTS and to ProviderAssignmentEngine DEFAULTS and provider preference lists for best/cheapest selection.
  • Map atlascloud to ATLASCLOUD_API_KEY and ATLASCLOUD_BASE_URL in ENV_KEY_MAP and ENV_URL_MAP used by resolveProvider.
  • Insert atlascloud into AUTO_DETECT_ORDER so ATLASCLOUD_API_KEY is auto-detected ahead of Anthropic and below OpenRouter/OpenAI.
src/core/llm/providers/AIModelProviderManager.ts
src/api/runtime/provider-defaults.ts
src/orchestration/planning/ProviderAssignmentEngine.ts
src/api/model.ts
Extend response-format handling and JSON-mode routing to support Atlas Cloud as a strict JSON-schema-capable OpenAI-compatible provider.
  • Include atlascloud in JSON_MODE_PROVIDERS set for responseFormat handling.
  • Treat atlascloud like openrouter in buildResponseFormatForProvider: strict json_schema when schema is compatible, json_object otherwise.
  • Add unit tests asserting atlascloud responseFormat behavior for plain and record schemas.
src/api/runtime/responseFormatForProvider.ts
src/api/runtime/__tests__/responseFormatForProvider.test.ts
Add Atlas Cloud-specific unit tests for provider wrapper behavior, defaults, auto-detection, and model resolution.
  • Extend OpenAICompatProviders tests to import AtlasCloudProvider and validate providerId, base URL default, API key requirement, default model ID, model catalog contents, completion delegation, and embeddings rejection.
  • Add PROVIDER_DEFAULTS.atlascloud assertions and autoDetectProvider behavior when ATLASCLOUD_API_KEY is set in OpenAICompatProviders tests.
  • Update provider-defaults tests to expect atlascloud text defaults, handle ATLASCLOUD_API_KEY cleanup, and confirm auto-detection and resolveModelOption behavior for atlascloud.
  • Add resolveProvider test to ensure atlascloud picks up ATLASCLOUD_API_KEY and ATLASCLOUD_BASE_URL and returns a config with the expected modelId.
src/core/llm/providers/__tests__/OpenAICompatProviders.test.ts
src/api/runtime/__tests__/provider-defaults.test.ts
tests/api/model.spec.ts
Update platform knowledge corpus, docs, README, architecture diagram caption, tests, and package metadata to reflect Atlas Cloud as the 12th provider and document configuration details.
  • Update LLM_PROVIDERS docs: provider counts (11→12), table rows adding Atlas Cloud, auto-detection order including ATLASCLOUD_API_KEY, env var examples, cost tier table, Atlas Cloud section with models and capabilities, and structured-output support table.
  • Adjust README, ARCHITECTURE.md diagram caption, package.json description, FAQ and API reference strings in build-knowledge-corpus.mjs to say 12 providers and include Atlas Cloud.
  • Update platform-knowledge fixtures and e2e tests so the generated text and corpus mention 12 providers and include Atlas Cloud.
  • Ensure no sponsor/logo/credits/partner placement are added; documentation changes are limited to functional provider info and counts.
docs/features/LLM_PROVIDERS.md
README.md
docs/architecture/ARCHITECTURE.md
package.json
scripts/build-knowledge-corpus.mjs
src/orchestration/pipeline/query/__tests__/platform-knowledge.test.ts
tests/e2e/platform-knowledge.e2e.spec.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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

Hey - I've found 1 issue, and left some high level feedback:

  • Consider removing or gating the console.log calls in AtlasCloudProvider.initialize and shutdown to avoid noisy logs in production; other providers tend to avoid logging at this level.
  • The ProviderConfigEntry.config union in AIModelProviderManager is becoming large; you might want to refactor it into a mapped type keyed by providerId or a discriminated union to keep the type easier to maintain as new providers like atlascloud are added.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider removing or gating the `console.log` calls in `AtlasCloudProvider.initialize` and `shutdown` to avoid noisy logs in production; other providers tend to avoid logging at this level.
- The `ProviderConfigEntry.config` union in `AIModelProviderManager` is becoming large; you might want to refactor it into a mapped type keyed by providerId or a discriminated union to keep the type easier to maintain as new providers like `atlascloud` are added.

## Individual Comments

### Comment 1
<location path="src/core/llm/providers/implementations/AtlasCloudProvider.ts" line_range="128-129" />
<code_context>
+  }
+
+  public async listAvailableModels(filter?: { capability?: string }): Promise<ModelInfo[]> {
+    if (filter?.capability) {
+      return ATLAS_CLOUD_MODELS.filter(m => m.capabilities.includes(filter.capability!));
+    }
+    return [...ATLAS_CLOUD_MODELS];
</code_context>
<issue_to_address>
**nitpick:** Avoid the non-null assertion in the capabilities filter to keep the implementation cleaner and safer.

Within the `if (filter?.capability)` block, `filter.capability` is already typed as `string`, so the `!` is unnecessary. Use `includes(filter.capability)` instead to avoid redundant assertions and keep the code safer if the filter type changes in the future.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/core/llm/providers/implementations/AtlasCloudProvider.ts Outdated
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add Atlas Cloud as a new OpenAI-compatible LLM provider

✨ Enhancement 📝 Documentation 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Adds a new AtlasCloudProvider OpenAI-compatible wrapper that delegates to OpenAIProvider with
 Atlas Cloud's endpoint/model defaults.
• Registers Atlas Cloud in the provider manager, env-key/base-URL resolution, auto-detection order,
 provider defaults, JSON response-format handling, and provider-assignment engine.
• Updates docs (LLM provider guide, README, CITATION.cff, architecture doc, knowledge corpus) to
 reflect 12 supported providers.
• Adds unit tests covering provider initialization, model catalog, defaults, auto-detection, and
 response-format behavior for the new provider.
Diagram

graph TD
  Manager["AIModelProviderManager"] --> Atlas["AtlasCloudProvider"]
  Atlas --> OpenAICompat["OpenAIProvider delegate"] --> API["Atlas Cloud API"]
  Resolver["model.ts resolveProvider"] --> Atlas
  Defaults["provider-defaults.ts"] --> Atlas
  RespFormat["responseFormatForProvider.ts"] --> Atlas
  Assignment["ProviderAssignmentEngine"] --> Atlas

  subgraph Legend
    direction LR
    _svc([Service]) ~~~ _ext{{External}}
  end
Loading
Files changed (18) +323 / -31

Enhancement (5) +18 / -7
AIModelProviderManager.tsRegister AtlasCloudProvider in provider manager factory +5/-2

Register AtlasCloudProvider in provider manager factory

• Imports AtlasCloudProvider/AtlasCloudProviderConfig, adds it to the ProviderConfigEntry union type, and adds a case in the provider factory switch statement.

src/core/llm/providers/AIModelProviderManager.ts

model.tsAdd Atlas Cloud env key and base URL mappings +2/-0

Add Atlas Cloud env key and base URL mappings

• Registers ATLASCLOUD_API_KEY and ATLASCLOUD_BASE_URL in the ENV_KEY_MAP and ENV_URL_MAP lookup tables used for credential resolution.

src/api/model.ts

provider-defaults.tsAdd Atlas Cloud default models and auto-detect probe +5/-0

Add Atlas Cloud default models and auto-detect probe

• Adds atlascloud text/cheap default model entries to PROVIDER_DEFAULTS and inserts an ATLASCLOUD_API_KEY probe into AUTO_DETECT_ORDER after OPENAI_API_KEY.

src/api/runtime/provider-defaults.ts

responseFormatForProvider.tsRoute Atlas Cloud through OpenAI-shaped JSON schema response format +3/-3

Route Atlas Cloud through OpenAI-shaped JSON schema response format

• Adds 'atlascloud' to JSON_MODE_PROVIDERS and to the openrouter branch so Atlas Cloud gets strict json_schema or json_object structured-output handling identical to OpenRouter.

src/api/runtime/responseFormatForProvider.ts

ProviderAssignmentEngine.tsAdd Atlas Cloud to provider assignment defaults and priority lists +3/-2

Add Atlas Cloud to provider assignment defaults and priority lists

• Adds atlascloud default models and inserts it into the 'best' and 'cheapest' provider priority ordering lists used for node provider assignment.

src/orchestration/planning/ProviderAssignmentEngine.ts

Tests (6) +111 / -4
OpenAICompatProviders.test.tsAdd unit tests for AtlasCloudProvider +71/-1

Add unit tests for AtlasCloudProvider

• Adds a full test suite for AtlasCloudProvider covering initialization, base URL defaults, missing API key error, default model, model catalog listing, completion delegation, embeddings rejection, PROVIDER_DEFAULTS registration, and auto-detection.

src/core/llm/providers/tests/OpenAICompatProviders.test.ts

provider-defaults.test.tsExtend provider-defaults tests with atlascloud coverage +19/-1

Extend provider-defaults tests with atlascloud coverage

• Adds atlascloud to the major-providers text-model check, env cleanup lists, and adds a dedicated auto-detect and resolveModelOption test for atlascloud.

src/api/runtime/tests/provider-defaults.test.ts

responseFormatForProvider.test.tsAdd response-format test case for atlascloud +9/-0

Add response-format test case for atlascloud

• Adds a test verifying atlascloud produces strict json_schema for plain schemas and json_object for record schemas.

src/api/runtime/tests/responseFormatForProvider.test.ts

model.spec.tsAdd resolveProvider test for Atlas Cloud env vars +10/-0

Add resolveProvider test for Atlas Cloud env vars

• Adds a test validating resolveProvider correctly resolves apiKey and baseUrl from ATLASCLOUD_API_KEY and ATLASCLOUD_BASE_URL.

tests/api/model.spec.ts

platform-knowledge.test.tsUpdate fixture provider count to 12 +1/-1

Update fixture provider count to 12

• Updates a test fixture string from '11 LLM providers' to '12 LLM providers' to match the updated knowledge corpus content.

src/orchestration/pipeline/query/tests/platform-knowledge.test.ts

platform-knowledge.e2e.spec.tsUpdate e2e mock text with Atlas Cloud provider count +1/-1

Update e2e mock text with Atlas Cloud provider count

• Updates the mocked generateText response text to reflect 12 providers and mention Atlas Cloud.

tests/e2e/platform-knowledge.e2e.spec.ts

Documentation (6) +44 / -20
LLM_PROVIDERS.mdDocument Atlas Cloud provider in LLM provider guide +36/-12

Document Atlas Cloud provider in LLM provider guide

• Adds Atlas Cloud to the table of contents, provider comparison table, auto-detection priority list, env var example, a dedicated Atlas Cloud configuration section with model table, cost tier, and tool-calling support table; updates provider counts throughout.

docs/features/LLM_PROVIDERS.md

README.mdBump documented provider count to 12 +3/-3

Bump documented provider count to 12

• Updates provider count references from 11 to 12 in the tagline, feature bullet, and package table.

README.md

CITATION.cffUpdate citation abstract provider count +1/-1

Update citation abstract provider count

• Changes the abstract text from 11 to 12 LLM providers.

CITATION.cff

ARCHITECTURE.mdUpdate architecture diagram alt text provider count +1/-1

Update architecture diagram alt text provider count

• Updates the image alt text describing the I/O and providers layer from 11 to 12 LLM providers.

docs/architecture/ARCHITECTURE.md

package.jsonUpdate package description provider count +1/-1

Update package description provider count

• Updates the npm package description from 11 to 12 LLM providers.

package.json

build-knowledge-corpus.mjsUpdate generated knowledge corpus with Atlas Cloud references +2/-2

Update generated knowledge corpus with Atlas Cloud references

• Updates the FAQ and API reference entries generated for the platform knowledge corpus to mention Atlas Cloud and the 12-provider count.

scripts/build-knowledge-corpus.mjs

Other (1) +150 / -0
AtlasCloudProvider.tsNew AtlasCloudProvider implementing IProvider via OpenAI delegate +150/-0

New AtlasCloudProvider implementing IProvider via OpenAI delegate

• Adds a new provider class that wraps OpenAIProvider with Atlas Cloud's default base URL (https://api.atlascloud.ai/v1), default model (deepseek-ai/deepseek-v4-pro), and a static model catalog (deepseek-v4-pro, qwen3.5-flash). Embeddings are explicitly unsupported and throw.

src/core/llm/providers/implementations/AtlasCloudProvider.ts

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8f62387c-b4f8-4ad4-b06e-2d7b78960994

📥 Commits

Reviewing files that changed from the base of the PR and between 22c6843 and 5421754.

📒 Files selected for processing (2)
  • docs/features/LLM_PROVIDERS.md
  • package.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • package.json
  • docs/features/LLM_PROVIDERS.md

📝 Walkthrough

Walkthrough

Atlas Cloud was added as an OpenAI-compatible LLM provider. Runtime resolution, provider assignment, structured responses, tests, documentation, and provider-count references were updated.

Changes

Atlas Cloud provider support

Layer / File(s) Summary
Provider implementation and manager wiring
src/core/llm/providers/implementations/AtlasCloudProvider.ts, src/core/llm/providers/AIModelProviderManager.ts, src/core/llm/providers/__tests__/*
Adds AtlasCloudProvider, its model catalog and configuration, OpenAI-compatible completion delegation, capability filtering, manager registration, and tests.
Runtime resolution and response formats
src/api/model.ts, src/api/runtime/*, src/orchestration/pipeline/query/*, tests/api/model.spec.ts
Adds Atlas Cloud credentials, defaults, auto-detection, model resolution, query routing, embedding-provider separation, structured-response handling, and tests.
Provider assignment defaults
src/orchestration/planning/ProviderAssignmentEngine.ts, src/orchestration/__tests__/ProviderAssignmentEngine.test.ts
Adds Atlas Cloud defaults and includes it in best, cheapest, and balanced provider selection strategies.
Provider documentation and knowledge content
CITATION.cff, README.md, docs/..., package.json, scripts/build-knowledge-corpus.mjs, tests/e2e/platform-knowledge.e2e.spec.ts
Documents Atlas Cloud, updates provider counts to 12, and aligns generated knowledge and fixtures with the provider list.

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

Sequence Diagram(s)

sequenceDiagram
  participant AIModelProviderManager
  participant AtlasCloudProvider
  participant OpenAIProvider
  AIModelProviderManager->>AtlasCloudProvider: initialize provider configuration
  AtlasCloudProvider->>OpenAIProvider: initialize compatible transport
  AtlasCloudProvider->>OpenAIProvider: delegate completion or streaming request
  OpenAIProvider-->>AtlasCloudProvider: return completion response
Loading

Possibly related PRs

  • framerslab/agentos#24: Adds another provider through similar provider wiring and selection-resolution updates.

Suggested reviewers: jddunn, victor-evogor

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the primary change: adding the Atlas Cloud LLM provider.
Description check ✅ Passed The description explains the provider integration and validation, but it omits the required Checklist and Related sections.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 846378f240

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/api/runtime/provider-defaults.ts
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jul 15, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Cheap model capability mismatch ✓ Resolved 🐞 Bug ≡ Correctness
Description
PROVIDER_DEFAULTS sets Atlas Cloud’s cheap model to qwen/qwen3.5-flash, but
AtlasCloudProvider’s model catalog declares that model as chat-only (no tool_use / json_mode),
while response-format selection treats all atlascloud calls as JSON-mode capable. This internal
mismatch can suppress tools (and raise TOOLS_NOT_SUPPORTED) for cheapest routing while still
emitting JSON response-format payloads for the same provider.
Code

src/api/runtime/provider-defaults.ts[R58-61]

+  atlascloud: {
+    text: 'deepseek-ai/deepseek-v4-pro',
+    cheap: 'qwen/qwen3.5-flash',
+  },
Evidence
The codebase sets atlascloud.cheap to qwen/qwen3.5-flash, but the model catalog marks that model
as not tool-capable, and tool support is enforced by PromptEngine/GMI based on those capabilities;
meanwhile response-format handling for atlascloud does not account for per-model capability
differences.

src/api/runtime/provider-defaults.ts[58-61]
src/core/llm/providers/implementations/AtlasCloudProvider.ts[44-65]
src/api/runtime/responseFormatForProvider.ts[21-110]
src/cognition/substrate/GMI.ts[806-816]
src/core/llm/PromptEngine.ts[271-273]
src/core/llm/PromptEngine.ts[394-396]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Atlas Cloud’s `cheap` default model is configured as `qwen/qwen3.5-flash`, but the in-repo model metadata marks it as lacking `tool_use` and `json_mode`. The runtime derives tool support from `capabilities.includes('tool_use')` and may suppress tool schema injection / flag errors, while `buildResponseFormatForProvider` still emits OpenAI-style JSON response formats for providerId `atlascloud` without model-specific gating.
### Issue Context
This is an internal consistency issue between:
- The model chosen by default for “cheap” routing.
- The declared capabilities used to determine tool support.
- The provider-level responseFormat behavior that assumes JSON-mode compatibility.
### Fix Focus Areas
- src/api/runtime/provider-defaults.ts[58-61]
- src/core/llm/providers/implementations/AtlasCloudProvider.ts[44-65]
- src/api/runtime/responseFormatForProvider.ts[21-110]
- src/cognition/substrate/GMI.ts[806-816]
- src/core/llm/PromptEngine.ts[271-273]
- src/core/llm/PromptEngine.ts[394-396]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

2. Unconditional provider logs ✓ Resolved 🐞 Bug ◔ Observability
Description
AtlasCloudProvider logs initialization/shutdown via console.log unconditionally, bypassing the
existing debug/log-level gating used by AIModelProviderManager and OpenAIProvider. This will add
noisy stdout output for library consumers and can unexpectedly surface operational configuration
(e.g., default model) even when debug is off.
Code

src/core/llm/providers/implementations/AtlasCloudProvider.ts[R95-97]

+    this.isInitialized = true;
+    console.log(`AtlasCloudProvider initialized. Default model: ${this.defaultModelId}.`);
+  }
Evidence
AtlasCloudProvider unconditionally logs on init/shutdown, while the manager and OpenAI provider
explicitly gate similar logs behind debug checks.

src/core/llm/providers/implementations/AtlasCloudProvider.ts[81-97]
src/core/llm/providers/implementations/AtlasCloudProvider.ts[144-149]
src/core/llm/providers/AIModelProviderManager.ts[68-81]
src/core/llm/providers/AIModelProviderManager.ts[167-170]
src/core/llm/providers/implementations/OpenAIProvider.ts[471-497]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`AtlasCloudProvider` uses unconditional `console.log` statements on initialize/shutdown. The rest of the provider stack already has log-gating (AGENTOS_DEBUG / AGENTOS_LOG_LEVEL), so these logs should be similarly gated or routed through the same logging mechanism.
### Issue Context
- `AIModelProviderManager` only logs init traces when debug is enabled.
- `OpenAIProvider` only logs init success when debug is enabled.
- `AtlasCloudProvider` currently always logs, which is inconsistent and noisy.
### Fix Focus Areas
- src/core/llm/providers/implementations/AtlasCloudProvider.ts[81-97]
- src/core/llm/providers/implementations/AtlasCloudProvider.ts[144-149]
- src/core/llm/providers/AIModelProviderManager.ts[68-81]
- src/core/llm/providers/implementations/OpenAIProvider.ts[471-497]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Comment thread src/core/llm/providers/implementations/AtlasCloudProvider.ts
Comment thread src/api/runtime/provider-defaults.ts

@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

🤖 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 `@docs/features/LLM_PROVIDERS.md`:
- Line 3: Update the provider breakdown in the introductory text and the
corresponding reference around the provider matrix: describe twelve providers as
9 API-key providers, Ollama, and 2 CLI providers, ensuring the category counts
sum to twelve and removing the incorrect “10 via API key” wording.

In `@src/orchestration/planning/ProviderAssignmentEngine.ts`:
- Line 109: Update the assignBalanced method’s cheap, strong, and standard
preferred-provider lists to include atlascloud in the same priority positions
used by the corresponding best and cheapest strategies, while preserving the
existing balanced rotation keys and tier selection logic.
🪄 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: CHILL

Plan: Pro Plus

Run ID: bedc9ccf-dd65-4f83-8f1c-c8e0f74832fb

📥 Commits

Reviewing files that changed from the base of the PR and between eec46c9 and 1be41ac.

📒 Files selected for processing (18)
  • CITATION.cff
  • README.md
  • docs/architecture/ARCHITECTURE.md
  • docs/features/LLM_PROVIDERS.md
  • package.json
  • scripts/build-knowledge-corpus.mjs
  • src/api/model.ts
  • src/api/runtime/__tests__/provider-defaults.test.ts
  • src/api/runtime/__tests__/responseFormatForProvider.test.ts
  • src/api/runtime/provider-defaults.ts
  • src/api/runtime/responseFormatForProvider.ts
  • src/core/llm/providers/AIModelProviderManager.ts
  • src/core/llm/providers/__tests__/OpenAICompatProviders.test.ts
  • src/core/llm/providers/implementations/AtlasCloudProvider.ts
  • src/orchestration/pipeline/query/__tests__/platform-knowledge.test.ts
  • src/orchestration/planning/ProviderAssignmentEngine.ts
  • tests/api/model.spec.ts
  • tests/e2e/platform-knowledge.e2e.spec.ts

Comment thread docs/features/LLM_PROVIDERS.md Outdated
Comment thread src/orchestration/planning/ProviderAssignmentEngine.ts

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

Caution

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

⚠️ Outside diff range comments (2)
docs/features/LLM_PROVIDERS.md (2)

62-62: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make Atlas Cloud’s cost tier consistent.

The provider matrix says Varies, while the Cost Tiers section classifies Atlas Cloud as $$ (Standard). Choose one source of truth and update both sections accordingly.

Also applies to: 249-249

🤖 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 `@docs/features/LLM_PROVIDERS.md` at line 62, Update the Atlas Cloud entries in
the provider matrix and Cost Tiers section of LLM_PROVIDERS.md to use one
consistent cost classification. Choose either “Varies” or “$$ (Standard)” as the
authoritative value, then apply that same value to both sections.

62-62: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Qualify Atlas Cloud capabilities as model-dependent.

The provider’s model catalog shows tool use and structured outputs for DeepSeek, but Qwen is chat-only. Mark these table entries as model-dependent, or limit the “Yes” claims to models that support those capabilities.

Also applies to: 517-517

🤖 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 `@docs/features/LLM_PROVIDERS.md` at line 62, Update the Atlas Cloud row in the
provider capabilities table so tool use and structured outputs are marked as
model-dependent rather than unconditionally supported, reflecting that DeepSeek
supports them while Qwen is chat-only.
🤖 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/orchestration/pipeline/query/types.ts`:
- Line 814: The Atlas cheap-tier defaults and assignments currently use the Pro
model; update the Atlas cheap paths in src/orchestration/pipeline/query/types.ts
(814-814) and src/orchestration/planning/ProviderAssignmentEngine.ts (26-26) to
use the cheaper Atlas Flash/V4 Flash model. Relax the corresponding expectations
in src/orchestration/pipeline/query/__tests__/QueryRouter.test.ts (278-282) and
src/orchestration/__tests__/ProviderAssignmentEngine.test.ts (82-90) so
cheap-tier tests no longer require the Pro model.

---

Outside diff comments:
In `@docs/features/LLM_PROVIDERS.md`:
- Line 62: Update the Atlas Cloud entries in the provider matrix and Cost Tiers
section of LLM_PROVIDERS.md to use one consistent cost classification. Choose
either “Varies” or “$$ (Standard)” as the authoritative value, then apply that
same value to both sections.
- Line 62: Update the Atlas Cloud row in the provider capabilities table so tool
use and structured outputs are marked as model-dependent rather than
unconditionally supported, reflecting that DeepSeek supports them while Qwen is
chat-only.
🪄 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: CHILL

Plan: Pro Plus

Run ID: c9649070-86bf-4703-a076-1eea2d61e334

📥 Commits

Reviewing files that changed from the base of the PR and between 1be41ac and 4b4d09c.

📒 Files selected for processing (11)
  • README.md
  • docs/features/LLM_PROVIDERS.md
  • package.json
  • src/api/runtime/provider-defaults.ts
  • src/core/llm/providers/__tests__/OpenAICompatProviders.test.ts
  • src/core/llm/providers/implementations/AtlasCloudProvider.ts
  • src/orchestration/__tests__/ProviderAssignmentEngine.test.ts
  • src/orchestration/pipeline/query/QueryRouter.ts
  • src/orchestration/pipeline/query/__tests__/QueryRouter.test.ts
  • src/orchestration/pipeline/query/types.ts
  • src/orchestration/planning/ProviderAssignmentEngine.ts
💤 Files with no reviewable changes (1)
  • src/core/llm/providers/implementations/AtlasCloudProvider.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • package.json
  • README.md
  • src/api/runtime/provider-defaults.ts
  • src/core/llm/providers/tests/OpenAICompatProviders.test.ts

Comment thread src/orchestration/pipeline/query/types.ts Outdated

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

Caution

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

⚠️ Outside diff range comments (2)
src/orchestration/pipeline/query/types.ts (1)

791-791: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Do not route embeddings through Atlas by default.

When ATLASCLOUD_API_KEY is the available credential, resolveDefaultProvider() returns atlascloud; DEFAULT_QUERY_ROUTER_CONFIG then uses that same provider for embeddings while selecting text-embedding-3-small. The provider documentation states Atlas has no embedding support, so default knowledge/retrieval paths can fail. Resolve embeddings independently to a supported provider or disable them for Atlas-only configurations.

🤖 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/orchestration/pipeline/query/types.ts` at line 791, Update
resolveDefaultProvider and DEFAULT_QUERY_ROUTER_CONFIG so an ATLASCLOUD_API_KEY
does not select Atlas for embeddings; resolve embeddings through a supported
provider independently, or disable embeddings when Atlas is the only configured
provider, while preserving Atlas as the default query provider.
docs/features/LLM_PROVIDERS.md (1)

116-125: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Align the documented auto-detection order with the runtime resolver.

The guide lists OpenRouter first, but resolveDefaultProvider() checks OPENAI_API_KEY, then ATLASCLOUD_API_KEY, and only later OPENROUTER_API_KEY. With multiple keys set, the documentation and runtime choose different providers. Update either the list or the resolver so this priority contract is accurate.

🤖 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 `@docs/features/LLM_PROVIDERS.md` around lines 116 - 125, Align the
auto-detection priority documented in LLM_PROVIDERS.md with
resolveDefaultProvider(): place OPENROUTER_API_KEY after OPENAI_API_KEY and
ATLASCLOUD_API_KEY, matching the runtime resolver’s actual order. Preserve the
remaining provider order and descriptions.
🤖 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 `@docs/features/LLM_PROVIDERS.md`:
- Around line 116-125: Align the auto-detection priority documented in
LLM_PROVIDERS.md with resolveDefaultProvider(): place OPENROUTER_API_KEY after
OPENAI_API_KEY and ATLASCLOUD_API_KEY, matching the runtime resolver’s actual
order. Preserve the remaining provider order and descriptions.

In `@src/orchestration/pipeline/query/types.ts`:
- Line 791: Update resolveDefaultProvider and DEFAULT_QUERY_ROUTER_CONFIG so an
ATLASCLOUD_API_KEY does not select Atlas for embeddings; resolve embeddings
through a supported provider independently, or disable embeddings when Atlas is
the only configured provider, while preserving Atlas as the default query
provider.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 892221bf-6810-490e-87a7-2caf5692f12a

📥 Commits

Reviewing files that changed from the base of the PR and between 4b4d09c and 56aca12.

📒 Files selected for processing (8)
  • docs/features/LLM_PROVIDERS.md
  • package.json
  • src/api/runtime/provider-defaults.ts
  • src/core/llm/providers/__tests__/OpenAICompatProviders.test.ts
  • src/orchestration/__tests__/ProviderAssignmentEngine.test.ts
  • src/orchestration/pipeline/query/__tests__/QueryRouter.test.ts
  • src/orchestration/pipeline/query/types.ts
  • src/orchestration/planning/ProviderAssignmentEngine.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/orchestration/tests/ProviderAssignmentEngine.test.ts
  • package.json
  • src/api/runtime/provider-defaults.ts
  • src/orchestration/pipeline/query/tests/QueryRouter.test.ts
  • src/orchestration/planning/ProviderAssignmentEngine.ts
  • src/core/llm/providers/tests/OpenAICompatProviders.test.ts

- preserve Atlas as QueryRouter default text provider
- disable vector embeddings for Atlas-only environments
- clarify runtime versus QueryRouter auto-detection order
- add focused regression coverage

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

Copy link
Copy Markdown
Author

Follow-up pushed in 22c6843:

  • merged the current upstream master and resolved the package metadata conflict while preserving version 0.10.4;
  • kept Atlas Cloud as the QueryRouter text provider, but resolved embeddings independently so Atlas-only environments use the existing keyword fallback instead of sending an Atlas key to an unsupported embeddings path;
  • clarified the public runtime vs. QueryRouter auto-detection ordering;
  • added regression assertions for the Atlas-only embedding behavior.

Validation:

  • QueryRouter: 33/33 tests passed
  • Atlas/provider/routing focused suites: 105/105 tests passed
  • tsc --noEmit passed
  • npm run build passed
  • GitHub reports the PR mergeable and 0 commits behind master.

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

Copy link
Copy Markdown
Author

Resolved the merge conflict with the current upstream master in 5421754a.

The QueryRouter feedback is also covered by the current branch: Atlas Cloud is included in default provider detection, LLM API-key resolution, cheap/strong model mappings, and regression coverage. Embeddings intentionally remain on embedding-capable providers.

Validation:

  • pnpm exec vitest run ... (6 files, 131 tests passed)
  • pnpm run typecheck
  • pnpm run build
  • git diff --check

GitHub now reports the PR as mergeable. The exact-head CI workflow currently requires maintainer approval.

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