Skip to content

feat(ai): add Command Code provider#3357

Open
oldschoola wants to merge 1 commit into
can1357:mainfrom
oldschoola:fix/command-code-provider-fresh
Open

feat(ai): add Command Code provider#3357
oldschoola wants to merge 1 commit into
can1357:mainfrom
oldschoola:fix/command-code-provider-fresh

Conversation

@oldschoola

Copy link
Copy Markdown
Contributor

Summary

Re-cut of PR #3298 from current main. The original branch had a 3,831-file diff from an old fork point; this cherry-pick contains only the 8 provider-specific files.

Changes

  • Provider registration: packages/ai/src/registry/commandcode.ts — Command Code as an OpenAI-compatible provider
  • Catalog descriptor: packages/catalog/src/provider-models/descriptors.ts — provider entry in CATALOG_PROVIDERS
  • OpenAI-compat resolution: packages/catalog/src/provider-models/openai-compat.ts — model resolution rules for Command Code
  • API key login test: packages/ai/test/auth-storage-api-key-login.test.ts — credential storage for Command Code

Verification

  • bun check — passed
  • No dynamic import() calls (addressing review feedback on original PR)
  • No version downgrade (fresh branch from current main)
  • No CI rewrite or unrelated file changes

Replaces

Closes #3298 (original PR with 3,831-file diff from old fork point)

Re-cut from current main — the original PR can1357#3298 had a 3,831-file diff
from an old fork point. This cherry-pick contains only the 8 provider-
specific files.

Adds Command Code as an OpenAI-compatible provider with:
- Provider registration in packages/ai/src/registry/
- Catalog descriptor and openai-compat resolution
- API key login test coverage
@github-actions github-actions Bot added the vouched Passed the vouch gate label Jun 23, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2183e21d1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

...(apiKey && {
fetchDynamicModels: () =>
fetchOpenAICompatibleModels({
api: "openai-completions",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Route Command Code Anthropic models to messages

When Command Code's /models response includes Claude/Anthropic models, this maps every discovered model to the OpenAI chat-completions transport, so selecting one of those models will call /provider/v1/chat/completions. Command Code's provider docs say Anthropic models use /provider/v1/messages and that sending a Claude model to chat completions returns a 400, so those advertised models will be listed but unusable unless they are filtered or mapped to the Anthropic transport. Source checked: https://commandcode.ai/docs/provider-api

Useful? React with 👍 / 👎.

{
id: "commandcode",
defaultModel: "deepseek/deepseek-v4-pro",
envVars: ["COMMANDCODE_API_KEY"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Recognize Command Code's documented env var

Command Code documents COMMAND_CODE_API_KEY for non-interactive/API-key usage, but the catalog only registers COMMANDCODE_API_KEY, which means users following the provider's docs will not be authenticated through getEnvApiKey/runtime discovery and the provider will appear unavailable until they paste-login or use the nonstandard name. Please support the documented variable, ideally while preserving this alias if desired. Source checked: https://commandcode.ai/docs/studio/api-keys

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouched Passed the vouch gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant