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.

fix(providers): register LM Studio in the provider registry

NefelibateLG8e16a9be1ddb
diff --git a/src/providers/registry.test.ts b/src/providers/registry.test.ts
index 61e1d559..15a596a4 100644
--- a/src/providers/registry.test.ts
+++ b/src/providers/registry.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, it } from 'vitest';
import type { BaseProvider } from './base.js';
import { ProviderRegistry } from './registry.js';
+import { getDefaultConfig } from '../utils/config.js';
function provider(name: string, model: string): BaseProvider {
return {
@@ -104,3 +105,25 @@ describe('usable providers (a bot always gets a provider that can answer)', () =
expect(r.getDefault().name).toBe('openai');
});
});
+
+/**
+ * `create` builds its candidate list by hand, so a provider wired everywhere
+ * else (config schema, isProviderConfigured, createProvider, doctor, web UI)
+ * can still be left out of it — which is exactly what happened to LM Studio:
+ * a config with LM Studio as the only provider registered nothing and the CLI
+ * exited with "No LLM providers available".
+ */
+describe('ProviderRegistry.create registration', () => {
+ it('registers LM Studio when it is the only configured provider', async () => {
+ const config = getDefaultConfig();
+ config.providers.default = 'lmStudio';
+ config.providers.lmStudio.baseUrl = 'http://127.0.0.1:1234/v1';
+ config.providers.lmStudio.model = 'qwen3-8b';
+ config.providers.lmStudio.enabled = true;
+
+ const registry = await ProviderRegistry.create(config);
+
+ expect(registry.hasProviders()).toBe(true);
+ expect(registry.get('lmStudio')?.name).toBe('lmStudio');
+ });
+});
diff --git a/src/providers/registry.ts b/src/providers/registry.ts
index 2bc13375..3f273d97 100644
--- a/src/providers/registry.ts
+++ b/src/providers/registry.ts
@@ -84,6 +84,7 @@ export class ProviderRegistry {
config.providers.chatgptWeb,
config.providers.githubCopilot,
config.providers.litellm,
+ config.providers.lmStudio,
];
// Load only configured providers in parallel