-
Notifications
You must be signed in to change notification settings - Fork 761
build(deps): upgrade to LangChain 1.x and resolve transitive NumPy 2.0+ conflicts #350
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?
Conversation
@microsoft-github-policy-service agree |
|
please revert unrelated changes and summarize the core changes needed. |
dedeacf to
0fcb784
Compare
test_integration.py for compatibility with updated La…
I have reverted unrelated changes like .gitignore. I've also reverted uv.lock as you requested. Please take a look at the PR description. The summary of core changes are included. |
|
/ci |
|
🚀 CI Watcher for correlation id-3605122076-mipjz6ty triggered by comment 3605122076
✅ All runs completed. |
|
Would you fix the failed tests? |
This was caused by the outdated uv.lock file, , which was reverted previously as you requested. The current lockfile does not incorporate the necessary dependency resolutions (NumPy 2.0 compatibility). |
- Updated `test_integration.py` to utilize improved LangChain agent capabilities. - Refactored agent setup to align with LangChain's updated API and prompt handling. - Upgraded `langchain` and related packages to latest versions with revised constraints. - Added `langsmith` and new external dependencies such as `verl`. - Enhanced query prompts to ensure proper syntax and schema validation. - Adjusted data pipeline to handle NumPy arrays by converting them into lists before processing.
…te` version - Refactored `uv.lock` resolution markers by reducing redundancy and simplifying platform-based conditions. - Upgraded `accelerate` package to version 1.12.0. - Adjusted package groups to enhance compatibility and reduce unnecessary duplication.
| { index = "pytorch-cpu", group = "torch-cpu" }, | ||
| ] | ||
| tinker_cookbook = { git = "https://github.com/thinking-machines-lab/tinker-cookbook" } | ||
| verl = {git = "https://github.com/Acture/verl.git"} |
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.
this is ireelevant
| # run_with_agentops_tracer() | ||
| run_with_http_tracer() | ||
| # _debug_with_agentops() | ||
| # _debug_with_agentops() |
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.
this is irrelevant
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.
this is altered by pre-commit.
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.
| """ | ||
| You are an agent designed to interact with a SQL database. | ||
| Given an input question, create a syntactically correct {dialect} query to run to help find the answer. | ||
| Given an input question, create a syntactically correct {dialect} query to run to help find the answer. |
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.
same here
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.
this is altered by pre-commit.
| "langchain-openai", | ||
| "langchain-community", | ||
| "langchain-text-splitters<1.0", | ||
| "langchain-text-splitters", |
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.
please commit the new uv.lock
|
/ci |
|
🚀 CI Watcher for correlation id-3606124420-mipv1cwn triggered by comment 3606124420
✅ All runs completed. |
Failure was caused by the lack of corresponding cache, which really can't be fixed by myself. |
I think you can fix it. You just need to set the global variable (OPENAI_BASE_URL) in different modes. But let's pause here. I'll take over the PR and fix the rest of the issues. |

🚀 Summary
This PR modernizes the project's dependency graph to enable full integration with the LangChain 1.x ecosystem. It addresses critical "dependency hell" issues caused by upstream transitive dependencies (specifically
verlandTransferQueue) incompatible with NumPy 2.0+.Additionally, this PR refactors the internal agent architecture to align with updated LangChain APIs, replacing deprecated usage with modern patterns (LangSmith, LangGraph).
🛠️ Dependency Resolution Strategy
The Problem: Conflicting Requirements
The environment upgrade was blocked by strict version pinning in upstream dependencies:
numpy >= 2.0.0verl)numpy < 2.0.0The Solution: Source Overrides & Modernization
Since we cannot wait for upstream releases, I have applied a temporary Source Override strategy to unblock the build.
TransferQueueandverl, migrating their build systems topyproject.toml(PEP 621).numpyconstraints in theTransferQueuefork after verifying API usage.sglangoptional dependency group from theverlfork.Implementation Details
The
pyproject.tomlhas been updated to use[tool.uv.sources]pointing to the patched forks:Safety Check: analysis confirms TransferQueue uses standard NumPy APIs. It does not rely on C-API structures changed in NumPy 2.0, ensuring ABI compatibility.
⚡ Codebase Modernization (LangChain 1.x)
Apart from dependency fixes, the following architectural changes were made to support LangChain 1.x:
LangSmith Integration: Replaced deprecated langchain
hubusage with langsmith.Client.Agent Construction: Switched from the legacy create_react_agent to the more flexible create_agent pattern; updated prompt handling accordingly, alsoupdated calculator tool usage.
Expect the regression test suite to fail.
Since this PR updates core LangChain prompt templates (e.g., switching to
langsmithhub patterns), the request signatures have changed. The existing mock server cache is now invalidated, resulting in the following error during integration tests:Root Cause:
The Mock/Caching layer cannot find a matching response key for the modernized prompt structure.
Resolution:
This is not a code error. To resolve this, the test suite must be run in
recordmode against a live LLM endpoint to regenerate the cache. (Blocked by missing credentials in the local/current CI environment).