[Agent Builder] Add new property to public events contract to filter events by conversation id#268440
Merged
chrisbmar merged 4 commits intoMay 11, 2026
Conversation
pgayvallet
approved these changes
May 11, 2026
Contributor
pgayvallet
left a comment
There was a problem hiding this comment.
LGTM, just 2 comments
Comment on lines
+109
to
+112
| // Every Agent Builder UI caller passes a client-generated UUID before chat fires. | ||
| // The fallback to `''` is defensive only - events with that tag won't reach any | ||
| // per-conversation subscriber but still flow through the deprecated `obs$` stream. | ||
| const conversationId = payload.conversation_id ?? ''; |
Contributor
There was a problem hiding this comment.
If we always pass an id when calling that API now, can we fix the type instead of doing this defaulting to empty string?
the payload: ChatRequestBodyPayload second param
would become (but please not inlined)
payload: ChatRequestBodyPayload & { conversation_id: string } // conversation_id is required here
Contributor
Author
There was a problem hiding this comment.
great feedback, much better way of handling it - 84556c6
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
Unreferenced deprecated APIs
History
cc @chrisbmar |
clintandrewhall
pushed a commit
that referenced
this pull request
May 12, 2026
…events by conversation id (#268440)
mbondyra
added a commit
that referenced
this pull request
May 12, 2026
…tion (#268766) ## Summary Rewrite after merging #268440 Migrates Dashboard Agent off the deprecated shared `agentBuilder.events.chat$` stream and onto the new per-conversation `agentBuilder.events.getChatEvents$(conversationId)` API. This prevents dashboard live updates from reacting to events emitted by other concurrent Agent Builder conversations and adjusts our code to the new api.
patrykkopycinski
pushed a commit
to patrykkopycinski/kibana
that referenced
this pull request
May 13, 2026
…events by conversation id (elastic#268440)
patrykkopycinski
pushed a commit
to patrykkopycinski/kibana
that referenced
this pull request
May 13, 2026
…tion (elastic#268766) ## Summary Rewrite after merging elastic#268440 Migrates Dashboard Agent off the deprecated shared `agentBuilder.events.chat$` stream and onto the new per-conversation `agentBuilder.events.getChatEvents$(conversationId)` API. This prevents dashboard live updates from reacting to events emitted by other concurrent Agent Builder conversations and adjusts our code to the new api.
jcger
pushed a commit
that referenced
this pull request
May 26, 2026
…tion (#268766) ## Summary Rewrite after merging #268440 Migrates Dashboard Agent off the deprecated shared `agentBuilder.events.chat$` stream and onto the new per-conversation `agentBuilder.events.getChatEvents$(conversationId)` API. This prevents dashboard live updates from reacting to events emitted by other concurrent Agent Builder conversations and adjusts our code to the new api.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
closes https://github.com/elastic/search-team/issues/14381
What changed
events.getChatEvents$(conversationId)to the public events contract — returns a hot observable scoped to one conversation.events.chat$(kept for backward compatibility) it interleaves events from every concurrent conversation and consumers can't reliably attribute them right now if there are multiple streams (low chance of this being the case, we haven't broadcasted the fact that concurrent streams are possible in the Agent Builder UI yet).conversationIdat propagation time;chat$strips the tag for shape-parity.Why
chat$became conflated - consumers (dashboard_agent, workflows_management) can no longer tell which conversation an event came from i_f there are multiple streams at the one time_.conversation_id, so consumers can't filter on the payload alone.getChatEvents$(id)gives them clean per-conversation scoping without a breaking change. Migration is one-line per call site (recommendations in the contract docstring +CONTRIBUTOR_GUIDE.md).Logs
