UAT: langchain-core not declared as a direct dependency in pyproject.toml — directly imported but only available transitively #4049

Open
opened 2026-04-06 09:26:45 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/declare-langchain-core-direct-dependency
  • Commit Message: fix(build): declare langchain-core as a direct dependency in pyproject.toml
  • Milestone: (none — backlog)
  • Parent Epic: #2810

Backlog note: This issue was discovered during autonomous UAT testing
of the Dependency Management and Package System feature area.
It does not block milestone completion and has been placed in the backlog
for human review and future milestone assignment.

Bug Report

What Was Tested

Code-level analysis of pyproject.toml dependencies vs actual third-party imports across the source codebase.

Expected Behavior

langchain-core should be declared as a direct dependency in pyproject.toml because the codebase directly imports from it in multiple production files. Best practice requires that all packages you import directly be listed as direct dependencies.

Actual Behavior

langchain-core is not listed in pyproject.toml [project.dependencies]. It is only available as a transitive dependency via langchain>=0.2.14 and langchain-community>=0.2.14, both of which declare langchain-core as their own dependency.

Files That Directly Import langchain_core

The following production source files import directly from langchain_core:

  1. src/cleveragents/application/services/context_service.py:

    from langchain_core.language_models import BaseLanguageModel
    
  2. src/cleveragents/application/services/memory_service.py:

    from langchain_community.chat_message_histories import SQLChatMessageHistory
    from langchain_core.chat_history import (...)
    from langchain_core.messages import AIMessage, BaseMessage, HumanMessage
    
  3. src/cleveragents/providers/llm/langchain_chat_provider.py:

    from langchain_core.language_models import BaseLanguageModel
    

Risk

langchain-core is a foundational package in the LangChain ecosystem. If langchain or langchain-community ever changes their version constraints on langchain-core, the production code that directly imports from it could break. Declaring it explicitly ensures the version constraint is controlled by this project.

Steps to Reproduce

  1. Read pyproject.toml — search for langchain-core in [project.dependencies]
  2. Observe it is absent
  3. Read src/cleveragents/application/services/memory_service.py — observe direct from langchain_core.messages import ... statements

Fix

Add langchain-core with an appropriate version constraint to [project.dependencies] in pyproject.toml:

dependencies = [
    ...
    "langchain-core>=0.3.0",  # Core LangChain abstractions — directly imported
    ...
]

The version constraint should be compatible with the versions required by langchain>=0.2.14 and langchain-community>=0.2.14.

Subtasks

  • Add langchain-core with appropriate version constraint to [project.dependencies] in pyproject.toml
  • Verify the version constraint is compatible with langchain and langchain-community requirements
  • Run nox -e lint and nox -e typecheck to verify no regressions

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • langchain-core appears as a direct dependency in pyproject.toml
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/declare-langchain-core-direct-dependency` - **Commit Message**: `fix(build): declare langchain-core as a direct dependency in pyproject.toml` - **Milestone**: *(none — backlog)* - **Parent Epic**: #2810 > **Backlog note:** This issue was discovered during autonomous UAT testing > of the Dependency Management and Package System feature area. > It does not block milestone completion and has been placed in the backlog > for human review and future milestone assignment. ## Bug Report ### What Was Tested Code-level analysis of `pyproject.toml` dependencies vs actual third-party imports across the source codebase. ### Expected Behavior `langchain-core` should be declared as a **direct dependency** in `pyproject.toml` because the codebase directly imports from it in multiple production files. Best practice requires that all packages you import directly be listed as direct dependencies. ### Actual Behavior `langchain-core` is **not listed** in `pyproject.toml` `[project.dependencies]`. It is only available as a transitive dependency via `langchain>=0.2.14` and `langchain-community>=0.2.14`, both of which declare `langchain-core` as their own dependency. ### Files That Directly Import `langchain_core` The following production source files import directly from `langchain_core`: 1. `src/cleveragents/application/services/context_service.py`: ```python from langchain_core.language_models import BaseLanguageModel ``` 2. `src/cleveragents/application/services/memory_service.py`: ```python from langchain_community.chat_message_histories import SQLChatMessageHistory from langchain_core.chat_history import (...) from langchain_core.messages import AIMessage, BaseMessage, HumanMessage ``` 3. `src/cleveragents/providers/llm/langchain_chat_provider.py`: ```python from langchain_core.language_models import BaseLanguageModel ``` ### Risk `langchain-core` is a foundational package in the LangChain ecosystem. If `langchain` or `langchain-community` ever changes their version constraints on `langchain-core`, the production code that directly imports from it could break. Declaring it explicitly ensures the version constraint is controlled by this project. ### Steps to Reproduce 1. Read `pyproject.toml` — search for `langchain-core` in `[project.dependencies]` 2. Observe it is absent 3. Read `src/cleveragents/application/services/memory_service.py` — observe direct `from langchain_core.messages import ...` statements ### Fix Add `langchain-core` with an appropriate version constraint to `[project.dependencies]` in `pyproject.toml`: ```toml dependencies = [ ... "langchain-core>=0.3.0", # Core LangChain abstractions — directly imported ... ] ``` The version constraint should be compatible with the versions required by `langchain>=0.2.14` and `langchain-community>=0.2.14`. ## Subtasks - [ ] Add `langchain-core` with appropriate version constraint to `[project.dependencies]` in `pyproject.toml` - [ ] Verify the version constraint is compatible with `langchain` and `langchain-community` requirements - [ ] Run `nox -e lint` and `nox -e typecheck` to verify no regressions ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - `langchain-core` appears as a direct dependency in `pyproject.toml` - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:11:33 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#4049
No description provided.