[HTTPXodus] Consider migrating from `httpx` to `httpx2` (the actively maintained fork)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
- #12596 của @SiAgentBuild — đã đóng, không merge
Đánh giá
Issue này chưa được đánh giá.
Mô tả
repo: deepset-ai/haystack
star_count: 26400
recon_date: 2026-09-04
status: draft-ready
Title: [HTTPXodus] Consider migrating from httpx to httpx2 (the actively maintained fork)
Body:

🏷️ This issue is part of HTTPXodus, a community effort to help major projects plan their path off the stalled
httpxstable line ontohttpx2, the actively maintained fork by Pydantic Services (with original httpx author Tom Christie involved). One coordinated issue per project — no spam, no drive-by PRs.
Background — what happened to httpx
httpx is one of the most important HTTP clients in the Python ecosystem (370k+ dependent repositories). However:
- The last stable release is 0.28.1 (December 2024) — over 20 months ago.
- For most of 2025 the repository was dormant; maintenance trackers (e.g. Snyk) now flag it as inactive.
- Encouragingly, the project has recently resumed activity:
1.0.dev4–dev6shipped between 2026-08-19 and 2026-08-31. A 1.0 is clearly in the works, but there is no committed date for a stable 1.0, and the dev line carries breaking changes.
Meanwhile, the ecosystem has already begun moving. Projects that have adopted httpx2:
| Project | Stars | Status |
|---|---|---|
| Starlette | 12.5k+ | ✅ Migrated |
| FastAPI | 102k+ | ✅ Dual support (httpx2 test dependency) |
| OpenAI Python SDK | 31.5k+ | ✅ Migrated |
| Anthropic Python SDK | 3.9k+ | ✅ Migrated in v1.0 |
| MCP Python SDK | 24k+ | ✅ Migrated in v2.0 |
What is httpx2
httpx2 is a fork of httpx 0.28.1 maintained by Pydantic Services Inc., with Tom Christie involved. It is actively released (v2.0.0 → v2.12.0 since May 2026) and keeps a compatible public API:
import httpx2
r = httpx2.get("https://example.org")
Why migrate — the benefits
- Active maintenance — regular releases, reviewed PRs, and a funded maintainer team, versus an uncertain stable-release timeline.
- Modern TLS by default — certificates are verified against the OS trust store instead of the bundled
certifi, removing a common source of stale-CA issues. - New capabilities — built-in Server-Sent Events (
client.sse()) and WebSocket support (httpx2[ws]), without extra dependencies. - Ecosystem alignment — as frameworks and SDKs migrate, staying on httpx increasingly means duplicate HTTP stacks in one dependency tree.
Risks of staying on httpx
- Security exposure: no stable-line releases means no stable-line security fixes. If a CVE lands in 0.28.x today, there is no maintained branch to patch it.
- Dependency conflicts: packages that pin
httpx<1.0already conflict with migrated peers; the longer the wait, the worse the resolver pain for downstream users. - Compounding migration cost: the gap between 0.28.x and whatever 1.0 becomes keeps growing; migrating to httpx2 now is a small, well-documented step (official migration guide: https://pydantic.dev/docs/httpx2/get-started/migration/).
What migration could look like here
Usage (from recon.py / source inspection):
haystack/utils/http_client.py:import httpx; definesinit_http_client()returninghttpx.Client | httpx.AsyncClient | None; also referenceshttpx.Limits; exposesClient/AsyncClienttypes in overload signatures.pyproject.toml:"httpx"in core dependencies;"httpx[http2]"in test env (needed by link-content-fetcher tests).- Only one source file directly imports
httpx; downstream consumers mostly receive clients viainit_http_client.
Two viable paths, depending on your compatibility goals:
-
Option A — dual support (recommended for libraries): prefer httpx2 when available, fall back to httpx:
try: import httpx2 as httpx except ModuleNotFoundError: import httpxwith
httpx2; python_version >= "3.10"added as an optional/extra dependency (or alongsidehttpxin core deps for dual-run). -
Option B — hard switch (fine for applications / next major): replace the dependency outright. Requires Python ≥ 3.10 (already
requires-python >= 3.10).
⚠️ One caveat worth calling out: httpx2's move to the OS trust store can change behavior in containers and corporate-proxy environments that relied on certifi. Worth a note in your changelog either way.
Notes:
- Previous related PRs
#12336,#12348,#12332(closed) deal withopenai/numpypinning — not anhttpxmigration; no duplicatehttpx2migration issue exists for this repo. pyproject.tomlpins no upper bound onhttpx; withhttpx1.0 dev active, tightening or dual-importing now avoids future resolver conflicts.- Migration should update
pyproject.toml(corehttpx2optional + keephttpx) andhaystack/utils/http_client.py(dual import), and mirror any test refs that assert onhttpx.Clientinstances. - No PR will be opened by this campaign until maintainers confirm interest; happy to close if you'd rather wait for
httpx1.0 stable.
Happy to open a PR for either option if the maintainers are interested — and equally happy to close this if you'd rather wait for httpx 1.0 stable. No pressure; the goal is just to make sure the decision is an informed one. 🙏
Draft prepared by HTTPXodus campaign (author: xic; no AI co-signature). Issue not yet created on GitHub — awaiting human review per HTTPXodus charter (no drive-by PRs, issue first).
- Ngôn ngữ chính
- Python
- Star
- 27.2k
- Fork
- 3.5k
- Merge trung bình
- 1 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 254
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của deepset-ai/haystack
-
feat: `ByteStream.from_file_path` should keep the file path in `meta`Có thể đã có người làm @pinjun99 đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
deepset-ai/haystack#14081 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
BlockingConfirmationStrategy ignores an empty argument replacementCó thể đã có người làm @sjrl đã nhận 6 ngày trước. Đang mởP1
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
deepset-ai/haystack#13863 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CSVToDocument row mode fails on CR-separated CSV inputCó thể đã có người làm @julian-risch đã nhận 66 ngày trước. Đang mởP3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
deepset-ai/haystack#13022 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CSVToDocument row mode drops a real extra_columns field on ragged rowsCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởhandled internally P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
deepset-ai/haystack#12994 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CSVDocumentCleaner deletes a row that says N/A, and both CSV components empty those cellsCó thể đã có người làm @michaelkillgta đã nhận 72 ngày trước. Đang mởP3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
deepset-ai/haystack#12784 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của deepset-ai/haystack
Issue tương tự
-
Test: to_hijri() accepts datetime.datetime and uses only the date partCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởgood first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
omarelshamy25x/shamy-hijri#63 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
polish
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresCó thể đã có người làm @AshutoshSingh840 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
UKGovernmentBEIS/control-arena#992 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
mvalentsev/awesome-free-ai-coding#70 ·
Maintainer thường phản hồi trong vòng 1 ngày