fix: persist API @agent chats into thread history - #6125
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Scope & behavior of this changeThis only impacts developer API ( What it changes: where saved agent rows become loadable. The frontend and API have no special agent logic — they just query chats by the
Before this fix, all four combinations saved agent turns in a shape ( Note: One user-visible nuance (single-user mode only): sessionless workspace-level API agent chats go from invisible to appearing in the desktop UI's main workspace chat — same as normal API chats have always done, so this is alignment, but it is a visible change. In multi-user mode this cannot occur: the UI loads workspace history per-user ( |
|
Thanks @timothycarambat — that table matches the intent. The only user-visible change is the single-user, sessionless workspace-level API |
Summary
chatSyncsaved@agentreplies withinclude: falseand withoutthreadId/user, so they never appeared in API thread history. Streaming already persisted correctly.streamChat:include: true, passthreadIdanduser.WorkspaceChats.newpayload.Fixes #5060
Test plan
POST /api/v1/workspace/:slug/thread/:threadSlug/chatwith@agent ...thenGETthread chats — the turn is present@agentchats still persist as beforeMade with Cursor