langchain@1.0.3 stops exporting getContextVariable and setContextVariable from the package root. Both functions are defined in @langchain/core/context, and langchain re-exported them through 1.0.2; the import that did so is gone from the published 1.0.3 build, and none of the release’s six changelog entries names either function. Any import of the two names from langchain now fails to resolve.
What changed
- Two named exports removed, and the changelog does not say so.
getContextVariableandsetContextVariableare gone from thelangchainpackage root in 1.0.3. Comparing the publisheddist/index.d.tsfiles for 1.0.2 and 1.0.3 shows the re-exporting import dropped between the two; the six patch entries inlangchain’sCHANGELOG.mdfor 1.0.3 mention neither name. - The functions did not move out of the ecosystem. Both are still defined and exported from
@langchain/core/context, which is wherelangchainread them from in the first place.langchainre-exported them rather than owning them, and only the re-export went away.
Before and after
A program that imported both from the package root:
import { getContextVariable, setContextVariable } from 'langchain';Both changes carry an assisted fix, so emendant fix writes this rewrite once you name a model provider. The working replacement, confirmed against the published @langchain/core@1.0.3 package, is to import from the subpath that still carries them:
import { getContextVariable, setContextVariable } from '@langchain/core/context';Migration guidance and its limits
Both findings carry an assisted fix. Name a model provider on the command line or in emendant.json and emendant fix writes the specifier change; without one the two findings are reported with their guidance and nothing is sent anywhere. An assisted patch is one model’s answer to one site rather than a curated transform, and it is proved before you see it, in a copy of your repository moved to 1.0.3 and put through whichever of your own typecheck and tests it finds there. Making the import resolve again is a one-line edit either way, so doing it by hand costs little.
Import getContextVariable and setContextVariable from @langchain/core/context in place of langchain. That subpath’s exports are unchanged between @langchain/core 1.0.2 and 1.0.3, so nothing else about the call sites needs to change.
Each matcher here is an import-specifier match: it fires on a named import of getContextVariable or setContextVariable from langchain, and nothing else. A namespace import, a re-export of either name through a module of your own, or a dynamic import('langchain') is not covered, so a clean scan does not prove the two names are gone from your code, only that no direct named import of them from langchain remains.
The removal is absent from langchain’s own changelog for 1.0.3, so there is no migration note from the maintainers to check this page against beyond the published package itself. Treat the six listed patch changes in that release as unrelated to this page.
What Emendant detects, fixes and verifies
2 changes in langchain 1.0.3. 0 patched by a transform, 2 patched only with a model provider you name, 0 report only. Every patch is proved in a copy of your repository before it is offered, and its header names the checks that passed. This table is generated from the feed entry, so it cannot claim more than the entry does.
| Change | Severity | Detects | Fix | Verified by |
|---|---|---|---|---|
Removed getContextVariablelangchain-npm-1.0.3-get-context-variable-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
Removed setContextVariablelangchain-npm-1.0.3-set-context-variable-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
emendant explain <change-id> prints any row's entry, guidance and sources at the terminal.
Coverage
- Snapshot
2026-09-20.1, sequence 27, signed 20 September 2026- Minimum CLI
emendant@0.1.0- Feed entry
feed/npm/langchain/1.0.3.json
emendant feed status shows the snapshot your machine holds, and emendant feed update fetches the latest.
Primary sources
Every claim above was checked against these, each pinned to the release rather than to a default branch.
- langchain@1.0.3npm registry, the published package
- langchain@1.0.2npm registry, the published package
Scan your repository
Runs locally, reads your lockfile and source, sends nothing anywhere.
npx emendant scanThen npx emendant fix writes the patches the table says exist. The getting started guide covers the flags and the patch grades.