Skip to content

fix(langchain): stop overriding Azure request models - #225

Draft
Jackson Weber (JacksonWeber) wants to merge 5 commits into
microsoft:mainfrom
JacksonWeber:jacksonweber/fix-langchain-azure-model-attribution
Draft

fix(langchain): stop overriding Azure request models#225
Jackson Weber (JacksonWeber) wants to merge 5 commits into
microsoft:mainfrom
JacksonWeber:jacksonweber/fix-langchain-azure-model-attribution

Conversation

@JacksonWeber

@JacksonWeber Jackson Weber (JacksonWeber) commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Why a distro change remains

The distro currently detects bare AzureChatOpenAI runs and always prefers the server-reported response model for gen_ai.request.model. Once LangChain reports the configured deployment correctly, that workaround would overwrite the trustworthy request model.

This PR removes the Azure special case:

const effectiveRequestModel = requestModel ?? responseModel;

The response model remains populated separately when available.

Upstream dependency

This cleanup relies on the LangChain release containing langchain-ai/langchainjs#10886. That release must be used before shipping this change; older LangChain versions that report the unrelated gpt-3.5-turbo default will no longer receive a distro-side workaround.

Validation

  • focused LangChain utility suite: 88 passed
  • ESLint and Prettier checks passed for changed TypeScript files
  • package build passed

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@JacksonWeber Jackson Weber (JacksonWeber) changed the title fix(langchain): correct Azure model attribution for wrapped calls fix(langchain): keep request and response model attribution separate Aug 14, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JacksonWeber Jackson Weber (JacksonWeber) changed the title fix(langchain): keep request and response model attribution separate fix(langchain): apply Azure model workaround to wrapped calls Aug 14, 2026
Remove the distro workaround for callback payloads corrected by langchainjs#10886 and retain only request-first model precedence.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JacksonWeber Jackson Weber (JacksonWeber) changed the title fix(langchain): apply Azure model workaround to wrapped calls fix(langchain): stop overriding Azure request models Aug 17, 2026
@JacksonWeber

Copy link
Copy Markdown
Contributor Author

Wait to mark for review until langchain-ai/langchainjs#10886 is merged/released.

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