Skip to content

Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.

Merge pull request #264 from mrhy7176/cursor/cloudgpu-provider-preset-558a

Salman Qureshi0742db02e751
diff --cc src/cloud/pairing-flow.ts
index da2e5c3a,0158f2c8..27dd511b
--- a/src/cloud/pairing-flow.ts
+++ b/src/cloud/pairing-flow.ts
@@@ -412,16 -412,11 +412,16 @@@ function startManagedRuntime(): void
function isProviderConfiguredSafe(p: import('../utils/config.js').ProviderConfig): boolean {
if (!p.enabled) return false;
- if (p.name === 'ollamaLocal') return p.baseUrl.length > 0 && p.model.length > 0;
+ if (p.name === 'ollamaLocal' || p.name === 'atomicChat') return p.baseUrl.length > 0 && p.model.length > 0;
if (p.name === 'ollamaCloud') return p.apiKey.length > 0 && p.baseUrl.length > 0;
- if (p.name === 'atlascloud' || p.name === 'runcrate') return p.apiKey.length > 0 && p.baseUrl.length > 0 && p.model.length > 0;
+ if (p.name === 'atlascloud' || p.name === 'runcrate' || p.name === 'cloudgpu') return p.apiKey.length > 0 && p.baseUrl.length > 0 && p.model.length > 0;
- if (p.name === 'openaiCompat') return p.baseUrl.length > 0 && p.model.length > 0;
- if (p.name === 'chatgptWeb' || p.name === 'githubCopilot') return p.model.length > 0;
+ // Keep this in sync with isProviderConfigured(): a local/keyless provider that
+ // is configured without an API key must not be treated as "not configured"
+ // here, or disconnecting Cloud reports that no offline provider exists.
+ if (p.name === 'openaiCompat' || p.name === 'litellm' || p.name === 'lmStudio')
+ return p.baseUrl.length > 0 && p.model.length > 0;
+ if (p.name === 'chatgptWeb' || p.name === 'githubCopilot' || p.name === 'mercuryCloud')
+ return p.model.length > 0;
return p.apiKey.length > 0;
}
diff --cc src/utils/provider-models.test.ts
index fc3aa121,2d55683e..1aab8218
--- a/src/utils/provider-models.test.ts
+++ b/src/utils/provider-models.test.ts
@@@ -277,25 -234,36 +291,53 @@@ describe('fetchProviderModelCatalog', (
expect(catalog.recommendedModel).toBe('deepseek-ai/DeepSeek-V4.1-Flash');
expect(catalog.models).toEqual(['zai-org/GLM-5.3-Flash']);
});
+
+ it('keeps CloudGPU chat models and sends the key as a bearer token', async () => {
+ const fetchMock = vi.fn().mockResolvedValue(new Response(JSON.stringify({
+ data: [
+ { id: 'deepseek-v4.1-flash' },
+ { id: 'glm-5.2' },
+ { id: 'flux-1-schnell' },
+ { id: 'kokoro-tts' },
+ { id: 'whisper-v3' },
+ { id: 'qwen3-asr' },
+ ],
+ }), { status: 200 }));
+ vi.stubGlobal('fetch', fetchMock);
+
+ const catalog = await fetchProviderModelCatalog('cloudgpu', {
+ name: 'cloudgpu',
+ apiKey: 'cgw-sk-test',
+ baseUrl: 'https://cloudgpu.app/v1/',
+ model: 'deepseek-v4.1-flash',
+ enabled: true,
+ });
+
+ const [url, init] = fetchMock.mock.calls[0];
+ expect(url).toBe('https://cloudgpu.app/v1/models');
+ expect(init.headers).toMatchObject({ Authorization: 'Bearer cgw-sk-test' });
+ expect(catalog.recommendedModel).toBe('deepseek-v4.1-flash');
+ expect(catalog.models).toEqual(['glm-5.2']);
+ });
});
+describe('model lists behind Basic auth', () => {
+ const expected = `Basic ${Buffer.from('alice:s3cret').toString('base64')}`;
+ const cfg = (name: 'ollamaLocal' | 'openaiCompat' | 'lmStudio' | 'litellm' | 'atomicChat') => ({
+ name, apiKey: '', baseUrl: 'https://ollama.example.test/v1', model: 'm', enabled: true,
+ username: 'alice', password: 's3cret',
+ });
+
+ it.each([['ollamaLocal'], ['openaiCompat'], ['lmStudio'], ['litellm'], ['atomicChat']] as const)('%s sends the Basic header when listing models', async (name) => {
+ const fetchMock = vi.fn().mockResolvedValue(new Response(JSON.stringify({ models: [{ name: 'm' }], data: [{ id: 'm' }] }), { status: 200 }));
+ vi.stubGlobal('fetch', fetchMock);
+
+ await fetchProviderModelCatalog(name, cfg(name));
+
+ expect(fetchMock.mock.calls[0][1].headers).toMatchObject({ Authorization: expected });
+ });
+});
+
describe('chat models only', () => {
it('drops rerankers, embedders and speech models from model lists', async () => {
const { isChatModelId, buildModelCatalog } = await import('./provider-models.js');