Skip to content

Conversation

@mikeldking
Copy link
Collaborator

@mikeldking mikeldking commented Nov 13, 2025

resolves #2430
Screenshot 2025-11-13 at 10 48 00 PM

@mikeldking mikeldking requested a review from a team as a code owner November 13, 2025 21:26
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Nov 13, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Module Path Mismatch Breaks Test Mocks

The vi.mock("@langchain/openai") targets the wrong module path. The test imports ChatOpenAI and OpenAIEmbeddings from @langchain/openaiV0.3 (line 31), but the mock is registered for @langchain/openai. This causes the mock to not apply, meaning tests will use the real implementation instead of the mocked one, breaking the test setup and potentially causing test failures or unexpected behavior.

js/packages/openinference-instrumentation-langchain/test/langchainV3.test.ts#L67-L68

Fix in Cursor Fix in Web


@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Nov 13, 2025
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Nov 13, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Nov 14, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 14, 2025

Open in StackBlitz

@arizeai/openinference-core

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-core@2444

@arizeai/openinference-genai

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-genai@2444

@arizeai/openinference-instrumentation-anthropic

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-anthropic@2444

@arizeai/openinference-instrumentation-bedrock

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-bedrock@2444

@arizeai/openinference-instrumentation-bedrock-agent-runtime

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-bedrock-agent-runtime@2444

@arizeai/openinference-instrumentation-beeai

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-beeai@2444

@arizeai/openinference-instrumentation-langchain

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-langchain@2444

@arizeai/openinference-instrumentation-langchain-v0

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-langchain-v0@2444

@arizeai/openinference-instrumentation-mcp

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-mcp@2444

@arizeai/openinference-instrumentation-openai

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-openai@2444

@arizeai/openinference-mastra

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-mastra@2444

@arizeai/openinference-semantic-conventions

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-semantic-conventions@2444

@arizeai/openinference-vercel

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-vercel@2444

commit: df8b058

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Nov 14, 2025
@mikeldking mikeldking changed the title feat: langchainjs 1.0 feat!: langchainjs 1.0 Nov 14, 2025
Copy link
Contributor

@cephalization cephalization left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, the agent example looks good to me when I run it myself. Not sure how non-agent use cases work but I assume the agent uses normal langchain calls under the hood

{
"extends": "../../tsconfig.base.esnext.json",
"compilerOptions": {
"outDir": "dist/esnext",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't actually think that esnext is an accessible dist location. I think we can nuke the build step for esnext. commonjs apps will access the commonjs dist, and esm apps access the esm dist. I don't know which runtimes actually access the esnext dist. We can shrink the package size by quite a bit by dropping esnext builds

const agent = createAgent({
model: "gpt-4o-mini", // Using a more accessible model
tools: [getWeather, calculateMath, searchInfo],
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Type mismatch: createAgent model parameter.

The createAgent function is called with model: "gpt-4o-mini" as a string parameter, but based on LangChain.js 1.0 documentation, createAgent expects an instantiated model object (like ChatOpenAI), not a model name string. This will cause a runtime error when the agent attempts to use the model for inference.

Fix in Cursor Fix in Web

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Metadata Tests: Fix Convention Drift

The METADATA import was removed from @arizeai/openinference-semantic-conventions but the tests still reference metadata as a hardcoded string literal (e.g., metadata: "{}") in multiple assertions. This creates inconsistency with the semantic conventions pattern used elsewhere and makes the code more fragile if the metadata key name ever changes in the semantic conventions package.

js/packages/openinference-instrumentation-langchain/test/tracer.test.ts#L6-L7

Fix in Cursor Fix in Web


openAIApiKey: process.env.OPENAI_API_KEY,
modelName: "o3-mini",
reasoningEffort: "medium",
reasoning: { effort: "medium" },
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: ChatOpenAI API Key Parameter Inconsistency

The ChatOpenAI constructor still uses openAIApiKey parameter while the rest of the codebase (including all test files in this PR) was updated to use apiKey for @langchain/openai version 1.1.0. This inconsistency suggests the example wasn't fully migrated and may fail if openAIApiKey was deprecated in favor of apiKey in the newer version.

Fix in Cursor Fix in Web

@mikeldking mikeldking merged commit 3ef46a9 into main Nov 14, 2025
8 checks passed
@mikeldking mikeldking deleted the langchain-1 branch November 14, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[bug] LangChain.js/LangGraph.js instrumentation not compatible with v1

3 participants