Skip to content

Commit 490ca1c

Browse files
committed
fix
1 parent 78759de commit 490ca1c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/CortexServiceProvider.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Cortex;
66

7+
use Throwable;
78
use Cortex\LLM\LLMManager;
89
use Cortex\Agents\Registry;
910
use Cortex\Console\AgentChat;
@@ -123,7 +124,13 @@ protected function registerModelInfoFactory(): void
123124
// ->needs(CacheInterface::class)
124125
// ->give($app->make('cache')->store());
125126

126-
$providers[] = $app->make($provider, is_array($config) ? $config : []);
127+
try {
128+
$providers[] = $app->make($provider, is_array($config) ? $config : []);
129+
} catch (Throwable) {
130+
// Silently skip providers that fail to instantiate (e.g., during testbench setup when services aren't available)
131+
// This prevents errors during composer autoload/testbench commands
132+
continue;
133+
}
127134
}
128135

129136
return new ModelInfoFactory(

0 commit comments

Comments
 (0)