Repository navigation
Python: Honor proxy environment variables in connector-owned TypeSafe clients - #8984
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 4 commits intoOct 6, 2026
Conversation
Zakaria Khchiche (Zakariakhchiche)
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 2, 2026 17:57
Zakaria Khchiche (Zakariakhchiche)
temporarily deployed
to
github-app-auth
October 2, 2026 17:57 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
This PR updates the Python TypeSafe connector so connector-owned SDK clients honor standard proxy environment variables by no longer replacing the SDK’s default HTTP transport.
Changes:
- Removed the custom
_ApiKeyTransportso the TypeSafe SDK owns the transport and proxy env vars (HTTP[S]_PROXY,NO_PROXY, etc.) apply. - Updated tests to inject
MockTransportvia the SDK’s publictransportparameter and added a new proxy-honoring test. - Updated
AGENTS.mdto reflect the new transport/authorization behavior.
| File | Description |
|---|---|
| python/packages/typesafe/agent_framework_typesafe/_chat_client.py | Removes custom transport so SDK transport is used (enables proxy env support). |
| python/packages/typesafe/tests/typesafe/test_chat_client.py | Adjusts existing auth-header test and adds a new proxy env var test. |
| python/packages/typesafe/AGENTS.md | Documents that connector-owned clients rely on SDK transport + SDK-sent bearer header. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Zakaria Khchiche (Zakariakhchiche)
temporarily deployed
to
github-app-auth
October 2, 2026 18:49 — with
GitHub Actions
Inactive
Copilot stopped reviewing on behalf of
Zakaria Khchiche (Zakariakhchiche) due to an error
October 2, 2026 18:50
Zakaria Khchiche (Zakariakhchiche)
temporarily deployed
to
github-app-auth
October 3, 2026 07:20 — with
GitHub Actions
Inactive
Contributor
Author
|
Addressed both automated review notes in 1471efa:
The package tests (85), ruff and |
Eduard van Valkenburg (eavanvalkenburg)
approved these changes
Oct 6, 2026
This branch was previously 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
When the TypeSafe connector creates its own
AsyncTypeSafeClient, it passes a custom_ApiKeyTransport. httpx2 readsHTTPS_PROXY,HTTP_PROXY,ALL_PROXYandNO_PROXYonly when no custom transport is given, so these settings are ignored and the connector cannot reach TypeSafe from behind a proxy. The SDK on its own works in the same environment.The transport only sets
Authorization: Bearer <api_key>, which typesafe-sdk 0.7.1 and 0.7.2 already send. The SDK redacts that header in log records and exception messages, not on the wire.Description & Review Guide
_ApiKeyTransportfrom_chat_client.py. The SDK builds its default transport and sends the bearer header itself.AGENTS.mdnote: connector-owned clients rely on the SDK for theBearerheader and keep its transport, so proxy settings apply. Transport-level tests still verify the outgoing header.test_owned_client_sends_configured_api_key_on_wirenow injects aMockTransportthrough the SDK's publictransportparameter and still assertsBearer configured-api-key. Newtest_owned_client_honors_proxy_environmentsetsHTTP_PROXYto a local proxy and checks that the request and itsAuthorizationheader go through it. Both tests fail onmain.AsyncTypeSafeClient. TheAuthorizationheader on the wire is unchanged. Injected SDK clients are not affected.httpx2stays a declared dependency because the tests import it directly.Related Issue
Fixes #8983
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.