Incorrect Error Message: Authentication handler error does not interpolate variable #1040

Closed
opened 2026-02-20 17:42:51 -05:00 by yindo · 1 comment
Owner

Originally created by @Kavya-24 on GitHub (Nov 3, 2025).

Checked other resources

  • This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/).
  • I added a clear and detailed title that summarizes the issue.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.

Example Code

Reference: https://github.com/langchain-ai/langgraph/blob/main/libs/sdk-py/langgraph_sdk/auth/__init__.py/#L261

raise ValueError(
                "Authentication handler already set as {self._authenticate_handler}."
)

Error Message and Stack Trace (if applicable)

-

Description

The error message raised when attempting to set an authentication handler multiple times does not correctly display the current handler instance.
Currently, the string uses curly braces {self._authenticate_handler} without the f-string prefix, so the actual handler value is not shown in the error message.
This may cause confusion during debugging, as users don’t see which handler is already set.

System Info

System Information

OS: Darwin
OS Version: Darwin Kernel Version 23.6.0: Mon Aug 11 21:20:40 PDT 2025; root:xnu-10063.141.1.706.13~1/RELEASE_ARM64_T6020
Python Version: 3.13.3 (main, Apr 8 2025, 13:54:08) [Clang 16.0.0 (clang-1600.0.26.6)]

Package Information

langchain_core: 1.0.3
langsmith: 0.4.39

Optional packages not installed

langserve

Other Dependencies

claude-agent-sdk: Installed. No version info available.
httpx: 0.28.1
jsonpatch: 1.33
langsmith-pyo3: Installed. No version info available.
openai-agents: Installed. No version info available.
opentelemetry-api: Installed. No version info available.
opentelemetry-exporter-otlp-proto-http: Installed. No version info available.
opentelemetry-sdk: Installed. No version info available.
orjson: 3.11.4
packaging: 25.0
pydantic: 2.12.3
pytest: Installed. No version info available.
pyyaml: 6.0.3
requests: 2.32.5
requests-toolbelt: 1.0.0
rich: Installed. No version info available.
tenacity: 9.1.2
typing-extensions: 4.15.0
vcrpy: Installed. No version info available.
zstandard: 0.25.0

Originally created by @Kavya-24 on GitHub (Nov 3, 2025). ### Checked other resources - [x] This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/). - [x] I added a clear and detailed title that summarizes the issue. - [x] I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example). - [x] I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue. ### Example Code ```python Reference: https://github.com/langchain-ai/langgraph/blob/main/libs/sdk-py/langgraph_sdk/auth/__init__.py/#L261 raise ValueError( "Authentication handler already set as {self._authenticate_handler}." ) ``` ### Error Message and Stack Trace (if applicable) ```shell - ``` ### Description The error message raised when attempting to set an authentication handler multiple times does not correctly display the current handler instance. Currently, the string uses curly braces {self._authenticate_handler} without the f-string prefix, so the actual handler value is not shown in the error message. This may cause confusion during debugging, as users don’t see which handler is already set. ### System Info System Information ------------------ > OS: Darwin > OS Version: Darwin Kernel Version 23.6.0: Mon Aug 11 21:20:40 PDT 2025; root:xnu-10063.141.1.706.13~1/RELEASE_ARM64_T6020 > Python Version: 3.13.3 (main, Apr 8 2025, 13:54:08) [Clang 16.0.0 (clang-1600.0.26.6)] Package Information ------------------- > langchain_core: 1.0.3 > langsmith: 0.4.39 Optional packages not installed ------------------------------- > langserve Other Dependencies ------------------ > claude-agent-sdk: Installed. No version info available. > httpx: 0.28.1 > jsonpatch: 1.33 > langsmith-pyo3: Installed. No version info available. > openai-agents: Installed. No version info available. > opentelemetry-api: Installed. No version info available. > opentelemetry-exporter-otlp-proto-http: Installed. No version info available. > opentelemetry-sdk: Installed. No version info available. > orjson: 3.11.4 > packaging: 25.0 > pydantic: 2.12.3 > pytest: Installed. No version info available. > pyyaml: 6.0.3 > requests: 2.32.5 > requests-toolbelt: 1.0.0 > rich: Installed. No version info available. > tenacity: 9.1.2 > typing-extensions: 4.15.0 > vcrpy: Installed. No version info available. > zstandard: 0.25.0
yindo added the bugpending labels 2026-02-20 17:42:51 -05:00
yindo closed this issue 2026-02-20 17:42:51 -05:00
Author
Owner

@Kavya-24 commented on GitHub (Nov 3, 2025):

Fixed here
https://github.com/langchain-ai/langgraph/pull/6388

@Kavya-24 commented on GitHub (Nov 3, 2025): Fixed here https://github.com/langchain-ai/langgraph/pull/6388
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#1040