langgoap.current_thread_id

langgoap.current_thread_id#

current_thread_id()[source]#

The thread_id of the graph run this code is executing in, or None.

Tracer hooks, actions, sensors and guards run inside a LangGraph node, so the run’s config is in scope: a tracer shared by many threads can attribute each event without the application setting state on it before every invocation (issue #96).

Returns None outside a run, when the run has no thread_id, and on the async path under Python 3.10, where LangGraph cannot propagate the run’s context.

Return type:

str | None