feat: add Atlas Cloud memory provider preset - #233
Conversation
Signed-off-by: binyangzhu000-sudo <224954946+binyangzhu000-sudo@users.noreply.github.com>
lindixu6-hash
left a comment
There was a problem hiding this comment.
The branch passes its focused suite (35 pass), the full suite available at this commit (347 pass, 0 fail), typecheck, Prettier, and the production build. The Atlas endpoint and current deepseek-ai/deepseek-v4-pro model are also publicly documented. However, the preset is unsafe under the repository’s project-scoped configuration merge.
initConfig() shallow-merges global and project config before buildConfig() applies Atlas defaults. If a user has a global OpenAI manual config (model, URL, and key) and a project config contains only the documented memoryProvider: "atlas-cloud", the merged object still contains all three OpenAI fields. The result is memoryProvider === "atlas-cloud" while requests continue to use the global OpenAI model/endpoint/key and sessions are mislabeled as Atlas. A partial project override can also pair a new endpoint with an inherited credential from the previous provider.
I reproduced this at 911810c with a temporary initConfig() regression: expected the Atlas model, URL, and ATLASCLOUD_API_KEY, but received gpt-global at the first assertion. Clearing provider-specific inherited fields when the project changes memoryProvider made the same test pass. Both the temporary test and mutation were removed; the review worktree is clean.
Please make provider changes reset model/URL/key fields that were not explicitly supplied at the same scope, and add coverage for global OpenAI → project Atlas plus a partial endpoint override so credentials cannot cross provider boundaries.
There is also a product/governance decision to make before adding another first-class provider. Atlas documents its LLM API as OpenAI-compatible, and opencode-mem already supports custom OpenAI-compatible endpoints through openai-chat; this subclass adds only defaults and a session tag. Please either justify the user-facing behavior that requires a dedicated provider or prefer a neutral docs/config example. The contributor’s recent public activity includes multiple AtlasCloudAI/* repositories, so the relationship should be disclosed, and the docs should clearly state that captured prompts/responses are sent to the external Atlas endpoint. The current model/endpoint claims are verifiable; the missing pieces are provider-scoped credential safety and transparent product policy.
|
Following up on the requested changes. Are you still planning to address the review feedback? If not, I can close this PR to keep the queue clean; it can always be reopened later. |
|
Skipped: this PR conflicts with |
84 commits of drift. Conflicts were the usual two-sides-added-a-provider shape — this branch's "atlas-cloud" against upstream's new "orcarouter" — in the AIProviderType/MemoryProviderType unions, the provider factory (import, switch case, supported list) and the config surface. Both kept. Two things worth calling out: - src/config.ts: upstream inlined the memoryProvider literal union in two interfaces. Kept the MemoryProviderType alias instead and extended it with "orcarouter", so the union stays in one place. - openai-chat-completion.ts: taking upstream's inlined sessionProviderTag() call left a duplicate method definition alongside the auto-merged one (TS2393). Removed the copy this branch carried; upstream's, with its JSDoc, is the one that survives. The review's config-merge concern is addressed upstream rather than here: 36b7c89 "Prevent credential exfiltration through project config" makes memoryProvider/memoryApiUrl/memoryApiKey global-only and throws when a project config sets them, which closes the global-OpenAI → project-Atlas leak for every provider. The Atlas test was written against the old contract and now configures the preset globally; a new test pins the rejection so the hole cannot reopen. Signed-off-by: binyangzhu000-sudo <binyangzhu000@gmail.com>
|
Thanks for actually reproducing it — that made this unambiguous. Synced with On the config-merge hole. It's real, and it's now fixed — but upstream, not here. Your commit That's a strictly better fix than what you asked me for. You suggested resetting provider-specific fields when the scope changes I confirmed it rather than assuming: my existing Atlas test started failing after the merge with because it had been written against the old contract (project config setting the provider). It now configures the preset globally, and I added a test that pins the rejection — global OpenAI config + project Conflicts. The usual both-sides-added-a-provider shape: this branch's
Verification — Those 9 are all |
Summary
atlas-cloudmemory provider backed by the existing OpenAI-compatible Chat Completions implementationhttps://api.atlascloud.ai/v1,deepseek-ai/deepseek-v4-pro, andATLASCLOUD_API_KEYwhile preserving explicit overridesTesting
bun test tests/atlas-cloud-provider.test.ts tests/config-resolution.test.ts tests/ai-provider-config.test.ts tests/openai-chat-completion-provider.test.ts(35 passed)bun run typecheckbun run format:checkdeepseek-ai/deepseek-v4-pro