Skip to content

fix(atlas-cloud): vendor to gateway catalog correction and added reasoning support - #1785

Merged
kevincodex1 merged 4 commits into
Twigpine:mainfrom
jatmn:atlas-effort
Jun 25, 2026
Merged

kevincodex1 merged 4 commits into
Twigpine:mainfrom
jatmn:atlas-effort

Conversation

@jatmn

@jatmn jatmn commented Jun 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Move Atlas Cloud from a direct vendor descriptor to a hosted OpenAI-compatible gateway while preserving the atlas-cloud preset, dedicated ATLAS_CLOUD_API_KEY handling, default base URL/model behavior, and generated integration metadata.
  • Keep Atlas as a gateway catalog over shared upstream model descriptors instead of letting it own a separate provider/vendor catalog.
  • Add shared model descriptors needed by the Atlas catalog across Claude, Gemini, GLM, Kimi, OpenAI-compatible alias, Qwen, and xAI catalogs.
  • Add conservative Atlas reasoning metadata for exact probed models, including top-level reasoning_effort levels for verified Atlas routes and Grok Build as always-on/no-wire reasoning.
  • Add explicit, opt-in catalog aliases for Atlas model entries whose descriptor IDs differ from Atlas API model IDs, so user-facing names such as glm-5.2 route to Atlas API names such as zai-org/glm-5.2 without provider-specific gateway hacks.
  • Make /effort metadata lookup use the same explicit aliases so effort controls match the model ID that will be sent over the wire.

Shared Catalog Updates

This PR intentionally updates the shared/main model descriptor catalogs because Atlas is now modeled as a gateway over existing upstream model families rather than as a standalone provider with private model ownership.

  • src/integrations/models/claude.ts: adds claude-opus-4-8 for Atlas Claude Opus routing.
  • src/integrations/models/gemini.ts: adds gemini-3.5-flash and google/gemini-3.1-pro-preview descriptors used by Atlas.
  • src/integrations/models/glm.ts: adds glm-5v-turbo and glm-4.6 descriptors used by Atlas GLM routes.
  • src/integrations/models/kimi.ts: adds kimi-k2.7-code for the Atlas Kimi coding route.
  • src/integrations/models/qwen.ts: adds Atlas-covered Qwen text, VL, Next, and instruct descriptors, including non-reasoning instruct variants where appropriate.
  • src/integrations/models/xai.ts: adds xai/grok-build-0.1 as a shared xAI descriptor while the Atlas gateway marks it always-on/no-wire for reasoning controls.
  • src/integrations/models/openai-compatible-alias.ts: adds neutral aliases for Atlas-only/non-core upstream IDs such as DeepSeek V3.2 Exp, Doubao Seed, KAT Coder, and OWL.

These descriptor additions are referenced by the Atlas gateway catalog; they are not intended to turn Atlas into a new frontier/provider vendor.

Impact

Atlas Cloud remains selectable as atlas-cloud, but it now routes as an OpenAI-compatible gateway over the openai transport instead of being treated as a frontier/provider vendor. Existing Atlas env behavior is preserved for ATLAS_CLOUD_API_KEY, ATLAS_CLOUD_MODEL, and OPENAI_MODEL.

The /effort behavior is limited to Atlas catalog entries with evidence-backed metadata. Atlas models with verified top-level reasoning_effort support expose only the confirmed levels, and xai/grok-build-0.1 is marked reasoning-capable but does not serialize an effort control.

The alias routing is generic and catalog-driven: routes only rewrite model names when their own catalog entry declares an explicit alias. Current OpenRouter and Hicap gateway configs do not declare aliases, and focused resolver tests verify their model names remain unchanged.

Provider Path Tested

  • Atlas Cloud OpenAI-compatible route: https://api.atlascloud.ai/v1
  • Focused Atlas alias examples:
    • glm-5.2 -> zai-org/glm-5.2
    • claude-sonnet-4-6 -> anthropic/claude-sonnet-4.6
    • claude-sonnet-4-6-coding -> anthropic/claude-sonnet-4.6-coding
  • Cross-provider routing checks:
    • OpenRouter gpt-5-mini stays gpt-5-mini
    • Hicap claude-opus-4-7 stays claude-opus-4-7
  • Full Atlas catalog local check: 52 rows, 0 descriptor/API-name mismatches left without an explicit alias.
  • bun run doctor:runtime reached https://api.atlascloud.ai/v1/models with status 200 in the local Atlas profile.

Validation

