fix(cli): only warn the user if an invalid LangSmith API key is passed while tracing is enabled (#1463)

This commit is contained in:
David Duong
2025-07-29 18:25:40 +02:00
committed by GitHub
parent 8e1ec9e59a
commit 1777878476
2 changed files with 10 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@langchain/langgraph-api": patch
---
fix(cli): only warn the user if an invalid LangSmith API key is passed while tracing is enabled
+5 -2
View File
@@ -31,9 +31,12 @@ const [{ host, cleanup }, organizationId] = await Promise.all([
if (isTracingEnabled()) {
try {
// @ts-expect-error Private method
return new LangSmithClient()._getTenantId();
return await new LangSmithClient()._getTenantId();
} catch (error) {
logger.warn("Failed to get organization ID", { error });
logger.warn(
"Failed to get organization ID. Tracing to LangSmith will not work.",
{ error }
);
}
}
return null;