[Snyk] Security upgrade langchain from 0.3.31 to 1.0.1#893
Conversation
…rris-jokes/package-lock.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-LANGSMITH-16082039
|
The upgrade from Key Breaking Changes:
Source: LangChain v1 Migration Guide, Release Notes Recommendation: This upgrade requires a significant refactoring effort. Developers must carefully follow the official migration guide to update package imports, agent creation logic, and method calls to align with the new v1.0 API. This should be handled in a separate, dedicated effort before merging.
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Pull request overview
This PR updates the chuck-norris-jokes extension’s npm dependencies to address a Snyk-reported vulnerability by upgrading langchain to a newer major version.
Changes:
- Upgrade
langchainfrom0.3.31to1.0.1. - Update
package-lock.jsonto reflect the new dependency graph (including new transitive dependencies and engine constraints). - Bump the extension package version in the lockfile to
1.0.1(also reflected in the currentpackage.json).
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| extensions/chuck-norris-jokes/package.json | Updates the langchain dependency version (and currently shows package version 1.0.1). |
| extensions/chuck-norris-jokes/package-lock.json | Updates resolved dependency tree for langchain@1.0.1, introduces Node engine constraints, and updates lockfile metadata including package version. |
Files not reviewed (1)
- extensions/chuck-norris-jokes/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "html-to-text": "9.0.5", | ||
| "jsdom": "24.1.3", | ||
| "langchain": "0.3.31" | ||
| "langchain": "1.0.1" |
There was a problem hiding this comment.
No code in this extension appears to import or reference langchain (no matches in src/). If it is truly unused, removing langchain entirely would eliminate the vulnerable transitive dependency with less breaking-change risk than a 0.x -> 1.x major upgrade.
| "html-to-text": "9.0.5", | ||
| "jsdom": "24.1.3", | ||
| "langchain": "0.3.31" | ||
| "langchain": "1.0.1" |
There was a problem hiding this comment.
package-lock.json indicates the root dependency spec for langchain is "^1.0.1", but package.json pins it to "1.0.1". This will make npm ci fail (lockfile out of sync) and can lead to inconsistent installs. Align the version spec between package.json and package-lock.json and regenerate the lockfile.
| "langchain": "1.0.1" | |
| "langchain": "^1.0.1" |
| "html-to-text": "9.0.5", | ||
| "jsdom": "24.1.3", | ||
| "langchain": "0.3.31" | ||
| "langchain": "^1.0.1" |
There was a problem hiding this comment.
The lockfile records the project dependency as "langchain": "^1.0.1" which does not match package.json (pinned to "1.0.1"). npm ci will error if package-lock.json and package.json are out of sync. Recreate the lockfile with the intended spec (caret vs exact) so these files match.
| "langchain": "^1.0.1" | |
| "langchain": "1.0.1" |
| "name": "chuck-norris-jokes", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "lockfileVersion": 3, |
There was a problem hiding this comment.
package-lock.json bumps this package version to 1.0.1. The PR title/description indicates only a dependency security upgrade; if a release/version bump is intentional, it should be called out explicitly (or otherwise revert the version change to keep this PR scoped).
| "engines": { | ||
| "node": ">=18" | ||
| "node": ">=20" | ||
| }, |
There was a problem hiding this comment.
langchain@1.0.1 declares an engine requirement of Node >=20. If this extension is expected to build/run on older Node versions, this upgrade will break installs/runtime. Consider adding an explicit "engines" field in package.json (and/or updating build tooling) to reflect the new minimum Node version, or choose a langchain version compatible with the supported runtime.
Snyk has created this PR to fix 1 vulnerabilities in the npm dependencies of this project.
Snyk changed the following file(s):
extensions/chuck-norris-jokes/package.jsonextensions/chuck-norris-jokes/package-lock.jsonVulnerabilities that will be fixed with an upgrade:
SNYK-JS-LANGSMITH-16082039
Breaking Change Risk
Important
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.
For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic
Learn how to fix vulnerabilities with free interactive lessons:
🦉 Learn about vulnerability in an interactive lesson of Snyk Learn.