Earlier PR validation:

  • bun install
  • bun run build
  • bun run smoke
  • bun run check
    • Passed with 5071 pass, 0 fail
  • bun run typecheck
  • bun run typecheck:type-tests
  • bun run test:provider
    • Passed with 905 pass, 0 fail
  • bun run test:provider-recommendation
    • Passed with 103 pass, 0 fail
  • bun run security:pr-scan -- --base HEAD~1 --head HEAD
  • bun run doctor:runtime

Additional validation after the alias-routing update:

  • bun test src/services/api/providerConfig.test.ts
    • Passed with 6 pass, 0 fail
  • bun test src/utils/effort.codex.test.ts
    • Passed with 23 pass, 0 fail
  • bun run typecheck
  • bun run integrations:check
  • git diff --check

I did not run Python or web checks because this change does not touch python/ or web/.

Notes

  • No issue linked.
  • Submitted as a draft for maintainer review because the Atlas reasoning metadata is intentionally conservative and based on probe evidence rather than enabling broad controls for every Atlas reasoning-capable model.

Summary by CodeRabbit

  • New Features

    • Added Atlas Cloud as a supported gateway, with access to its verified model catalog.
    • Expanded available model options with additional variants and updated limits across Claude, Gemini, GLM, Kimi, Qwen, and xAI.
  • Bug Fixes

    • Improved reasoning/effort behavior so only eligible Atlas Cloud models expose controllable reasoning controls.
    • Fixed provider override requests to send (or omit) reasoning_effort correctly for Atlas-backed models.
    • Enhanced model alias resolution using route-specific catalog mappings to return the correct target model.

Move Atlas Cloud from a direct vendor descriptor to a hosted OpenAI-compatible gateway while preserving the atlas-cloud preset, dedicated ATLAS_CLOUD_API_KEY handling, model env defaults, and generated integration metadata.

Add shared upstream model descriptors needed by the Atlas gateway catalog so Atlas entries do not own model metadata or resolve through NearAI-scoped descriptors.

Add conservative Atlas reasoning metadata for verified Kimi effort levels and Grok Build always-on/no-wire reasoning, plus resolver and OpenAI shim tests for top-level reasoning_effort serialization and no-wire behavior.
@coderabbitai

coderabbitai Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b8679830-4383-418b-b577-5788770d57cb

📥 Commits

Reviewing files that changed from the base of the PR and between 7db0fd3 and 3b60dd8.

📒 Files selected for processing (2)
  • src/integrations/compatibility.test.ts
  • src/services/api/providerConfig.test.ts
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (15)
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript with strict mode and ESM imports

Files:

  • src/integrations/compatibility.test.ts
  • src/services/api/providerConfig.test.ts
{src/integrations/**/*.ts,src/services/**/*.ts}

📄 CodeRabbit inference engine (AGENTS.md)

Test the exact provider/model path you changed when possible for provider modifications

Files:

  • src/integrations/compatibility.test.ts
  • src/services/api/providerConfig.test.ts
src/integrations/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Check existing provider implementations before adding a new pattern

Files:

  • src/integrations/compatibility.test.ts
**/*.{ts,tsx,js,jsx,py,json,md}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Follow the existing code style in the touched files

Files:

  • src/integrations/compatibility.test.ts
  • src/services/api/providerConfig.test.ts
**/*.test.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add or update tests when the change affects behavior

Files:

  • src/integrations/compatibility.test.ts
  • src/services/api/providerConfig.test.ts
