Conversation
|
✅ Preview binaries are ready! To test with modules: |
x/acpio/acp_conversation.go
Outdated
| Id: len(c.messages), | ||
| Role: st.ConversationRoleUser, | ||
| Message: message, | ||
| Time: c.clock.Now(), | ||
| }) | ||
| // Add placeholder for streaming agent response | ||
| c.messages = append(c.messages, st.ConversationMessage{ | ||
| Id: len(c.messages), |
There was a problem hiding this comment.
As we have logic for removing placeholder messages I'd like to confirm something: Do we ever return placeholders messages to the user? If we do we might end up re-using an ID and that could be a little funky.
There was a problem hiding this comment.
IIRC it's used in the UI on initial send.
There was a problem hiding this comment.
Okay, if so, we should probably not re-use the ID within a conversation. Our react frontend will likely key={message.id} and this could cause some funky behavior.
There was a problem hiding this comment.
What if we instead mutate the placeholder message content?
The alternative is that we have a gap in the monotonically increasing message IDs, which may not be an issue?
There was a problem hiding this comment.
I can't think of any issues with having a gap (we probably shouldn't use IDs for indexing anyways)
Relates to coder/internal#1333
Adds
/x/acpiopackage🤖 Written by Opus 4.5 using Mux