Repository navigation
Python: Prevent keyword argument collision when model is passed in client_kwargs - #10258
Conversation
|
/review |
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: No findings
Scope: full PR (1 commit(s)): e2994df2c4ab
Model: gpt-5.6-sol
Overview
This PR copies client_kwargs into a telemetry-only mapping and then overlays the framework-resolved fields before calling _get_span_attributes, eliminating duplicate-keyword failures without mutating caller data. The original client_kwargs mapping is still forwarded unchanged to downstream clients, and the added regression test exercises both streaming and non-streaming responses while verifying the selected model attribute. No Critical, High, or Medium issue remains after reconciling the changed behavior against its callers, extraction logic, and tests.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.
Motivation & Context
Passing
modelor other telemetry-related fields throughclient_kwargscould cause aTypeErrorin_get_span_attributes. This happened becauseChatTelemetryLayer.get_responsepassed some arguments explicitly while also unpackingmerged_client_kwargs, resulting in duplicate keyword arguments.Description & Changes
merged_client_kwargswith the resolvedoperation_name,provider_name,model, andservice_urlbefore calling_get_span_attributes.test_observability.pyto cover both streaming and non-streaming responses.Closes #10194