feat(chat): add request options to agent requests#7088
Merged
Conversation
Up to standards ✅🟢 Issues
|
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: |
09e2ac8 to
05cbadf
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for passing persistent request options (query parameters + headers) to the built-in Agent Studio (agentId) chat completion requests, while keeping custom transport/custom chat paths out of scope and ensuring regenerate continues to bypass cache.
Changes:
- Introduces
requestOptionstyping restricted to the built-inagentIdtransport path (rejects with customtransportor customchat). - Builds Agent Studio completion URLs with persistent query parameters and enforces
compatibilityMode=ai-sdk-5(andcache=falseon regenerate). - Merges persistent headers into agent requests while preserving required Algolia identity headers.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
packages/instantsearch.js/src/connectors/chat/connectChat.ts |
Adds requestOptions types and applies persistent query parameters/headers to built-in agent requests. |
packages/instantsearch.js/src/connectors/chat/__tests__/connectChat-test.ts |
Adds type-level and runtime tests for requestOptions behavior (query params, headers, precedence, regenerate cache). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fc8bd2b to
c358af9
Compare
Haroenv
reviewed
Jun 24, 2026
Haroenv
left a comment
Contributor
There was a problem hiding this comment.
great job! I think it can be simplified a bit
Haroenv
reviewed
Jun 25, 2026
Haroenv
approved these changes
Jun 25, 2026
Haroenv
left a comment
Contributor
There was a problem hiding this comment.
LGTM! merge when you're ready :)
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
FX-3833
Adds
requestOptionsfor built-inagentIdchat requests so consumers can pass persistent query parameters and headers to Agent Studio completion requests.This is scoped to the built-in Agent Studio path only:
queryParametersheadersrequestOptionswith customtransportor customchatRegenerate still forces
cache=false.Documentation
FX-3833 also includes a documentation update. The documentation source lives in
algolia/docs-new, so this InstantSearch PR keeps the implementation scoped and the docs-new follow-up should verify/update the generated chat widget API docs forrequestOptions.Test plan
Headerscache=falseyarn jest packages/instantsearch.js/src/connectors/chat/__tests__/connectChat-test.ts --runInBandgit diff --checkyarn lint:changed