Skip to content

Conversation

@christian-bromann
Copy link
Member

We received the following feedback from @casparb

There should be mention in the middleware docs of which middleware you can and cannot raise interrupts in. E.g. I've seen a few cases where people reading the docs think it makes sense to raise an interrupt in @wrap_tool_call to validate a tool message before it's sent to the model. But you can't raise an interrupt here, because on resume you'd re-execute ToolNode.
Maybe more generally HITL middleware should be expanded to have an interrupt_after param. I don't really know what the alternative to this looks like? look at the last message in the messages list and inspect the tool call name in a before_model middleware?

This patch adds a section speaking about how to use interrupts in middleware.

@github-actions github-actions bot added langchain For docs changes to LangChain oss labels Nov 10, 2025
@github-actions
Copy link
Contributor

Mintlify preview ID generated: preview-cbinte-1762814329-ae78f42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

langchain For docs changes to LangChain oss

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants