Access of Metadata from Middlewares

Hi everyone :waving_hand:

First off — it’s awesome to see middleware introduced in LangGraph v1. We’ve started experimenting with it by building a small open-source package (pip install langmiddle) to explore its potential.

However, we’ve run into an issue:
:backhand_index_pointing_right: While we can access metadata from callbacks in ToolRuntime, it seems that the Runtime inside middleware doesn’t expose this information.

Has anyone found a way to access metadata (like thread_id, user_id, etc.) within middleware runtime?
Or could this possibly be considered for inclusion in a future release?

Any insights or workarounds would be greatly appreciated — we’d love to contribute back if there’s a viable pattern here.

1 Like

Great question, facing the same issue. Will love to hear about a working solution :ear: