Repository navigation
feat(providers): add Atlas Cloud provider - #8783
binyangzhu000-sudo wants to merge 1 commit into
Conversation
|
@binyangzhu000-sudo is attempting to deploy a commit to the Sim Team on Vercel. A member of the Team first needs to authorize it. |
|
| contextInformationAvailable: false, | ||
| models: [], |
There was a problem hiding this comment.
atlascloud has no static models, but the PR never adds it to ProviderModelsLoader, the model-sync helpers, or DYNAMIC_MODEL_PROVIDERS. Opening a workflow therefore never fetches its catalog, even with a saved key. Model pickers stay empty, and access-control settings treat it as a static provider with no models. Add the full discovery and sync wiring used by baseten.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| if (!apiKey) { | ||
| logger.info('No Atlas Cloud API key available, returning empty models') | ||
| return NextResponse.json({ models: [] }) | ||
| } |
There was a problem hiding this comment.
The route returns an empty catalog whenever neither a saved key nor ATLASCLOUD_API_KEY exists. If /v1/models is public as the PR description states, this unnecessarily prevents users from browsing before adding a key. Fetch the public catalog without requiring a key; keep the key requirement for inference.
| expect(res.status).toBe(200) | ||
| expect(await res.json()).toEqual({ models: ['atlascloud/model-a'] }) | ||
|
|
||
| expect(mockGetBYOKKey).toHaveBeenCalledWith('ws-1', 'atlascloud') |
There was a problem hiding this comment.
Both new suites assert mock calls, including mockGetBYOKKey here and mockExecuteTool in the provider suite. The repository explicitly says never to write tests that assert mocks were called. These checks depend on internal calls rather than proving the integration works. Replace them with tests through the real boundary that prove which key or tool result was used. This repository requirement must be satisfied before merging.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| const permission = await getUserEntityPermissions(session.user.id, 'workspace', workspaceId) | ||
| if (permission) { | ||
| const byokResult = await getBYOKKey(workspaceId, 'atlascloud') |
There was a problem hiding this comment.
The handler decides workspace access and reads a protected key directly. The repository requires protected reads to enter through an authorized application use case and says route adapters must not decide resource authorization. Move the workspace check and key lookup into that shared use case, then call it from the route. This repository requirement must be satisfied before merging.
Context Used: CLAUDE.md (source)
| export const atlascloudProviderModelsQuerySchema = z.object({ | ||
| workspaceId: z.string().min(1).optional(), | ||
| }) |
There was a problem hiding this comment.
atlascloudProviderModelsQuerySchema has no exported named type alias. The repository requires contracts to export both named schemas and named type aliases. Add AtlascloudProviderModelsQuery alongside the schema so callers can import its type rather than define their own. This repository requirement must be satisfied before merging.
| export const atlascloudProviderModelsQuerySchema = z.object({ | |
| workspaceId: z.string().min(1).optional(), | |
| }) | |
| export const atlascloudProviderModelsQuerySchema = z.object({ | |
| workspaceId: z.string().min(1).optional(), | |
| }) | |
| export type AtlascloudProviderModelsQuery = z.input<typeof atlascloudProviderModelsQuerySchema> |
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| export function AtlasCloudIcon(props: SVGProps<SVGSVGElement>) { | ||
| return ( | ||
| <svg | ||
| {...props} | ||
| fill='currentColor' | ||
| fillRule='evenodd' | ||
| height='1em' | ||
| width='1em' | ||
| viewBox='0 0 24 24' | ||
| xmlns='http://www.w3.org/2000/svg' | ||
| > | ||
| <path d='M20.2,18.01L12,0.47,3.8,18.01l-2.58,5.52c1.62,-1.05,3.39,-1.86,5.26,-2.41,1.76,-0.51,3.61,-0.79,5.52,-0.79,0.98,0,1.95,0.08,2.9,0.22l-1.86,-4.3c-0.53,-0.1,-2.87,-0.1,-4.59,0.3l3.56,-8.28,5.52,12.85c0.01,0,0.02,0.01,0.03,0.01,1.86,0.55,3.62,1.36,5.23,2.4l-2.58,-5.52Z' /> | ||
| </svg> | ||
| ) | ||
| } |
There was a problem hiding this comment.
The docs export AtlasCloudIcon, but nothing in the docs app imports it. The repository forbids exports that nothing imports. Remove this unused copy or connect it to an actual docs consumer. This repository requirement must be satisfied before merging.
| export function AtlasCloudIcon(props: SVGProps<SVGSVGElement>) { | |
| return ( | |
| <svg | |
| {...props} | |
| fill='currentColor' | |
| fillRule='evenodd' | |
| height='1em' | |
| width='1em' | |
| viewBox='0 0 24 24' | |
| xmlns='http://www.w3.org/2000/svg' | |
| > | |
| <path d='M20.2,18.01L12,0.47,3.8,18.01l-2.58,5.52c1.62,-1.05,3.39,-1.86,5.26,-2.41,1.76,-0.51,3.61,-0.79,5.52,-0.79,0.98,0,1.95,0.08,2.9,0.22l-1.86,-4.3c-0.53,-0.1,-2.87,-0.1,-4.59,0.3l3.56,-8.28,5.52,12.85c0.01,0,0.02,0.01,0.03,0.01,1.86,0.55,3.62,1.36,5.23,2.4l-2.58,-5.52Z' /> | |
| </svg> | |
| ) | |
| } |
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| ) | ||
| } | ||
|
|
||
| export function AtlasCloudIcon(props: SVGProps<SVGSVGElement>) { |
There was a problem hiding this comment.
The new AtlasCloudIcon components use SVGProps directly instead of a props interface. The component guide requires every component to have a props interface. Define AtlasCloudIconProps extending SVGProps<SVGSVGElement> and use it for these declarations. This repository requirement must be satisfied before merging.
Context Used: Component patterns and structure for React components (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Add Atlas Cloud as an OpenAI-compatible provider with BYOK support, dynamic model listing, docs and tests. Rebased onto current main: wired into the new attachment-provider map and usage-consumer icon map, and accounts for the pending turn at the tool-loop cap like the other reseller providers. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: binyangzhu000-sudo <224954946+binyangzhu000-sudo@users.noreply.github.com>
96e5fa5 to
1c7f5a0
Compare
|
I rebased this PR onto the current Two additions were needed because of changes on main since the PR was opened:
I also set Checks I ran in
Not run: the full repo test suite and the browser UI for the BYOK settings page. |
What this adds
atlascloud— Atlas Cloud, an OpenAI-compatible gateway athttps://api.atlascloud.ai/v1serving DeepSeek, GLM, Kimi, Qwen and MiniMax behind one key.Disclosure: I work at Atlas Cloud.
GET /v1/modelsis public, so the catalog can be browsed without a key.Shaped like the Baseten reseller
isReseller: truewithmodels: [], so the catalog comes from/api/providers/atlascloud/modelsat runtime instead of a Sim release — the gateway adds models weekly and a hard-coded list would be stale on arrival. The provider is 74 lines on top ofopenai-compat/chat-completions; the only non-boilerplate choice isreasoningFields: ['reasoning_content'], which is where this gateway's reasoning models actually put their chain of thought.Testing
Provider + BYOK suites: 2022 → 2033 passing, no failures. The 11 new tests are the two suites that travel with the provider, both mirrored from Baseten's.
Live round trip through the repo's own
atlascloudProvider.executeRequest, not a mock:and the registry resolves it next to its precedent:
Every model id above was called against the live endpoint before being written down.
Registration points
The compiler found most of these for me —
ProviderId,ProviderNameandBYOKProviderIdare exhaustive unions, sotscnamed eachRecord<ProviderId, …>that needed an entry:providers/atlascloud/{index.ts,index.test.ts}andapp/api/providers/atlascloud/models/{route.ts,route.test.ts}(new) ·providers/registry.ts·providers/types.ts·providers/models.ts·providers/history-adapters.ts·providers/utils.ts·providers/openai-compat/chat-completions.ts·stores/providers/{types.ts,store.ts}·tools/types.ts·lib/api-key/byok.ts·lib/api/contracts/{providers.ts,byok-keys.ts}·lib/core/config/env.ts·hooks/queries/providers.ts· the BYOK settings panel ·app/(landing)/models/utils.ts·components/icons.tsx· and the docs (cost table, env-var table, agent block, docs icons).I found the non-type-checked ones by grepping every current occurrence of
baseten, not by copying the file list from the commit that added it.🤖 Generated with Claude Code