feat: add Atlas Cloud Chat Completions support - #1131
Conversation
Signed-off-by: binyangzhu000-sudo <224954946+binyangzhu000-sudo@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (3)
Included review availability: Your plan includes up to 4 reviews per rolling hour; 3 remain after this review. 📝 WalkthroughWalkthroughAtlas Cloud is added as a ChatCompletion provider. The change adds URL validation, provider detection, API-key resolution, configuration errors, documentation, a single-agent configuration, and regression tests. ChangesAtlas Cloud provider support
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This change adds Atlas Cloud support and related documentation and examples without any supplied actionable merge-blocking risk; it is merge-ready after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant BackendConfig
participant create_backend
participant is_atlascloud_url
participant Environment
participant ConfigurationError
BackendConfig->>create_backend: pass Atlas Cloud base URL
create_backend->>is_atlascloud_url: validate base URL
is_atlascloud_url-->>create_backend: return provider match
create_backend->>Environment: read ATLASCLOUD_API_KEY
Environment-->>create_backend: return API key
Environment-->>ConfigurationError: key unavailable
🚥 Pre-merge checks | ✅ 6 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (6 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@massgen/cli/backends.py`:
- Around line 242-250: Replace substring-based Atlas Cloud detection with one
shared URL-host predicate that safely parses the hostname and accepts only the
approved exact host and valid subdomains, excluding userinfo and query-string
tricks. Use this predicate in massgen/cli/backends.py lines 242-250 to decide
whether to load ATLASCLOUD_API_KEY, and in massgen/backend/chat_completions.py
lines 1149-1150 within ChatCompletionsBackend.get_provider_name(); add tests
covering exact-host, subdomain-boundary, userinfo, and query-string cases.
In `@massgen/configs/basic/single/single_atlascloud.yaml`:
- Around line 1-8: The configuration example needs a “What happens” comment
describing the Atlas Cloud request, the textual terminal output, and the
required ATLASCLOUD_API_KEY. Add this comment near the existing invocation
comment in the YAML file, while preserving the current configuration.
🪄 Autofix
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: fc314023-eb92-47b6-9bc1-8fa3330b5ccd
📒 Files selected for processing (7)
.env.exampledocs/source/reference/supported_models.rstmassgen/backend/chat_completions.pymassgen/cli/backends.pymassgen/configs/BACKEND_CONFIGURATION.mdmassgen/configs/basic/single/single_atlascloud.yamlmassgen/tests/test_chat_completions_refactor.py
Signed-off-by: binyangzhu000-sudo <142146267+binyangzhu000-sudo@users.noreply.github.com>
Description
Adds Atlas Cloud support to the generic Chat Completions backend by:
ATLASCLOUD_API_KEYforhttps://api.atlascloud.ai/v1Type of change
feat:) - Non-breaking change which adds functionalityChecklist
Pre-commit status
All applicable hooks pass. The configured
pyupgradehook crashes under Python 3.14 before inspecting files due to an upstream compatibility error; the same configuredpyupgrade --py311-pluscheck passes under Python 3.13.How to Test
A live request through the MassGen-created backend to
qwen/qwen3.8-maxat the Atlas Cloud endpoint also completed successfully.Summary by CodeRabbit
New Features
ATLASCLOUD_API_KEY.Bug Fixes
Tests