Skip to content

fix(ai-orchestrator): update LangChain v0.3 constructor params to resolve Anthropic 404#135

Merged
SteveJRobertson merged 6 commits into
mainfrom
129-upgrade-langchain-deps
Jun 3, 2026
Merged

fix(ai-orchestrator): update LangChain v0.3 constructor params to resolve Anthropic 404#135
SteveJRobertson merged 6 commits into
mainfrom
129-upgrade-langchain-deps

Conversation

@SteveJRobertson

@SteveJRobertson SteveJRobertson commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #134

Updates the LangChain client constructors to adhere to v0.3 standards. The SDK introduced a standardisation where the legacy parameter modelName has been deprecated in favour of model. Additionally, the Anthropic model identifier is changed from a generic alias to an explicit dated version for API stability.

Changes

  • ChatOpenAI: Changed modelName: 'gpt-4o' to model: 'gpt-4o'
  • ChatAnthropic: Changed modelName: 'claude-3-5-sonnet-latest' to model: 'claude-3-5-sonnet-20241022'
  • Type Safety: Removed unnecessary as any type assertion from ChatAnthropic config (now validates cleanly with correct v0.3 types)
  • Tests: Updated all assertions in clients.spec.ts to check config.model property with correct identifiers
  • Build Validation: All 275 tests passing, type checking clean, build successful

Copilot Review Triage

  • Blocker (Security / Correctness)
  • Major (Reliability)
  • Minor (Coverage)
  • Nit (Style)

Deferred follow-ups

None. This PR fully resolves issue #134.

…olve Anthropic 404

- Change modelName to model for ChatOpenAI and ChatAnthropic (v0.3 standard)
- Update Anthropic model ID from 'claude-3-5-sonnet-latest' to 'claude-3-5-sonnet-20241022'
- Remove unnecessary 'as any' type assertion from ChatAnthropic config
- Update unit tests to assert on 'model' property with correct identifiers

Closes #134
Copilot AI review requested due to automatic review settings June 3, 2026 16:54
@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
isolate-ui Ignored Ignored Preview Jun 3, 2026 6:21pm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the ai-orchestrator’s LangChain OpenAI/Anthropic client construction to match the newer constructor shape (model instead of modelName) and pins Anthropic to a dated model identifier to avoid the reported 404.

Changes:

  • Bumped @langchain/openai and @langchain/anthropic to ^0.3.0 and updated the lockfile accordingly.
  • Updated getOpenAIClient() / getAnthropicClient() constructors to use model and pinned Anthropic to claude-3-5-sonnet-20241022 (also removed the as any).
  • Updated unit tests to assert config.model instead of config.modelName and added logs to .gitignore.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pnpm-lock.yaml Locks updated LangChain/OpenAI/Anthropic dependency graph after version bumps.
package.json Bumps root LangChain OpenAI/Anthropic versions to ^0.3.0.
libs/ai-orchestrator/src/llm/clients.ts Switches constructors to model and pins Anthropic model ID; removes as any.
libs/ai-orchestrator/src/__tests__/clients.spec.ts Updates assertions to validate config.model for both clients.
libs/ai-orchestrator/package.json Aligns ai-orchestrator’s direct LangChain dependencies with the bumped versions.
.gitignore Ignores a logs directory/path.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment thread pnpm-lock.yaml Outdated
Comment thread libs/ai-orchestrator/package.json Outdated
…-deps

# Conflicts:
#	libs/ai-orchestrator/package.json
#	package.json
#	pnpm-lock.yaml
@SteveJRobertson SteveJRobertson merged commit 0aa4688 into main Jun 3, 2026
6 checks passed
@SteveJRobertson SteveJRobertson deleted the 129-upgrade-langchain-deps branch June 3, 2026 18:25
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.

fix: update LangChain v0.3 constructor params to resolve Anthropic 404

2 participants