-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Chats do not reload when given a a previous threadId.
Details/Repro
This repo uses[the new AG-UI interface,
| from ag_ui_langgraph import add_langgraph_fastapi_endpoint |
However, it does not support thread history.
Try here:
with-langgraph-fastapi/src/app/page.tsx
Line 26 in 2170f41
| <CopilotSidebar |
Either use the setThreadId frrom const { threadId: copilotKitThreadId, setThreadId: copilotKitSetThreadId } = useCopilotContext();
or just run a chat, put <h1> threadId {threadId} </h1> in the code from the hook above, and force the threadId on the chat component without restarting the fastAPI server.
const earlierThreadId = "<UUID copied from chat here>";
...
<CopilotSidebar threadId={earlierThreadId } ...
Suggestion / feature request: include showing history works as a standard thing in your demos
Since thread history comes up as a problem so often, and it is essential for pretty much any product use of these components, please add a simple component to show that it does work in new demos. Make it collapsible if you like, but something to show history works.
All it needs to do is allow restarting a new chat + keeping track of the thread IDs it has seen so far, and reloading them from the back end. That would be enough to demo that it works. E.g. a prettier version of my hack of your demo where I tried to force in thread IDs via the react hooks and the chat component props--it just remembered the threadIds it had seen, and allowed randomly generating new UUIDs like CopilotKit internals do for a new fresh chat.
