Repository navigation
Python: Add service_url to OpenAIChatClient - #9225
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit intoOct 9, 2026
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
Conversation
Return the underlying client's base URL from the Responses API client so chat telemetry reports a real server.address instead of Unknown, matching OpenAIChatCompletionClient and OpenAIEmbeddingClient.
Bicheng (Kenneth) (BichengWang)
requested review from
SergeyMenshykh,
Tao Chen (TaoChenOSU),
Eduard van Valkenburg (eavanvalkenburg),
Giles Odigwe (giles17),
Jose Alvarez (jpalvarezl),
Evan Mattson (moonbox3),
Roger Barreto (rogerbarreto),
sophia-ramsey and
westey (westey-m)
as code owners
October 8, 2026 20:17
Bicheng (Kenneth) (BichengWang)
deployed
to
github-app-auth
October 8, 2026 20:17 — with
GitHub Actions
Active
Bicheng (Kenneth) (BichengWang)
deployed
to
github-app-auth
October 8, 2026 20:17 — with
GitHub Actions
Active
Copilot started reviewing on behalf of
Bicheng (Kenneth) (BichengWang)
October 8, 2026 20:18
View session
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches existing OpenAI client patterns and is covered by a focused unit test.
0 open findings
What changed in this PR
Adds service URL reporting to OpenAI Responses API clients so telemetry spans contain the configured base URL.
Changes:
- Implements
RawOpenAIChatClient.service_url(). - Adds unit coverage for custom base URLs.
| File | Description |
|---|---|
python/packages/openai/agent_framework_openai/_chat_client.py |
Returns the underlying OpenAI client base URL. |
python/packages/openai/tests/openai/test_openai_chat_client.py |
Verifies URL normalization and reporting. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Contributor
Author
|
Hello members, is there any one can help additional review? Thank you! |
Eduard van Valkenburg (eavanvalkenburg)
approved these changes
Oct 9, 2026
Bicheng (Kenneth) (BichengWang)
deleted the
openai-responses-client-service-url
branch
October 9, 2026 17:57
This branch was successfully deployed
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.
Motivation & Context
RawOpenAIChatClient(the Responses API client) does not overrideBaseChatClient.service_url(), so chat spans reportserver.addressasUnknown.OpenAIChatCompletionClientandOpenAIEmbeddingClientalready implement it.Description & Review Guide
RawOpenAIChatClient.service_url()returnsstr(self.client.base_url), the same implementation asRawOpenAIChatCompletionClient. One unit test added.OpenAIChatClientnow carry the real base URL.FoundryChatClientand the Foundry agent chat client inherit from this class, so their spans will show the project's OpenAI base URL instead ofUnknown. Nothing else changes.Related Issue
Fixes #9224
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.