Fix memory store and recording#45658
Fix memory store and recording#45658howieleung wants to merge 7 commits intofeature/azure-ai-projects/2.0.1b1from
Conversation
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
|
@howieleung please target this PR directly to main, and set the version to 2.0.1, as we need to ship this is a hot fix. |
|
Also, I was thinking we need to ask CoPilot to create a test to verify that all public method on the ".beta" subclient have the correct "Foundry-Feature" HTTP request header. The test can hook up custom transport to get access to Request headers. It can make a dummy call (fake endpoint URL, random values for required input argument) and just test the resulting request. If we had that, we would have caught this bug. |
| lro_delay = request_kwargs.pop("polling_interval", self._config.polling_interval) | ||
| cont_token: Optional[str] = request_kwargs.pop("continuation_token", None) | ||
| if cont_token is None: | ||
| raw_result = await self._update_memories_initial( |
There was a problem hiding this comment.
Method _update_memories_initial already has this set internally:
_foundry_features: Literal[_FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW] = (
_FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW
)
So why do we need this above?
_headers["Foundry-Features"] = _FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW.value
There was a problem hiding this comment.
Because _update_memories_initial only applied header change for the first request. _header for polling was not changed.
.beta.memory_stores.begin_update_memories()in both synchronous and asynchronous clients to consistently send the requiredFoundry-Featurespreview header and propagate headers to LRO polling requests, without mutating caller-providedkwargsor header dictionaries.