Skip to content

Comments

fix(docs): update an outdated middleware example#10146

Merged
Christian Bromann (christian-bromann) merged 3 commits intolangchain-ai:mainfrom
eddienubes:main
Feb 24, 2026
Merged

fix(docs): update an outdated middleware example#10146
Christian Bromann (christian-bromann) merged 3 commits intolangchain-ai:mainfrom
eddienubes:main

Conversation

@eddienubes
Copy link
Contributor

@eddienubes Dmytro Tiapukhin (eddienubes) commented Feb 24, 2026

Changelog

  • Introduces a tiny update to a middleware usage example
    Middleware hooks don't have controls parameter injected into them anymore.
    My LLM accidentally pointed out that I should be using controls.terminate to terminate the agent loop referring to this line. However, it's not actual anymore according to the types.

Copilot AI review requested due to automatic review settings February 24, 2026 20:28
@changeset-bot
Copy link

changeset-bot bot commented Feb 24, 2026

🦋 Changeset detected

Latest commit: a2e58c3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
langchain Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

Copilot AI left a comment

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 middleware JSDoc example to reflect the current middleware hook signature where controls is no longer injected into hooks.

Changes:

  • Updates beforeModel example signature to remove the controls parameter.
  • Replaces controls.terminate(...) with throwing an error in the example.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@eddienubes Dmytro Tiapukhin (eddienubes) changed the title docs: update an example fix(docs): update an example Feb 24, 2026
@eddienubes Dmytro Tiapukhin (eddienubes) changed the title fix(docs): update an example fix(docs): update an outdated middleware example Feb 24, 2026
Copy link
Member

Choose a reason for hiding this comment

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

Great catch 👌

@christian-bromann Christian Bromann (christian-bromann) merged commit 67cc069 into langchain-ai:main Feb 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants