Obtaining stream failure from AI Agent
Hi all,
I'm building using the AI Agent Component and part of what I want to do is show the user the reason for a stream failure. I can see that when I go to the
agent
component, there's a streamingMessages
table that contains the state which (when aborted) contains an object like this:
I'd like for an API to exist for me to be able to query this status, but I'm not sure how I'd go about doing this as there's no documentation and I can't find a method that extracts this state. Any help is greatly appreciated.6 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!

Hey Fabio - btw there's an #agents
You can fetch more message statues in the
syncStreams
call. You can also call listStreams
that you can import from the library https://github.com/get-convex/agent/blob/ai-sdk-v5/src/client/streaming.ts#L94GitHub
agent/src/client/streaming.ts at ai-sdk-v5 · get-convex/agent
Build AI agents on Convex with persistent chat history - get-convex/agent
I also want to persist stream errors as full-on failed messages in the regular thread so this isn't necessary - but that is work in progress
Oh my bad there
Ohhh, well thank you very much. I'll implement this soon