🔧 fix: Plugin Method Undefined in Agent Tool Closure (#8413)

This commit is contained in:
Danny Avila 2025-07-11 13:16:59 -04:00 committed by GitHub
parent 1e4f1f780c
commit 929b433662
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 55 additions and 50 deletions

View file

@ -76,6 +76,11 @@ export async function getPluginAuthMap({
await Promise.all(decryptionPromises);
return authMap;
} catch (error) {
const message = error instanceof Error ? error.message : 'Unknown error';
const plugins = pluginKeys?.join(', ') ?? 'all requested';
logger.warn(
`[getPluginAuthMap] Failed to fetch auth values for userId ${userId}, plugins: ${plugins}: ${message}`,
);
if (!throwError) {
/** Empty objects for each plugin key on error */
return pluginKeys.reduce((acc, key) => {
@ -83,11 +88,6 @@ export async function getPluginAuthMap({
return acc;
}, {} as PluginAuthMap);
}
const message = error instanceof Error ? error.message : 'Unknown error';
logger.error(
`[getPluginAuthMap] Failed to fetch auth values for userId ${userId}, plugins: ${pluginKeys.join(', ')}: ${message}`,
);
throw error;
}
}