Skip to content

fix: update @langchain/core and resolve type compatibility issues#575

Merged
gfargo merged 1 commit intomainfrom
fix/langchain-core-version
Mar 21, 2026
Merged

fix: update @langchain/core and resolve type compatibility issues#575
gfargo merged 1 commit intomainfrom
fix/langchain-core-version

Conversation

@gfargo
Copy link
Owner

@gfargo gfargo commented Mar 21, 2026

Summary

Fixes 3 failing test suites (commit.test.ts, conventionalCommitsHandler.test.ts, recap.test.ts) and resolves build failures caused by a @langchain/core version mismatch.

Root Cause

@langchain/classic (transitive dep via @langchain/community) ships a nested @langchain/openai@1.2.13 that requires @langchain/core/utils/standard_schema. This module was introduced in @langchain/core@1.1.32, but the lockfile had pinned @langchain/core to 1.1.24.

Upgrading @langchain/core to 1.1.34 resolved the missing module, but introduced TS2589 "type instantiation is excessively deep" errors — the new StructuredOutputParser types trigger infinite recursion with Zod generics during Rollup's stricter TypeScript compilation.

Changes

  1. Updated @langchain/core from 1.1.241.1.34 (lockfile update)
  2. Added targeted type casts to break the recursive type chain:
    • src/lib/langchain/utils/createSchemaParser.ts — return type + fromZodSchema call
    • src/lib/langchain/utils/executeChain.ts — parser type widened to Runnable, result cast
    • src/lib/langchain/utils/executeChainWithSchema.ts — parser variable cast
    • src/commands/changelog/handler.ts — parser cast + explicit executeChain type param
    • src/commands/recap/handler.ts — parser cast + explicit executeChain type param
    • src/commands/review/handler.ts — parser cast

Test Results

Test Suites: 43 passed, 43 total
Tests:       345 passed, 345 total

Build: ✅ dist/index.esm.mjs, dist/index.js created
Lint: ✅ clean

@langchain/classic (via @langchain/community) has a nested @langchain/openai@1.2.13 that requires @langchain/core/utils/standard_schema, which was introduced in @langchain/core@1.1.32. The lockfile had pinned @langchain/core to 1.1.24, causing 3 test suites to fail with a module-not-found error.
@gfargo gfargo merged commit 13a4375 into main Mar 21, 2026
5 of 6 checks passed
@gfargo gfargo deleted the fix/langchain-core-version branch March 21, 2026 01:28
@gfargo gfargo changed the title fix: update @langchain/core to resolve failing tests fix: update @langchain/core and resolve type compatibility issues Mar 21, 2026
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.

1 participant