Skip to content

Conversation

@christian-bromann
Copy link
Member

This patch updates the jump behavior of the agent, forcing user to statically type valid targets and allows us to better draw graphs from it. This introduces 2 new options to the middleware: beforeModelJumpTo and afterModelJumpTo which are lists and can contain jump targets: model, end and tools. Only if the jump target is defined the beforeModel or afterModel hook is allowed to jump to it.

I created a test to verify all combination of what user can provide:

  • 2 agents
    -beforeModelJumpTo and afterModelJumpTo set to undefined, [] or either combination of the allowed values
  • a tool is set or not

You can review the results and graphs in this gist: https://gist.github.com/christian-bromann/8a167bff41925364eda9c15807780b2b

@changeset-bot
Copy link

changeset-bot bot commented Sep 24, 2025

⚠️ No Changeset found

Latest commit: c78b796

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

@vercel
Copy link

vercel bot commented Sep 24, 2025

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

Project Deployment Preview Comments Updated (UTC)
langchainjs-docs Ready Ready Preview Comment Sep 25, 2025 6:02am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
langchainjs-api-refs Ignored Ignored Sep 25, 2025 6:02am

@christian-bromann christian-bromann merged commit 1597074 into v1 Sep 25, 2025
34 checks passed
@christian-bromann christian-bromann deleted the cb/statically-typed-jumps branch September 25, 2025 06:12
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.

3 participants