Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions apps/desktop/src/renderer/settings/provider-display-copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,16 @@ export const PROVIDER_DISPLAY_COPY = {
'zh-TW': { name: 'Cloudflare Workers AI', description: 'Cloudflare 託管模型,使用帳號層級連線', badge: 'API' },
en: { name: 'Cloudflare Workers AI', description: 'Cloudflare-hosted models over the account-scoped API.', badge: 'API' },
},
'azure-foundry': {
'zh-CN': { name: 'Azure AI Foundry', description: '使用 Foundry 终结点和 API 密钥连接已部署的 OpenAI 兼容模型。', badge: 'API' },
'zh-TW': { name: 'Azure AI Foundry', description: '使用 Foundry 端點與 API 金鑰連線已部署的 OpenAI 相容模型。', badge: 'API' },
en: { name: 'Azure AI Foundry', description: 'Connect a deployed OpenAI-compatible model with its Foundry endpoint and API key.', badge: 'API' },
},
'amazon-bedrock': {
'zh-CN': { name: 'Amazon Bedrock', description: '通过 Bedrock 的 OpenAI 兼容 API、区域终结点和 Bedrock API 密钥连接模型。', badge: 'API' },
'zh-TW': { name: 'Amazon Bedrock', description: '透過 Bedrock 的 OpenAI 相容 API、區域端點與 Bedrock API 金鑰連線模型。', badge: 'API' },
en: { name: 'Amazon Bedrock', description: 'Connect through Bedrock’s OpenAI-compatible API, regional endpoint, and Bedrock API key.', badge: 'API' },
},
huggingface: {
'zh-CN': { name: 'Hugging Face', description: 'Inference Providers 路由,聚合多家托管模型', badge: '路由' },
'zh-TW': { name: 'Hugging Face', description: 'Inference Providers 路由,聚合多家託管模型', badge: '路由' },
Expand Down
13 changes: 13 additions & 0 deletions packages/core/src/__tests__/provider-catalog-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,19 @@ describe('Moonshot provider regions', () => {
});

describe('provider catalog contract — structural invariants over CATALOG_PROVIDER_TYPES', () => {
it('marks tenant- or region-scoped API providers as user-endpoint connections', () => {
for (const type of ['azure-foundry', 'amazon-bedrock'] as const) {
const definition = PROVIDER_REGISTRY[type];
assert.equal(definition.authKind, 'api_key');
assert.equal(definition.baseUrl, '');
assert.ok(
definition.runtimeAdapter.kind === 'openai-compatible' &&
definition.runtimeAdapter.requireBaseUrl,
);
assert.equal(definition.category, 'custom');
}
});

it('exposes an endpoint source that passes the production baseUrl gate', () => {
for (const type of CATALOG_PROVIDER_TYPES) {
const def = PROVIDER_REGISTRY[type];
Expand Down
30 changes: 30 additions & 0 deletions packages/core/src/provider-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,36 @@ const providerRegistry = {
signupUrl: 'https://dash.cloudflare.com/profile/api-tokens',
catalogOrder: 33,
},
'azure-foundry': {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P2] Advance the compatibility epoch when adding these wire-visible provider values

An epoch-212 client built before these entries can still connect to this epoch-212 Host, but connection.catalog.query responses now contain providerType values absent from the old registry. The unchanged decodeCatalogConnectionHeader delegates to core decodeProviderType and rejects the entire page with invalid_frame ("connection provider type is not registered"). The actual base decoder accepts a Custom control page but rejects both new provider pages, while the head decoder accepts all three. This is a wire compatibility change even without edits under src/protocol. Allocate a new epoch and cover the mixed-version case. Current main is 212; #5394/#5969 use 213 and #5548/#6051 use 214. 215 is currently free across the 188 open heads checked, but recheck before merging.

label: 'Azure AI Foundry',
baseUrl: '',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: baseUrl: '' with no baseUrlTemplate and a non-custom category fails the catalog contract test (azure-foundry has no baseUrl, no baseUrlTemplate, and is not a custom connection). Because of the same rule, packages/cli/src/onboarding-catalog.ts also drops this provider from CLI onboarding. The same applies to amazon-bedrock below.

authKind: 'api_key',
fallbackModels: [],
status: 'ready',
runtimeAdapter: { kind: 'openai-compatible', requireBaseUrl: true },
modelDiscovery: { kind: 'protocol' },
// Foundry endpoints are resource-specific and must be supplied by the user.
category: 'custom',
catalogGroup: 'api',
signupUrl: 'https://ai.azure.com/',
catalogOrder: 42,
},
'amazon-bedrock': {
label: 'Amazon Bedrock',
baseUrl: '',
authKind: 'api_key',
fallbackModels: [],
status: 'ready',
runtimeAdapter: { kind: 'openai-compatible', requireBaseUrl: true },
// Bedrock's OpenAI-compatible endpoint and model-list availability vary
// by endpoint family and region. A custom endpoint remains user supplied.
modelDiscovery: { kind: 'protocol' },
// Bedrock endpoint selection is region/account-specific and user supplied.
category: 'custom',
catalogGroup: 'api',
signupUrl: 'https://console.aws.amazon.com/bedrock/',
catalogOrder: 43,
},
'ollama-cloud': {
label: ollamaCloud.name,
baseUrl: ollamaCloud.api,
Expand Down