feat(deps): migrate LangChain 0.3 → 1.x (backend npm audit: 10 → 0)#140
Merged
recabasic merged 4 commits intoJun 10, 2026
Merged
Conversation
…->0) Addresses the automated security audit issues (CaviraOSS#138 and earlier). Backend (npm audit fix --legacy-peer-deps): - Clears the critical protobufjs advisory and 4 highs (fast-xml-parser/builder, @xmldom/xmldom, underscore chains) - 33 -> 22 vulnerabilities; tsc build verified clean Frontend (pnpm update within semver + concurrently 9->10 devDep): - Clears all 40 advisories including the critical shell-quote one (concurrently 9.x pins shell-quote 1.8.3; v10 ships 1.8.4) - 40 -> 0 vulnerabilities; vite build verified clean The 22 remaining backend advisories all require maintainer decisions: - 9 come through @keyv/sqlite -> sqlite3 -> node-gyp/tar (install-time toolchain of an unmaintained package) - 13 require the langchain 0.3 -> 1.x major migration
Plain `npm install` fails with ERESOLVE on the pre-existing openai@6 vs @browserbasehq/stagehand (peer openai@^4) conflict, which is why the CI pipeline fails intermittently on main. This makes installs deterministic for CI and contributors until the conflict is resolved upstream.
…rides sqlite3@5.1.7 (final release, unmaintained) pulls node-gyp 8.x with vulnerable tar/cacache/make-fetch-happen. Pinning the toolchain to current patched versions clears 6 of the 7 remaining high advisories. tsc build verified; sqlite3 installs via prebuilt binaries so the node-gyp bump only affects the source-build fallback path. The last high (langsmith) plus 9 moderates all sit behind the langchain 0.3 -> 1.x migration and are left for a dedicated PR.
…end advisories Code changes are minimal because the API surface in use is narrow: - RecursiveCharacterTextSplitter: langchain/text_splitter -> @langchain/textsplitters - MemoryVectorStore: langchain/vectorstores/memory -> @langchain/classic/vectorstores/memory - ChatX constructors, Document, EmbeddingsInterface, Chroma, and langgraph StateGraph/Annotation.Root are source-compatible in 1.x npm audit: 0 vulnerabilities (was 10 after the first round of fixes, 33 originally). tsc build clean; vitest 15 passed / 3 skipped (integration tests that need API keys).
recabasic
approved these changes
Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The LangChain 0.3 → 1.x migration promised in #139 — this clears all remaining backend
npm auditadvisories: 10 → 0 (33 before #139), including thelangsmithhighs (SSRF, prototype pollution, deserialization).Why the diff is small
The backend's LangChain API surface is narrow, and almost all of it is source-compatible in 1.x:
ChatAnthropic/ChatGoogleGenerativeAI/ChatOllama/ChatOpenAI+ embeddingsDocument,EmbeddingsInterface(@langchain/core)Chroma(@langchain/community/vectorstores/chroma)StateGraph+Annotation.Root(@langchain/langgraph)RecursiveCharacterTextSplitterfromlangchain/text_splitter@langchain/textsplittersMemoryVectorStorefromlangchain/vectorstores/memory@langchain/classic/vectorstores/memoryTwo import lines changed; everything else is
package.json/lockfile.Verification
npm audit→ found 0 vulnerabilitiesnpm run build(tsc) → cleannpm test→ 15 passed / 3 skipped (the skipped ones are integration tests requiring live API keys)Note: the chat-model code paths (model factories, examlab langgraph flows) are covered by the unit suite; a quick smoke of a live provider call after merge would be a reasonable extra check since I can't exercise live keys from here.