**/*.test.{ts,tsx,js}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Test the exact provider/model path you changed when possible

Files:

  • src/integrations/compatibility.test.ts
  • src/services/api/providerConfig.test.ts
**/*.{ts,tsx,js,jsx,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Keep comments useful and concise

Files:

  • src/integrations/compatibility.test.ts
  • src/services/api/providerConfig.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Follow TypeScript strict mode and type safety practices by running typecheck before submitting

Files:

  • src/integrations/compatibility.test.ts
  • src/services/api/providerConfig.test.ts
**

⚙️ CodeRabbit configuration file

**: # AGENTS.md - AI Agent Coding Guide

This guide is for AI coding agents working in the OpenClaude repository. Read it before changing code, and also follow CONTRIBUTING.md for contributor policy, PR expectations, review follow-up, and project scope.

Project Snapshot

OpenClaude is a coding-agent CLI for cloud and local model providers. It supports OpenAI-compatible APIs, Anthropic, Gemini, DeepSeek, Ollama, MCP, local backends, slash commands, tools, agents, and a React/Ink terminal UI.

The installed CLI runs on Node.js >=22.0.0. Bun is used for source builds, scripts, dependency management, and tests.

Work Style

  • Keep changes focused on one problem.
  • Prefer existing patterns in the file or nearby module.
  • Avoid unrelated formatting, renames, dependency changes, or broad rewrites.
  • Add or update tests when behavior changes.
  • Update docs when setup, commands, provider behavior, or user-facing behavior changes.
  • For new features, larger refactors, dependencies, or runtime changes, follow the issue-first guidance in CONTRIBUTING.md.

Stack And Conventions

  • TypeScript with strict mode and ESM imports.
  • React + Ink for terminal UI.
  • Bun lockfile and Bun scripts for development workflows.
  • Node runtime for the built CLI.
  • Python exists for legacy/local-provider helper code. Do not add new Python code or expand Python-based features unless a maintainer explicitly approves that direction.

Common libraries and patterns:

  • chalk for terminal color.
  • commander for CLI argument parsing.
  • execa for child processes.
  • Existing service, provider, settings, permission, and UI patterns over new abstractions.

Repository Map

  • src/commands/ - slash and CLI command implementations.
  • src/components/ - React/Ink UI components.
  • src/services/ - API, MCP, OAuth, wiki, voice, and other service integrations.
  • src/tools/ - tool implementations.
  • src/utils/ - shared utilities.
  • `src/integration...

Files:

  • src/integrations/compatibility.test.ts
  • src/services/api/providerConfig.test.ts
**/*

⚙️ CodeRabbit configuration file

**/*: Apply the OpenClaude maintainer review rubric from AGENTS.md. Review the current diff, not stale discussion context. Separate real blockers from suggestions. Do not request changes for vague style churn. Treat approval as merge-ready from CodeRabbit's side, pending required human review and GitHub Checks. If checks are failing or unavailable, say so clearly instead of implying the PR is fully ready.

Files:

  • src/integrations/compatibility.test.ts
  • src/services/api/providerConfig.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/integrations/compatibility.test.ts
  • src/services/api/providerConfig.test.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/integrations/compatibility.test.ts
  • src/services/api/providerConfig.test.ts
{src/commands/**/*.ts,src/services/**/*.ts,src/entrypoints/**/*.ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use chalk for terminal color in CLI code

Files:

  • src/services/api/providerConfig.test.ts
{src/services/**/*.ts,src/utils/**/*.ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use execa for child processes

Files:

  • src/services/api/providerConfig.test.ts
src/**/*provider*.{ts,tsx,js}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Provider implementations must follow documented patterns in docs/integrations/

Files:

  • src/services/api/providerConfig.test.ts
🔇 Additional comments (2)
src/services/api/providerConfig.test.ts (1)

53-57: LGTM!

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

96-99: LGTM!


📝 Walkthrough

Walkthrough

Adds an Atlas Cloud gateway, updates route and alias resolution, extends Atlas Cloud effort and request tests, and adds new model entries plus Qwen helper-based exports.

Changes

Atlas Cloud integration

Layer / File(s) Summary
Gateway module and route selection
src/integrations/gateways/atlas-cloud.ts, src/utils/providerProfiles.ts, src/integrations/vendors/atlas-cloud.ts
Adds the Atlas Cloud gateway definition with OpenAI-compatible transport, API-key auth, catalog data, and changes Atlas Cloud startup-profile selection to check route.routeId; the old vendor module is removed.
Provider alias resolution
src/services/api/providerConfig.ts, src/services/api/providerConfig.test.ts, src/integrations/descriptors.ts
Resolves route-catalog aliases in provider requests and adds tests for AtlasCloud, OpenRouter, and Hicap routing behavior; ModelCatalogEntry gains aliases.
Reasoning effort metadata
src/utils/effort.ts, src/services/api/client.test.ts, src/utils/effort.codex.test.ts
Catalog reasoning lookup matches aliases, and Atlas-backed request and effort tests assert model-specific reasoning control and wire-format behavior.
Atlas compatibility checks
src/integrations/compatibility.test.ts
Adds assertions for the atlas-cloud gateway shape and its gateway model set.

Model catalog updates

Layer / File(s) Summary
Qwen helpers and export rewrites
src/integrations/models/qwen.ts
Adds qwenTextModel and qwenInstructModel helpers and updates the exported Qwen model list to use them.
Additional model entries
src/integrations/models/claude.ts, src/integrations/models/gemini.ts, src/integrations/models/glm.ts, src/integrations/models/kimi.ts, src/integrations/models/openai-compatible-alias.ts, src/integrations/models/xai.ts
Adds new model entries for Claude, Gemini, GLM, Kimi, OpenAI-compatible aliases, and XAI.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Gitlawb/openclaude#1585: Atlas Cloud provider/profile routing changes and the new Atlas Cloud gateway plumbing overlap with this PR’s Atlas Cloud integration work.
  • Gitlawb/openclaude#1754: This PR also touches Atlas Cloud model/catalog metadata, including XAI Grok build reasoning metadata changes.
  • Gitlawb/openclaude#1780: Both PRs change reasoning-effort routing and validation around model-level effort controls.

Suggested labels

new: provider/gateway, bug

Suggested reviewers

  • kevincodex1
🚥 Pre-merge checks | ✅ 5 | ❌ 2

❌ Failed checks (2 warnings)

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.
Risk Surface Disclosed ⚠️ Warning PR changes auth/routing/network/startup paths, but the review only says it’s a conservative draft; it never explicitly states blocker/no-blocker. Add an explicit review note covering the risk surface (auth, provider routing, outbound rewrites, startup env) and state clearly whether it is a blocker.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the Atlas Cloud gateway/catalog and reasoning support changes.
Description check ✅ Passed The description covers summary, impact, testing, and notes, with enough detail despite using a custom testing section.
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.
No Hidden Policy Change ✅ Passed Atlas gateway/auth/alias/reasoning changes are explicit in dedicated files and tests; I found no extra policy-affecting behavior hidden in cleanup.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@jatmn jatmn changed the title Fix Atlas Cloud gateway catalog fix(atlas-cloud) vendor to gateway catalog Jun 25, 2026
@jatmn jatmn self-assigned this Jun 25, 2026
@jatmn jatmn added the enhancement New feature or request label Jun 25, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/integrations/compatibility.test.ts`:
- Around line 95-99: The Atlas Cloud gateway test is too weak because filtering
for vendorId === 'nearai' can pass even if getModelsForGateway('atlas-cloud')
returns no models at all. In compatibility.test.ts, strengthen the assertion in
the test around getModelsForGateway so it still verifies no NearAI-scoped
descriptors are present while also asserting a positive baseline on the returned
catalog (using the existing getModelsForGateway helper and model list), ensuring
the registry is not silently empty.
🪄 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: 39179862-5f3e-44d1-be00-261bc2378316

📥 Commits

Reviewing files that changed from the base of the PR and between a723540 and d5b1762.

⛔ Files ignored due to path filters (2)
  • src/integrations/generated/integrationArtifacts.generated.ts is excluded by !**/generated/**, !src/integrations/generated/**
  • src/integrations/generated/integrationManifest.generated.ts is excluded by !**/generated/**, !src/integrations/generated/**
📒 Files selected for processing (13)
  • src/integrations/compatibility.test.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/integrations/models/claude.ts
  • src/integrations/models/gemini.ts
  • src/integrations/models/glm.ts
  • src/integrations/models/kimi.ts
  • src/integrations/models/openai-compatible-alias.ts
  • src/integrations/models/qwen.ts
  • src/integrations/models/xai.ts
  • src/integrations/vendors/atlas-cloud.ts
  • src/services/api/client.test.ts
  • src/utils/effort.codex.test.ts
  • src/utils/providerProfiles.ts
💤 Files with no reviewable changes (1)
  • src/integrations/vendors/atlas-cloud.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (15)
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript with strict mode and ESM imports

Files:

  • src/integrations/models/kimi.ts
  • src/integrations/models/gemini.ts
  • src/integrations/models/openai-compatible-alias.ts
  • src/integrations/models/claude.ts
  • src/integrations/compatibility.test.ts
  • src/integrations/models/xai.ts
  • src/utils/providerProfiles.ts
  • src/services/api/client.test.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/integrations/models/qwen.ts
  • src/integrations/models/glm.ts
  • src/utils/effort.codex.test.ts
{src/integrations/**/*.ts,src/services/**/*.ts}

