Thread

TK
Tigran Kostandyan5:06 PMOpen in Slack
While working on error processing in web chat I noticed we started showing duplicate error cards – it wasn't like this a few days ago. Traced it to the AI SDK invoking onError twice after we added persistence inside that callback. Proposed fix here: https://github.com/archestra-ai/archestra/pull/4047
👀1

3 replies
J(
joey (archestra team)5:22 PMOpen in Slack
hey! the bug and proposed fix make sense on the surface, I'm curious why onError would be getting fired twice in the first place. I see in your comment:
toUIMessageStream invokes onError twice for the same upstream
// error (once when formatting the error chunk's errorText, once
// as a notification when the chunk is walked downstream)
are there any vercel docs references to support that?
TK
Tigran Kostandyan5:52 PMOpen in Slack
@user I'll move discussion to PR, but honestly this just comes from an empirical evidence 🙂 I just debug-logged it.
:archestra-love:1
TK
Tigran Kostandyan6:25 PMOpen in Slack
I replied to you in the thread