-
Notifications
You must be signed in to change notification settings - Fork 170
fix: Fix Langchain #2457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: Fix Langchain #2457
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
…sage types without roles
… NaN and Infinity
| # RemoveMessage is a special message type used by LangGraph to mark messages for removal | ||
| # It doesn't have a traditional role, so we skip adding a role attribute | ||
| # This prevents ValueError while allowing RemoveMessage to be processed | ||
| return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: RemoveMessage triggers unnecessary warning log on every occurrence
The RemoveMessage handling in _map_class_name_to_role returns None to indicate no role is needed. However, in _extract_message_role, when role is None after all strategies are tried, a warning is logged. This means every RemoveMessage processed will trigger a "Unable to determine message role" warning, even though returning None for RemoveMessage is intentional and expected behavior. In LangGraph applications that use message removal frequently, this could cause significant log noise in production.
Closes #2424 #2429 #2474
langchaindependency to version 1.0.0 or higher.langchain-classicfor legacy support.Note
Adds LangChain 1.x and Classic compatibility, improves _convert_io to detect stringified JSON with MIME tagging, updates examples/docs, and adjusts deps/tests accordingly.
_convert_ioto detect stringified JSON and emitapplication/jsonMIME type; add_is_json_parseable.RemoveMessage, optional roles) and tolerate missingcontent.type.README.mdwith compatibility, install paths for LangChain 1.x and Classic, and new agent-based quickstart.examples/langchain_v1_agent.py,examples/langchain_v1_with_middleware.py; updatelanggraph_agent_supervisor.pyto uselangchain_classic.langchain>=1.0.0and addlangchain-classic>=1.0.0; updatepyproject.tomloptional test deps accordingly; refreshexamples/requirements.txt._convert_iotest coverage, including JSON-string detection, edge cases, performance, and advanced types.Written by Cursor Bugbot for commit a6c142d. This will update automatically on new commits. Configure here.