Skip to content

Commit 116b367

Browse files
committed
Hotfix run agent requires local API key when using managed cloud
1 parent 08db227 commit 116b367

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

web/components/providers/imc-provider.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,23 +169,23 @@ export default function InterModuleCommunicationProvider({
169169
throw new Error("Agent method not found.");
170170
}
171171

172-
const config = llmConfig
173-
? llmConfig
174-
: method.LLMConfig
175-
? method.LLMConfig
176-
: agent.LLMConfig
177-
? agent.LLMConfig
178-
: undefined; // TODO: use editor level default config -- getDefaultLLMConfig();
179-
180-
if (!config) {
181-
throw new Error("No LLM config found for this agent method.");
182-
}
183-
184172
if (editorContext?.persistSettings?.isUseManagedCloud) {
185173
const result = await runAgentMethodCloud(agent, methodName, args);
186174

187175
return result;
188176
} else {
177+
const config = llmConfig
178+
? llmConfig
179+
: method.LLMConfig
180+
? method.LLMConfig
181+
: agent.LLMConfig
182+
? agent.LLMConfig
183+
: undefined; // TODO: use editor level default config -- getDefaultLLMConfig();
184+
185+
if (!config) {
186+
throw new Error("No LLM config found for this agent method.");
187+
}
188+
189189
const provider = config.provider;
190190

191191
const apiKey = getAPIKey(editorContext, provider);

0 commit comments

Comments
 (0)