feat(chat): identify component and referer in agent requests#7002
Open
afrencalg wants to merge 5 commits into
Open
feat(chat): identify component and referer in agent requests#7002afrencalg wants to merge 5 commits into
afrencalg wants to merge 5 commits into
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 19 |
TIP This summary will be updated as you push new changes.
More templates
algoliasearch-helper
instantsearch-ui-components
instantsearch.css
instantsearch.js
react-instantsearch
react-instantsearch-core
react-instantsearch-nextjs
react-instantsearch-router-nextjs
vue-instantsearch
commit: |
FabienMotte
reviewed
Apr 29, 2026
Haroenv
reviewed
Apr 29, 2026
Contributor
Haroenv
left a comment
There was a problem hiding this comment.
looks good. Can you also check with Agent Studio team to ensure they will process these headers? cc @leonardocuco
FabienMotte
approved these changes
Apr 30, 2026
Haroenv
approved these changes
May 11, 2026
Haroenv
reviewed
May 11, 2026
Haroenv
reviewed
May 13, 2026
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
Send
x-algolia-component: ais-chaton every chat completions request, and forward analgolia-refererheader (prompt-suggestionsorai-mode) when the message originates from the autocomplete prompt suggestions or the autocomplete/search-box AI Mode button. This lets the agent attribute traffic without parsing the user agent.Also clean up the request body: previously every parameter received by
prepareSendMessagesRequest(headers,api,body,credentials,requestMetadata, …) was spread back into the body, duplicating values already sent in the headers and HTTP metadata. The body now contains only{ id, messageId, messages }for the agent path, and the equivalent minimal payload for the default custom-transport path.