Skip to content

Conversation

@christian-bromann
Copy link
Member

wrapToolCall and wrapModelCall do not properly retain the state of the middleware. This patch fixes these issues and adds test coverage to ensure we don't regress.

@changeset-bot
Copy link

changeset-bot bot commented Nov 3, 2025

⚠️ No Changeset found

Latest commit: 022ebfa

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.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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


#agentNode: AgentNode<any, AnyAnnotationRoot>;

#stateManager = new StateManager();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the #stateManager properly persist in checkpointer?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it needs to. It is just s small helper class to help merge the state between 4 nodes into a single agent state, e.g. if you change state in beforeModel it makes sure that afterModel gets these updates.

@christian-bromann christian-bromann merged commit e2c0b2e into main Nov 3, 2025
33 checks passed
@christian-bromann christian-bromann deleted the cb/state-fixes branch November 3, 2025 22:00
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