📄 CodeRabbit inference engine (AGENTS.md)

Test the exact provider/model path you changed when possible for provider modifications

Files:

  • src/integrations/models/kimi.ts
  • src/integrations/models/gemini.ts
  • src/integrations/models/openai-compatible-alias.ts
  • src/integrations/models/claude.ts
  • src/integrations/compatibility.test.ts
  • src/integrations/models/xai.ts
  • src/services/api/client.test.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/integrations/models/qwen.ts
  • src/integrations/models/glm.ts
src/integrations/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Check existing provider implementations before adding a new pattern

Files:

  • src/integrations/models/kimi.ts
  • src/integrations/models/gemini.ts
  • src/integrations/models/openai-compatible-alias.ts
  • src/integrations/models/claude.ts
  • src/integrations/compatibility.test.ts
  • src/integrations/models/xai.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/integrations/models/qwen.ts
  • src/integrations/models/glm.ts
**/*.{ts,tsx,js,jsx,py,json,md}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Follow the existing code style in the touched files

Files:

  • src/integrations/models/kimi.ts
  • src/integrations/models/gemini.ts
  • src/integrations/models/openai-compatible-alias.ts
  • src/integrations/models/claude.ts
  • src/integrations/compatibility.test.ts
  • src/integrations/models/xai.ts
  • src/utils/providerProfiles.ts
  • src/services/api/client.test.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/integrations/models/qwen.ts
  • src/integrations/models/glm.ts
  • src/utils/effort.codex.test.ts
**/*.{ts,tsx,js,jsx,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Keep comments useful and concise

Files:

  • src/integrations/models/kimi.ts
  • src/integrations/models/gemini.ts
  • src/integrations/models/openai-compatible-alias.ts
  • src/integrations/models/claude.ts
  • src/integrations/compatibility.test.ts
  • src/integrations/models/xai.ts
  • src/utils/providerProfiles.ts
  • src/services/api/client.test.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/integrations/models/qwen.ts
  • src/integrations/models/glm.ts
  • src/utils/effort.codex.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Follow TypeScript strict mode and type safety practices by running typecheck before submitting

Files:

  • src/integrations/models/kimi.ts
  • src/integrations/models/gemini.ts
  • src/integrations/models/openai-compatible-alias.ts
  • src/integrations/models/claude.ts
  • src/integrations/compatibility.test.ts
  • src/integrations/models/xai.ts
  • src/utils/providerProfiles.ts
  • src/services/api/client.test.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/integrations/models/qwen.ts
  • src/integrations/models/glm.ts
  • src/utils/effort.codex.test.ts
**

⚙️ CodeRabbit configuration file

**: # AGENTS.md - AI Agent Coding Guide

This guide is for AI coding agents working in the OpenClaude repository. Read it before changing code, and also follow CONTRIBUTING.md for contributor policy, PR expectations, review follow-up, and project scope.

Project Snapshot

OpenClaude is a coding-agent CLI for cloud and local model providers. It supports OpenAI-compatible APIs, Anthropic, Gemini, DeepSeek, Ollama, MCP, local backends, slash commands, tools, agents, and a React/Ink terminal UI.

The installed CLI runs on Node.js >=22.0.0. Bun is used for source builds, scripts, dependency management, and tests.

Work Style

  • Keep changes focused on one problem.
  • Prefer existing patterns in the file or nearby module.
  • Avoid unrelated formatting, renames, dependency changes, or broad rewrites.
  • Add or update tests when behavior changes.
  • Update docs when setup, commands, provider behavior, or user-facing behavior changes.
  • For new features, larger refactors, dependencies, or runtime changes, follow the issue-first guidance in CONTRIBUTING.md.

Stack And Conventions

  • TypeScript with strict mode and ESM imports.
  • React + Ink for terminal UI.
  • Bun lockfile and Bun scripts for development workflows.
  • Node runtime for the built CLI.
  • Python exists for legacy/local-provider helper code. Do not add new Python code or expand Python-based features unless a maintainer explicitly approves that direction.

Common libraries and patterns:

  • chalk for terminal color.
  • commander for CLI argument parsing.
  • execa for child processes.
  • Existing service, provider, settings, permission, and UI patterns over new abstractions.

Repository Map

  • src/commands/ - slash and CLI command implementations.
  • src/components/ - React/Ink UI components.
  • src/services/ - API, MCP, OAuth, wiki, voice, and other service integrations.
  • src/tools/ - tool implementations.
  • src/utils/ - shared utilities.
  • `src/integration...

Files:

  • src/integrations/models/kimi.ts
  • src/integrations/models/gemini.ts
  • src/integrations/models/openai-compatible-alias.ts
  • src/integrations/models/claude.ts
  • src/integrations/compatibility.test.ts
  • src/integrations/models/xai.ts
  • src/utils/providerProfiles.ts
  • src/services/api/client.test.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/integrations/models/qwen.ts
  • src/integrations/models/glm.ts
  • src/utils/effort.codex.test.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/kimi.ts
  • src/integrations/models/gemini.ts
  • src/integrations/models/openai-compatible-alias.ts
  • src/integrations/models/claude.ts
  • src/integrations/compatibility.test.ts
  • src/integrations/models/xai.ts
  • src/utils/providerProfiles.ts
  • src/services/api/client.test.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/integrations/models/qwen.ts
  • src/integrations/models/glm.ts
  • src/utils/effort.codex.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/integrations/models/kimi.ts
  • src/integrations/models/gemini.ts
  • src/integrations/models/openai-compatible-alias.ts
  • src/integrations/models/claude.ts
  • src/integrations/compatibility.test.ts
  • src/integrations/models/xai.ts
  • src/utils/providerProfiles.ts
  • src/services/api/client.test.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/integrations/models/qwen.ts
  • src/integrations/models/glm.ts
**/*.test.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add or update tests when the change affects behavior

Files:

  • src/integrations/compatibility.test.ts
  • src/services/api/client.test.ts
  • src/utils/effort.codex.test.ts
**/*.test.{ts,tsx,js}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Test the exact provider/model path you changed when possible

Files:

  • src/integrations/compatibility.test.ts
  • src/services/api/client.test.ts
  • src/utils/effort.codex.test.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/integrations/compatibility.test.ts
  • src/services/api/client.test.ts
  • src/utils/effort.codex.test.ts
{src/services/**/*.ts,src/utils/**/*.ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use execa for child processes

Files:

  • src/utils/providerProfiles.ts
  • src/services/api/client.test.ts
  • src/utils/effort.codex.test.ts
src/**/*provider*.{ts,tsx,js}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Provider implementations must follow documented patterns in docs/integrations/

Files:

  • src/utils/providerProfiles.ts
{src/commands/**/*.ts,src/services/**/*.ts,src/entrypoints/**/*.ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use chalk for terminal color in CLI code

Files:

  • src/services/api/client.test.ts
🔇 Additional comments (14)
src/integrations/models/qwen.ts (1)

31-51: LGTM!

Also applies to: 53-75, 76-89

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

4-21: LGTM!

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

46-47: LGTM!

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

32-45: LGTM!

Also applies to: 56-56

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

33-33: LGTM!

src/integrations/models/openai-compatible-alias.ts (1)

39-45: LGTM!

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

13-26: LGTM!

src/integrations/gateways/atlas-cloud.ts (2)

54-57: LGTM!


38-91: 🗄️ Data Integrity & Integration

No issue: modelDescriptorId references are validated
validateIntegrationRegistry() already rejects any catalog entry whose modelDescriptorId does not resolve, so Atlas models won’t silently drop out of getModelsForGateway().

			> Likely an incorrect or invalid review comment.
src/utils/providerProfiles.ts (1)

1263-1274: LGTM!

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

80-93: LGTM!

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

1561-1580: LGTM!


1531-1531: 🩺 Stability & Availability

No change needed for fetch isolation. globalThis.fetch is restored in afterEach, so these stubs stay isolated across tests.

			> Likely an incorrect or invalid review comment.
src/utils/effort.codex.test.ts (1)

417-481: LGTM!

Comment thread src/integrations/compatibility.test.ts
Update the Atlas Cloud gateway catalog with route-specific reasoning controls verified through live Atlas probes.

Enable top-level reasoning_effort metadata for models that accepted low/medium/high/xhigh, limit Doubao routes to low/medium/high, keep Grok Build as always-on no-wire reasoning, and leave OWL without effort controls after probes showed no reasoning output.

Expand effort resolver coverage and OpenAI shim serialization tests so Atlas metadata exposes the expected effort levels and strips reasoning_effort for no-wire models.

Validation: bun install; bun run build; bun run smoke; bun run check; bun run test:provider; bun run test:provider-recommendation; python -m pytest -q python/tests; bun run typecheck; bun run typecheck:type-tests; bun run doctor:runtime; bun run security:pr-scan -- --base HEAD --head 1878a1f05f7fcce7ab7098c890ff3091dafcaf66.
@jatmn jatmn changed the title fix(atlas-cloud) vendor to gateway catalog fix(atlas-cloud): vendor to gateway catalog correction and added reasoning support Jun 25, 2026
Introduce opt-in catalog aliases for model entries and resolve those aliases through the active route catalog before sending OpenAI-compatible requests.

Add Atlas aliases where descriptor IDs differ from Atlas API model IDs, including GLM, Claude coding variants, GPT, Kimi, MiniMax, Qwen, and Grok entries.

Teach effort metadata lookup to use the same explicit aliases so /effort support matches routed model IDs.

Cover Atlas alias routing plus OpenRouter and Hicap no-op routing in providerConfig tests, and add Atlas GLM alias effort coverage.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/services/api/providerConfig.test.ts`:
- Around line 27-74: Add a negative assertion to providerConfig.test around
resolveProviderRequest to cover alias-collision regressions: alongside the
existing Atlas alias checks for claude-sonnet-4-6 and claude-sonnet-4-6-coding,
verify that an Atlas API model id with no explicit alias (for example a full
provider model name) is returned unchanged. This should exercise the fallback
path in resolveProviderRequest and ensure the alias resolution logic does not
over-match or depend on find() ordering.
🪄 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: 9577bbb3-3609-42ee-87b0-1344b8f5638e

📥 Commits

Reviewing files that changed from the base of the PR and between d5b1762 and 7db0fd3.

📒 Files selected for processing (7)
  • src/integrations/descriptors.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/services/api/client.test.ts
  • src/services/api/providerConfig.test.ts
  • src/services/api/providerConfig.ts
  • src/utils/effort.codex.test.ts
  • src/utils/effort.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: typecheck
🧰 Additional context used
📓 Path-based instructions (15)
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript with strict mode and ESM imports

Files:

  • src/services/api/providerConfig.test.ts
  • src/utils/effort.ts
  • src/integrations/descriptors.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/services/api/client.test.ts
  • src/utils/effort.codex.test.ts
  • src/services/api/providerConfig.ts
{src/commands/**/*.ts,src/services/**/*.ts,src/entrypoints/**/*.ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use chalk for terminal color in CLI code

Files:

  • src/services/api/providerConfig.test.ts
  • src/services/api/client.test.ts
  • src/services/api/providerConfig.ts
{src/services/**/*.ts,src/utils/**/*.ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use execa for child processes

Files:

  • src/services/api/providerConfig.test.ts
  • src/utils/effort.ts
  • src/services/api/client.test.ts
  • src/utils/effort.codex.test.ts
  • src/services/api/providerConfig.ts
{src/integrations/**/*.ts,src/services/**/*.ts}

📄 CodeRabbit inference engine (AGENTS.md)

Test the exact provider/model path you changed when possible for provider modifications

Files:

  • src/services/api/providerConfig.test.ts
  • src/integrations/descriptors.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/services/api/client.test.ts
  • src/services/api/providerConfig.ts
**/*.{ts,tsx,js,jsx,py,json,md}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Follow the existing code style in the touched files

Files:

  • src/services/api/providerConfig.test.ts
  • src/utils/effort.ts
  • src/integrations/descriptors.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/services/api/client.test.ts
  • src/utils/effort.codex.test.ts
  • src/services/api/providerConfig.ts
**/*.test.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Add or update tests when the change affects behavior

Files:

  • src/services/api/providerConfig.test.ts
  • src/services/api/client.test.ts
  • src/utils/effort.codex.test.ts
src/**/*provider*.{ts,tsx,js}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Provider implementations must follow documented patterns in docs/integrations/

Files:

  • src/services/api/providerConfig.test.ts
  • src/services/api/providerConfig.ts
**/*.test.{ts,tsx,js}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Test the exact provider/model path you changed when possible

Files:

  • src/services/api/providerConfig.test.ts
  • src/services/api/client.test.ts
  • src/utils/effort.codex.test.ts
**/*.{ts,tsx,js,jsx,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Keep comments useful and concise

Files:

  • src/services/api/providerConfig.test.ts
  • src/utils/effort.ts
  • src/integrations/descriptors.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/services/api/client.test.ts
  • src/utils/effort.codex.test.ts
  • src/services/api/providerConfig.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Follow TypeScript strict mode and type safety practices by running typecheck before submitting

Files:

  • src/services/api/providerConfig.test.ts
  • src/utils/effort.ts
  • src/integrations/descriptors.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/services/api/client.test.ts
  • src/utils/effort.codex.test.ts
  • src/services/api/providerConfig.ts
**

⚙️ CodeRabbit configuration file

**: # AGENTS.md - AI Agent Coding Guide

This guide is for AI coding agents working in the OpenClaude repository. Read it before changing code, and also follow CONTRIBUTING.md for contributor policy, PR expectations, review follow-up, and project scope.

Project Snapshot

OpenClaude is a coding-agent CLI for cloud and local model providers. It supports OpenAI-compatible APIs, Anthropic, Gemini, DeepSeek, Ollama, MCP, local backends, slash commands, tools, agents, and a React/Ink terminal UI.

The installed CLI runs on Node.js >=22.0.0. Bun is used for source builds, scripts, dependency management, and tests.

Work Style

  • Keep changes focused on one problem.
  • Prefer existing patterns in the file or nearby module.
  • Avoid unrelated formatting, renames, dependency changes, or broad rewrites.
  • Add or update tests when behavior changes.
  • Update docs when setup, commands, provider behavior, or user-facing behavior changes.
  • For new features, larger refactors, dependencies, or runtime changes, follow the issue-first guidance in CONTRIBUTING.md.

Stack And Conventions

  • TypeScript with strict mode and ESM imports.
  • React + Ink for terminal UI.
  • Bun lockfile and Bun scripts for development workflows.
  • Node runtime for the built CLI.
  • Python exists for legacy/local-provider helper code. Do not add new Python code or expand Python-based features unless a maintainer explicitly approves that direction.

Common libraries and patterns:

  • chalk for terminal color.
  • commander for CLI argument parsing.
  • execa for child processes.
  • Existing service, provider, settings, permission, and UI patterns over new abstractions.

Repository Map

  • src/commands/ - slash and CLI command implementations.
  • src/components/ - React/Ink UI components.
  • src/services/ - API, MCP, OAuth, wiki, voice, and other service integrations.
  • src/tools/ - tool implementations.
  • src/utils/ - shared utilities.
  • `src/integration...

Files:

  • src/services/api/providerConfig.test.ts
  • src/utils/effort.ts
  • src/integrations/descriptors.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/services/api/client.test.ts
  • src/utils/effort.codex.test.ts
  • src/services/api/providerConfig.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/services/api/providerConfig.test.ts
  • src/utils/effort.ts
  • src/integrations/descriptors.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/services/api/client.test.ts
  • src/utils/effort.codex.test.ts
  • src/services/api/providerConfig.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/providerConfig.test.ts
  • src/integrations/descriptors.ts
  • src/integrations/gateways/atlas-cloud.ts
  • src/services/api/client.test.ts
  • src/services/api/providerConfig.ts
{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}

⚙️ CodeRabbit configuration file

{src/**/*.test.ts,src/**/*.test.tsx,tests/**,scripts/**/*.test.ts,vscode-extension/**/*.test.js}: Review tests for meaningful coverage of the changed behavior, isolation of global/env/config state, async cleanup, fake timers, provider profile leaks, and Windows-compatible assumptions. Block when risky runtime changes lack focused regression coverage or tests assert implementation details while missing the user-visible behavior.

Files:

  • src/services/api/providerConfig.test.ts
  • src/services/api/client.test.ts
  • src/utils/effort.codex.test.ts
src/integrations/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Check existing provider implementations before adding a new pattern

Files:

  • src/integrations/descriptors.ts
  • src/integrations/gateways/atlas-cloud.ts
🔇 Additional comments (9)
src/integrations/gateways/atlas-cloud.ts (3)

1-34: LGTM!


92-94: LGTM!


39-91: 🎯 Functional Correctness

No missing descriptors here. The Atlas catalog IDs all map to shared model descriptors, so resolveCatalogReasoningMetadata still has a valid fallback path.

			> Likely an incorrect or invalid review comment.
src/integrations/descriptors.ts (1)

103-117: LGTM!

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

253-280: LGTM!


912-916: LGTM!

src/utils/effort.ts (1)

318-324: LGTM!

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

1528-1634: LGTM!

src/utils/effort.codex.test.ts (1)

451-544: LGTM!

Comment thread src/services/api/providerConfig.test.ts
Assert the Atlas gateway catalog resolves at least one shared model before checking for NearAI descriptor leakage.

Add an Atlas full API-name fallback assertion so catalog alias routing cannot over-match provider-qualified model IDs.
@jatmn
jatmn marked this pull request as ready for review June 25, 2026 14:37
@jatmn

jatmn commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

@kevincodex1 LGTM

@kevincodex1 kevincodex1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@kevincodex1
kevincodex1 merged commit 40faf25 into Twigpine:main Jun 25, 2026
4 checks passed
@jatmn
jatmn deleted the atlas-effort branch June 25, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants