fix(key-vault): add Atlas Cloud Claude Code compatibility - #648
Open
Neonforge98 wants to merge 1 commit into
Open
fix(key-vault): add Atlas Cloud Claude Code compatibility#648Neonforge98 wants to merge 1 commit into
Neonforge98 wants to merge 1 commit into
Conversation
Pre-commit hook ran. Total eslint: 0, total circular: 0
Collaborator
Author
Real-key end-to-end verification (user-supplied Atlas key)
Total spend: three ~16-token completions. 🤖 Generated with Claude Code |
Collaborator
Author
Wizard protocol-picker verification (live, this branch's build)The KeyVault wizard's protocol row is data-driven from the Rust provider registry, so this PR's dual-protocol declaration surfaces automatically: the Atlas Cloud form now shows API protocol: OpenAI / Anthropic (absent on the merged #503 build), and selecting Anthropic flips the official base URL to the bare host 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PR #503 registered Atlas Cloud as compatible with Codex and OpenCode and generated their provider profiles, but the third CLI in Atlas Cloud's official Coding Plan docs — Claude Code — was never wired. Atlas's primary coding-plan audience uses Claude Code, so an Atlas key currently cannot drive it at all: the provider is absent from
claude_code.compatible_api_providers, and no Anthropic-protocol endpoint is declared anywhere.Official reference: https://www.atlascloud.ai/docs/en/coding-plan/api (Claude Code section:
ANTHROPIC_BASE_URL=https://api.atlascloud.ai— bare host, no/v1).Solution
Follow the existing dual-protocol provider pattern (ZenMux/LongCat):
cli_agents.rs: addatlascloud_apito Claude Code'scompatible_api_providers.provider_config.rs: declare Atlas as dual-protocol (openai+anthropic) with anATLASCLOUD_ENDPOINTSspec carryinganthropic_base_url = https://api.atlascloud.ai.default_base_urlstill resolves to…/v1via the endpoint, so the OpenAI validation path is unchanged, and protocol-anthropickey validation now resolves its endpoint too.agent_env_builder.rs: Claude Code cross-type sessions with an Atlas key exportANTHROPIC_BASE_URL=https://api.atlascloud.ai. The Atlas arm deliberately takes precedence over the storedentry.base_url: Atlas keys persist the OpenAI-protocol/v1URL, which must never be forwarded to Claude Code (it would produce/v1/v1/messages). The existingANTHROPIC_MODEL/beta-disable cross-type overrides then apply as-is.agent-coreprovider registry:default_anthropic_api_base = https://api.atlascloud.aion the AtlasProviderSpec, mirroring ZenMux.Auth header stays
ANTHROPIC_API_KEY(x-api-key), consistent with every other cross-type provider. Verified empirically that Atlas's Anthropic surface evaluates bothx-api-keyandAuthorization: Bearer(present-but-wrong key returnsunauthorized, absent auth returnsinvalid token), andPOST https://api.atlascloud.ai/v1/messagesexists (401 on bad key, not 404).Verification
cargo test -p key_vault— 345 passed (includes newtest_cross_type_env_atlascloud_as_claude_code_uses_anthropic_endpointpinning key/base-URL/model/beta-flag exports and the stored-/v1-URL precedence trap, plus updatedtest_get_provider_config_atlascloudand the registry compatibility assertions for all three CLIs).cargo test -p agent_core providers— 442 passed.cargo fmtscoped (repo-wide pre-existing drift left untouched).api.atlascloud.aidocumented above; no paid request issued (auth-rejection responses only).Risks
resolve_session_modelalready suppresses--modelfor Claude Code cross-type sessions, and the env builder injects the curated model — both existing mechanisms, no change needed. The env export for same-type Atlas sessions is untouched (ATLASCLOUD_API_KEY/ATLASCLOUD_BASE_URLcanonical test still green). Rollback is a revert of this commit.🤖 Generated with Claude Code