useAgentThreadEvents() reads the paged event feed for one thread. It is the right hook for activity timelines, execution logs, and review surfaces that need the thread event stream but not the full conversation surface.
Usage
The following example shows a basic usage of useAgentThreadEvents().
The hook returns the following fields and methods.
›
events?: ThreadEvent[] | undefined;
Flattened event list for the current thread.
›
hasMore?: boolean | undefined;
Whether more event pages are available.
›
loadingMore?: boolean | undefined;
Whether the next event page is currently loading.
Overview
This hook is a read-only event feed. It keeps a paged, periodically refreshed list of thread events and flattens the pages for the caller, which is why it works well for event timelines and activity drawers.