Skip to content

build(deps): pin langchain family to 0.3.x/0.1.x lines to fix broken installs - #10

Merged
PreetamMatta merged 1 commit into
americanexpress:mainfrom
wilsonhj:upstream/deps-pin
Jul 16, 2026
Merged

build(deps): pin langchain family to 0.3.x/0.1.x lines to fix broken installs#10
PreetamMatta merged 1 commit into
americanexpress:mainfrom
wilsonhj:upstream/deps-pin

Conversation

@wilsonhj

@wilsonhj wilsonhj commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Why this PR exists

pyproject.toml currently has no upper bound on the langchain family. A fresh pip install connectchain / uv sync today resolves langchain 1.x, which removed langchain.chains, langchain.schema, and langchain.llms — modules this codebase imports throughout. Result: every import of connectchain fails (ModuleNotFoundError) and the test suite is uncollectable on a clean environment.

What it does

Adds upper bounds pinning to the lines the code actually targets — a 4-line diff, nothing else:

langchain>=0.3.26,<0.4.0
langchain-openai>=0.3.24,<0.4.0
langchain-community>=0.3.26,<0.4.0
langchain-mcp-adapters>=0.1.0,<0.2.0

Verification

  • uv sync --dev resolves langchain==0.3.30 (0.3.x line) and python -c "import connectchain" succeeds on a clean env.
  • Full unit suite: 57 passed / 1 failed — the single failure (test_model_with_unsupported_provider) is pre-existing on main and unrelated to dependency resolution (it asserts an outdated error message; a separate PR addresses it).

Sequencing

This is the first of a small series of focused PRs (dependency pin → sanitizer/orchestrator fixes → model/session/config fixes → MCP fixes → docs). The later PRs each include this pin so they build standalone; those hunks rebase away once this merges.

Co-authored-by: Claude noreply@anthropic.com

…n installs

The langchain, langchain-openai, langchain-community, and
langchain-mcp-adapters dependencies had lower bounds but no upper bounds.
A fresh resolve therefore pulls langchain 1.x, which removed
langchain.chains, langchain.schema, and langchain.llms - modules this
codebase imports throughout. That breaks every import of connectchain and
makes the entire test suite uncollectable on a clean install.

Pin these packages to the 0.3.x / 0.1.x lines the code actually targets:
  langchain>=0.3.26,<0.4.0
  langchain-openai>=0.3.24,<0.4.0
  langchain-community>=0.3.26,<0.4.0
  langchain-mcp-adapters>=0.1.0,<0.2.0

Co-authored-by: Claude <noreply@anthropic.com>
@wilsonhj

wilsonhj commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Runtime verification — PASS ✅

Verified by runtime observation (dependency resolution + package import), not by test suite. Two fully separate fresh venvs (Python 3.11.14), forced fresh resolves (isolated cache).

With the pin (this branch): resolves langchain 0.3.30 / langchain-core 0.3.86 / langchain-openai 0.3.35 / langchain-mcp-adapters 0.1.14; import connectchain + submodule imports all succeed; uv pip check → "All installed packages are compatible."

Counterfactual (parent commit, unpinned, fresh resolve): resolves langchain 1.3.11 and explodes on the first line of the package:

File ".../connectchain/__init__.py", line 15, in <module>
    from langchain.chains.api.base import APIChain
ModuleNotFoundError: No module named 'langchain.chains'

All three removed module families (langchain.chains, langchain.schema, langchain.llms) are imported across 7 source files and are gone in 1.x.

Worth knowing: the unpinned pip install itself exits 0 — the breakage is import-time only, so a fresh install looks fine until first use (or test collection). That's why this pin matters even though installs "work" today.

@PreetamMatta
PreetamMatta merged commit b51dd1c into americanexpress:main Jul 16, 2026
1 check passed
@wilsonhj

wilsonhj commented Jul 16, 2026 via email

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants