Repository navigation
Python: Report the injected Mistral SDK client's endpoint in service_url - #9968
Mehedi Hasan (Mahdi-Hasan) wants to merge 11 commits into
Conversation
Mistral chat and embedding clients kept MISTRAL_SERVER_URL (or an explicit server_url) in self.server_url when an SDK client was injected. Requests still went to the injected client's endpoint, so service_url() and the telemetry metadata reported the wrong server. An injected mistralai.client.Mistral now always defines server_url. Fixes microsoft#9965 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Active moderate issues remain because injected SDK clients still load API key and server URL settings from ambient configuration, and the related documentation does not clearly distinguish SDK-client behavior from the deprecated HTTP-client path.
4 open issues
Review effort: Lite
server_url is only ignored when a Mistral SDK client is injected. The deprecated httpx.AsyncClient path via `client` still uses it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An injected SDK client owns its credentials and endpoint, so the chat and embedding clients no longer resolve MISTRAL_API_KEY or MISTRAL_SERVER_URL for it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…om/Mahdi-Hasan/agent-framework into fix/9965-mistral-injected-endpoint
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain; the endpoint precedence and model-only settings behavior are covered by the added chat and embedding tests, with only non-blocking documentation and typing nits noted.
3 resolved since last review
Review effort: Lite
|
Mehedi Hasan (@Mahdi-Hasan) The extra |
Drop MistralChatModelSettings and MistralEmbeddingModelSettings. The injected path loads MistralSettings / MistralEmbeddingSettings with relaxed required fields and ignores the api_key and server_url values, as requested in review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Eduard van Valkenburg (@eavanvalkenburg) Thanks, done in 2152a92.
|
There was a problem hiding this comment.
🔵 Needs a closer look
The injected-SDK paths still validate credential and server settings that are ignored afterward, allowing invalid overrides to break construction; both clients need model-only schema resolution and regression coverage.
No open issues 🎉
1 resolved since last review
Review effort: Lite
|
Eduard van Valkenburg (@eavanvalkenburg) The
I can't re-run the job from a fork. Could you re-run it when you review? |


Motivation & Context
When a
mistralai.client.Mistralis injected,RawMistralChatClient,MistralChatClientandMistralEmbeddingClientstill keepMISTRAL_SERVER_URL(or an explicitserver_url=) inself.server_url. Requests go to the injected client's endpoint, butservice_url()and telemetry report the other URL.Description & Review Guide
server_urlnow always comes fromclient.sdk_configuration.get_server_details()[0].server_urlis ignored whenclientis provided.http_clientpaths keep their existing precedence. Model resolution is unchanged.load_settingsreads every field of the TypedDict, and both fields are plain strings that can't fail parsing. So I kept oneload_settingscall and stopped using those values, rather than adding a second settings type.Related Issue
Fixes #9965
AI Assistance
AI assistance details: implementation, tests, and this description. The issue's repro was re-run against a real
MistralSDK client before and after the change.Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.🤖 Generated with Claude Code