Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR migrates HTTP client library usage from requests to httpx across the entire Dify codebase. This modernizes the HTTP client stack and takes advantage of httpx's async capabilities and better timeout handling.
Key changes include:
- Replace
requestswithhttpxfor all HTTP operations - Update timeout configurations to use
httpx.Timeoutobjects - Modify authentication imports to use httpx equivalents
- Update OpenTelemetry instrumentation from requests to httpx
Reviewed Changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| api/pyproject.toml | Updates dependencies to replace requests-related packages with httpx |
| api/pyrightconfig.json | Updates OpenTelemetry instrumentation from requests to httpx |
| api/extensions/ext_otel.py | Switches OpenTelemetry instrumentation from RequestsInstrumentor to HTTPXClientInstrumentor |
| api/services/*/remote_retrieval.py | Replaces requests.get with httpx.get and updates timeout syntax |
| api/services/enterprise/base.py | Major refactor to use httpx.Client with proper mount handling for proxies |
| api/core/tools/utils/parser.py | Updates HTTP GET request and adds proper response cleanup |
| api/core/rag/extractor/*.py | Migrates various extractors from requests to httpx with proper resource management |
| api/core/rag/datasource/vdb//.py | Updates vector database clients to use httpx and handle connection errors |
| api/core/plugin/impl/base.py | Comprehensive refactor of plugin daemon client to use httpx with streaming support |
| api/core/extension/api_based_extension_requestor.py | Converts extension requestor to use httpx.Client with proper proxy handling |
| api/tests/unit_tests//test_.py | Updates test mocks from requests to httpx |
| api/tests/integration_tests/vdb/__mock/*.py | Removes requests.adapters imports and updates type hints |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
3b31c7c to
272cb1b
Compare
272cb1b to
de54e8c
Compare
crazywoola
approved these changes
Oct 10, 2025
Eric-Guo
added a commit
to Eric-Guo/dify
that referenced
this pull request
Oct 13, 2025
This reverts commit bb6a331.
Eric-Guo
added a commit
to Eric-Guo/dify
that referenced
this pull request
Oct 13, 2025
This reverts commit bb6a331.
Contributor
|
Codex Review comment:
|
Eric-Guo
added a commit
to Eric-Guo/dify
that referenced
this pull request
Oct 13, 2025
…egitimately takes longer than 5s would right. Otherwise, will be caught as a generic RequestError, and surface as PluginDaemonInnerError, fix langgenius#26119
5 tasks
Eric-Guo
added a commit
to Eric-Guo/dify
that referenced
this pull request
Oct 13, 2025
…egitimately takes longer than 5s would right. Otherwise, will be caught as a generic RequestError, and surface as PluginDaemonInnerError, fix langgenius#26119
Eric-Guo
added a commit
to Eric-Guo/dify
that referenced
this pull request
Oct 13, 2025
…egitimately takes longer than 5s would right. Otherwise, will be caught as a generic RequestError, and surface as PluginDaemonInnerError, fix langgenius#26119
Eric-Guo
added a commit
to Eric-Guo/dify
that referenced
this pull request
Oct 13, 2025
…egitimately takes longer than 5s would right. Otherwise, will be caught as a generic RequestError, and surface as PluginDaemonInnerError, fix langgenius#26119
Eric-Guo
added a commit
to Eric-Guo/dify
that referenced
this pull request
Oct 13, 2025
…egitimately takes longer than 5s would right. Otherwise, will be caught as a generic RequestError, and surface as PluginDaemonInnerError, fix langgenius#26119
Eric-Guo
added a commit
to Eric-Guo/dify
that referenced
this pull request
Oct 13, 2025
…egitimately takes longer than 5s would right. Otherwise, will be caught as a generic RequestError, and surface as PluginDaemonInnerError, fix langgenius#26119
LawrenceZHLee
pushed a commit
to LawrenceZHLee/dify
that referenced
this pull request
Oct 28, 2025
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: crazywoola <[email protected]>
6 tasks
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.
Important
Fixes #<issue number>.fix #24006
by codex
Summary
Screenshots
Checklist
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods