Skip to content

chore: Update Langchain to latest version and TypeScript to v5#2253

Merged
caneppelevitor merged 5 commits intostagefrom
chore/langchain-update
Feb 25, 2026
Merged

chore: Update Langchain to latest version and TypeScript to v5#2253
caneppelevitor merged 5 commits intostagefrom
chore/langchain-update

Conversation

@lucaslobatob
Copy link
Collaborator

@lucaslobatob lucaslobatob commented Feb 20, 2026

Description

*This PR upgrades the LangChain ecosystem to the latest 1.x versions and adapts the current implementation to align with the new architecture. The following packages were updated: @langchain/community to 1.1.16, @langchain/core to 1.1.26, @langchain/openai to 1.2.8, and langchain to 1.2.25. TypeScript was also updated to 5.3.0, and @langchain/langgraph 1.1.5 was added to support the updated ecosystem and future graph-based agent capabilities.

Due to structural changes introduced in LangChain v1, several imports were migrated to the @langchain/classic entrypoints, including AgentExecutor, createToolCallingAgent, WebBrowser, loadSummarizationChain, and StuffDocumentsChain. This aligns the project with the new modular package organization introduced in the latest versions.

Additionally, the agent implementation was updated by replacing createOpenAIFunctionsAgent with createToolCallingAgent. This change reflects the migration from the legacy OpenAI functions API to the modern tool-calling abstraction used in LangChain v1, ensuring better forward compatibility and adherence to the current recommended architecture.

Finally, a temporary as any cast was introduced when instantiating DynamicStructuredTool. This was necessary to avoid TypeScript deep type instantiation errors (TS2589) caused by complex generic inference in LangChain 1.x.

The @langchain/core@1.1.26 upgrade introduced a dependency on ansi-styles@6.x, which is ESM-only. Since Jest does not transform node_modules by default, this caused a SyntaxError in all test suites that imported any @langchain module. To fix this, a Yarn resolutions entry was added to force @langchain/core to use ansi-styles@5.2.0, a CJS-compatible version already present in the project, resolving the conflict without impacting other dependencies.*

Related Ticket #2247 #2248 #2249

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Testing

Provide relevant testing instructions. What scenarios are impacted? What build may be necessary to test this change?

Developer Checklist

General

  • No console.log or related logging is added.
  • No code is repeated/duplicated in violation of DRY. The exception to this is for new (MVP/Prototype) functionality where the abstraction layer may not be clear (comments should be added to explain the violation of DRY in these scenarios).

Tests

  • All existing unit and end to end tests pass across all services
  • Unit and end to end tests have been added to ensure backend APIs behave as expected

Test IDs

  • Include the test ID when adding new tasks or components.
  • Check that test IDs are present in the modified components.

Merge Request Review Checklist

  • An issue is linked to this PR and these changes meet the requirements outlined in the linked issue(s)
  • High risk and core workflows have been tested and verified in a local environment.
  • Enhancements or opportunities to improve performance, stability, security or code readability have been noted and documented in Project do Github issues if not being addressed.
  • Any dependent changes have been merged and published in downstream modules
  • Changes to multiple services can be deployed in parallel and independently. If not, changes should be broken out into separate merge requests and deployed in order.

@caneppelevitor caneppelevitor merged commit d7547c0 into stage Feb 25, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: QA

Development

Successfully merging this pull request may close these issues.

2 participants