Skip to content

perf: use global httpx client instead of per request create new one#34311

Merged
fatelei merged 2 commits intolanggenius:mainfrom
fatelei:issue-34309
Apr 1, 2026
Merged

perf: use global httpx client instead of per request create new one#34311
fatelei merged 2 commits intolanggenius:mainfrom
fatelei:issue-34309

Conversation

@fatelei
Copy link
Copy Markdown
Contributor

@fatelei fatelei commented Mar 31, 2026

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

fix #34309

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint and make type-check (backend) and cd web && npx lint-staged (frontend) to appease the lint gods

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

No changes detected.

@fatelei fatelei requested review from QuantumGhost and removed request for Mairuis, Stream29 and Yeuoly March 31, 2026 02:18
@fatelei fatelei requested a review from laipz8200 as a code owner March 31, 2026 02:34
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-31 02:35:13.613285762 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-31 02:35:01.968255893 +0000
@@ -4446,15 +4446,15 @@
 ERROR Object of class `NoneType` has no attribute `node` [missing-attribute]
     --> tests/unit_tests/core/plugin/test_plugin_manager.py:1030:16
 ERROR `in` is not supported between `Literal['Rate limit exceeded']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:360:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:374:20
 ERROR `in` is not supported between `Literal['Invalid credentials']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:379:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:393:20
 ERROR `in` is not supported between `Literal['Invalid parameters']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:398:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:412:20
 ERROR `in` is not supported between `Literal['Connection to external service failed']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:417:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:431:20
 ERROR `in` is not supported between `Literal['Service temporarily unavailable']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:436:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:450:20
 ERROR Argument `list[SystemPromptMessage | UserPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]
   --> tests/unit_tests/core/prompt/test_agent_history_prompt_transform.py:59:25
 ERROR Argument `list[AssistantPromptMessage | SystemPromptMessage | ToolPromptMessage | UserPromptMessage]` is not assignable to parameter `history_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]

Copy link
Copy Markdown
Contributor

@QuantumGhost QuantumGhost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other changes LGTM

Comment thread api/core/plugin/impl/base.py Outdated
@fatelei fatelei force-pushed the issue-34309 branch 2 times, most recently from 0005405 to 13ef5ca Compare March 31, 2026 03:10
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-31 03:10:33.896635565 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-31 03:10:22.916483574 +0000
@@ -4446,15 +4446,15 @@
 ERROR Object of class `NoneType` has no attribute `node` [missing-attribute]
     --> tests/unit_tests/core/plugin/test_plugin_manager.py:1030:16
 ERROR `in` is not supported between `Literal['Rate limit exceeded']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:360:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:374:20
 ERROR `in` is not supported between `Literal['Invalid credentials']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:379:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:393:20
 ERROR `in` is not supported between `Literal['Invalid parameters']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:398:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:412:20
 ERROR `in` is not supported between `Literal['Connection to external service failed']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:417:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:431:20
 ERROR `in` is not supported between `Literal['Service temporarily unavailable']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:436:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:450:20
 ERROR Argument `list[SystemPromptMessage | UserPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]
   --> tests/unit_tests/core/prompt/test_agent_history_prompt_transform.py:59:25
 ERROR Argument `list[AssistantPromptMessage | SystemPromptMessage | ToolPromptMessage | UserPromptMessage]` is not assignable to parameter `history_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-31 03:11:40.711321051 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-31 03:11:29.118312481 +0000
@@ -4446,15 +4446,15 @@
 ERROR Object of class `NoneType` has no attribute `node` [missing-attribute]
     --> tests/unit_tests/core/plugin/test_plugin_manager.py:1030:16
 ERROR `in` is not supported between `Literal['Rate limit exceeded']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:360:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:374:20
 ERROR `in` is not supported between `Literal['Invalid credentials']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:379:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:393:20
 ERROR `in` is not supported between `Literal['Invalid parameters']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:398:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:412:20
 ERROR `in` is not supported between `Literal['Connection to external service failed']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:417:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:431:20
 ERROR `in` is not supported between `Literal['Service temporarily unavailable']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:436:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:450:20
 ERROR Argument `list[SystemPromptMessage | UserPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]
   --> tests/unit_tests/core/prompt/test_agent_history_prompt_transform.py:59:25
 ERROR Argument `list[AssistantPromptMessage | SystemPromptMessage | ToolPromptMessage | UserPromptMessage]` is not assignable to parameter `history_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-31 03:13:47.534782712 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-31 03:13:36.889830462 +0000
@@ -4446,15 +4446,15 @@
 ERROR Object of class `NoneType` has no attribute `node` [missing-attribute]
     --> tests/unit_tests/core/plugin/test_plugin_manager.py:1030:16
 ERROR `in` is not supported between `Literal['Rate limit exceeded']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:360:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:374:20
 ERROR `in` is not supported between `Literal['Invalid credentials']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:379:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:393:20
 ERROR `in` is not supported between `Literal['Invalid parameters']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:398:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:412:20
 ERROR `in` is not supported between `Literal['Connection to external service failed']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:417:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:431:20
 ERROR `in` is not supported between `Literal['Service temporarily unavailable']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:436:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:450:20
 ERROR Argument `list[SystemPromptMessage | UserPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]
   --> tests/unit_tests/core/prompt/test_agent_history_prompt_transform.py:59:25
 ERROR Argument `list[AssistantPromptMessage | SystemPromptMessage | ToolPromptMessage | UserPromptMessage]` is not assignable to parameter `history_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]

@fatelei fatelei requested review from hj24 and zyssyz123 as code owners March 31, 2026 03:53
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-31 03:54:22.150911655 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-31 03:54:11.769933965 +0000
@@ -4446,15 +4446,15 @@
 ERROR Object of class `NoneType` has no attribute `node` [missing-attribute]
     --> tests/unit_tests/core/plugin/test_plugin_manager.py:1030:16
 ERROR `in` is not supported between `Literal['Rate limit exceeded']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:360:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:374:20
 ERROR `in` is not supported between `Literal['Invalid credentials']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:379:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:393:20
 ERROR `in` is not supported between `Literal['Invalid parameters']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:398:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:412:20
 ERROR `in` is not supported between `Literal['Connection to external service failed']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:417:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:431:20
 ERROR `in` is not supported between `Literal['Service temporarily unavailable']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:436:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:450:20
 ERROR Argument `list[SystemPromptMessage | UserPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]
   --> tests/unit_tests/core/prompt/test_agent_history_prompt_transform.py:59:25
 ERROR Argument `list[AssistantPromptMessage | SystemPromptMessage | ToolPromptMessage | UserPromptMessage]` is not assignable to parameter `history_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-31 03:56:20.807209710 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-31 03:56:10.206105713 +0000
@@ -4446,15 +4446,15 @@
 ERROR Object of class `NoneType` has no attribute `node` [missing-attribute]
     --> tests/unit_tests/core/plugin/test_plugin_manager.py:1030:16
 ERROR `in` is not supported between `Literal['Rate limit exceeded']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:360:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:374:20
 ERROR `in` is not supported between `Literal['Invalid credentials']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:379:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:393:20
 ERROR `in` is not supported between `Literal['Invalid parameters']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:398:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:412:20
 ERROR `in` is not supported between `Literal['Connection to external service failed']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:417:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:431:20
 ERROR `in` is not supported between `Literal['Service temporarily unavailable']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:436:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:450:20
 ERROR Argument `list[SystemPromptMessage | UserPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]
   --> tests/unit_tests/core/prompt/test_agent_history_prompt_transform.py:59:25
 ERROR Argument `list[AssistantPromptMessage | SystemPromptMessage | ToolPromptMessage | UserPromptMessage]` is not assignable to parameter `history_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-31 04:24:37.869009296 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-31 04:24:27.432093708 +0000
@@ -4446,15 +4446,15 @@
 ERROR Object of class `NoneType` has no attribute `node` [missing-attribute]
     --> tests/unit_tests/core/plugin/test_plugin_manager.py:1030:16
 ERROR `in` is not supported between `Literal['Rate limit exceeded']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:360:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:374:20
 ERROR `in` is not supported between `Literal['Invalid credentials']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:379:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:393:20
 ERROR `in` is not supported between `Literal['Invalid parameters']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:398:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:412:20
 ERROR `in` is not supported between `Literal['Connection to external service failed']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:417:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:431:20
 ERROR `in` is not supported between `Literal['Service temporarily unavailable']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:436:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:450:20
 ERROR Argument `list[SystemPromptMessage | UserPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]
   --> tests/unit_tests/core/prompt/test_agent_history_prompt_transform.py:59:25
 ERROR Argument `list[AssistantPromptMessage | SystemPromptMessage | ToolPromptMessage | UserPromptMessage]` is not assignable to parameter `history_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-31 04:26:33.611369398 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-31 04:26:23.412411475 +0000
@@ -4446,15 +4446,15 @@
 ERROR Object of class `NoneType` has no attribute `node` [missing-attribute]
     --> tests/unit_tests/core/plugin/test_plugin_manager.py:1030:16
 ERROR `in` is not supported between `Literal['Rate limit exceeded']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:360:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:374:20
 ERROR `in` is not supported between `Literal['Invalid credentials']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:379:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:393:20
 ERROR `in` is not supported between `Literal['Invalid parameters']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:398:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:412:20
 ERROR `in` is not supported between `Literal['Connection to external service failed']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:417:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:431:20
 ERROR `in` is not supported between `Literal['Service temporarily unavailable']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:436:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:450:20
 ERROR Argument `list[SystemPromptMessage | UserPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]
   --> tests/unit_tests/core/prompt/test_agent_history_prompt_transform.py:59:25
 ERROR Argument `list[AssistantPromptMessage | SystemPromptMessage | ToolPromptMessage | UserPromptMessage]` is not assignable to parameter `history_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-31 05:58:13.982104721 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-31 05:58:03.164975809 +0000
@@ -270,9 +270,9 @@
 ERROR `None` is not subscriptable [unsupported-operation]
    --> core/rag/datasource/vdb/tidb_on_qdrant/tidb_on_qdrant_vector.py:452:38
 ERROR `None` is not subscriptable [unsupported-operation]
-  --> core/rag/datasource/vdb/tidb_on_qdrant/tidb_service.py:62:20
+  --> core/rag/datasource/vdb/tidb_on_qdrant/tidb_service.py:71:20
 ERROR `None` is not subscriptable [unsupported-operation]
-  --> core/rag/datasource/vdb/tidb_on_qdrant/tidb_service.py:63:35
+  --> core/rag/datasource/vdb/tidb_on_qdrant/tidb_service.py:72:35
 ERROR Class member `UpstashVector.add_texts` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
   --> core/rag/datasource/vdb/upstash/upstash_vector.py:47:9
 ERROR Class member `VikingDBVector.add_texts` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
@@ -3902,7 +3902,7 @@
 ERROR Object of class `NoneType` has no attribute `storage_key` [missing-attribute]
    --> tests/unit_tests/core/datasource/test_datasource_manager.py:663:12
 ERROR `in` is not supported between `Literal['Single Page']` and `None` [not-iterable]
-   --> tests/unit_tests/core/datasource/test_website_crawl.py:989:16
+   --> tests/unit_tests/core/datasource/test_website_crawl.py:992:16
 ERROR Argument `Iterator[DatasourceMessage]` is not assignable to parameter `messages` with type `Generator[DatasourceMessage]` in function `core.datasource.utils.message_transformer.DatasourceFileMessageTransformer.transform_datasource_invoke_messages` [bad-argument-type]
   --> tests/unit_tests/core/datasource/utils/test_message_transformer.py:27:26
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -4446,15 +4446,15 @@
 ERROR Object of class `NoneType` has no attribute `node` [missing-attribute]
     --> tests/unit_tests/core/plugin/test_plugin_manager.py:1030:16
 ERROR `in` is not supported between `Literal['Rate limit exceeded']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:360:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:374:20
 ERROR `in` is not supported between `Literal['Invalid credentials']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:379:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:393:20
 ERROR `in` is not supported between `Literal['Invalid parameters']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:398:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:412:20
 ERROR `in` is not supported between `Literal['Connection to external service failed']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:417:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:431:20
 ERROR `in` is not supported between `Literal['Service temporarily unavailable']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:436:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:450:20
 ERROR Argument `list[SystemPromptMessage | UserPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]
   --> tests/unit_tests/core/prompt/test_agent_history_prompt_transform.py:59:25
 ERROR Argument `list[AssistantPromptMessage | SystemPromptMessage | ToolPromptMessage | UserPromptMessage]` is not assignable to parameter `history_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]

@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-03-31 06:00:21.794475239 +0000
+++ /tmp/pyrefly_pr.txt	2026-03-31 06:00:09.928435695 +0000
@@ -270,9 +270,9 @@
 ERROR `None` is not subscriptable [unsupported-operation]
    --> core/rag/datasource/vdb/tidb_on_qdrant/tidb_on_qdrant_vector.py:452:38
 ERROR `None` is not subscriptable [unsupported-operation]
-  --> core/rag/datasource/vdb/tidb_on_qdrant/tidb_service.py:62:20
+  --> core/rag/datasource/vdb/tidb_on_qdrant/tidb_service.py:71:20
 ERROR `None` is not subscriptable [unsupported-operation]
-  --> core/rag/datasource/vdb/tidb_on_qdrant/tidb_service.py:63:35
+  --> core/rag/datasource/vdb/tidb_on_qdrant/tidb_service.py:72:35
 ERROR Class member `UpstashVector.add_texts` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
   --> core/rag/datasource/vdb/upstash/upstash_vector.py:47:9
 ERROR Class member `VikingDBVector.add_texts` overrides parent class `BaseVector` in an inconsistent manner [bad-override]
@@ -3902,7 +3902,7 @@
 ERROR Object of class `NoneType` has no attribute `storage_key` [missing-attribute]
    --> tests/unit_tests/core/datasource/test_datasource_manager.py:663:12
 ERROR `in` is not supported between `Literal['Single Page']` and `None` [not-iterable]
-   --> tests/unit_tests/core/datasource/test_website_crawl.py:989:16
+   --> tests/unit_tests/core/datasource/test_website_crawl.py:992:16
 ERROR Argument `Iterator[DatasourceMessage]` is not assignable to parameter `messages` with type `Generator[DatasourceMessage]` in function `core.datasource.utils.message_transformer.DatasourceFileMessageTransformer.transform_datasource_invoke_messages` [bad-argument-type]
   --> tests/unit_tests/core/datasource/utils/test_message_transformer.py:27:26
 ERROR Object of class `BlobChunkMessage` has no attribute `text`
@@ -4446,15 +4446,15 @@
 ERROR Object of class `NoneType` has no attribute `node` [missing-attribute]
     --> tests/unit_tests/core/plugin/test_plugin_manager.py:1030:16
 ERROR `in` is not supported between `Literal['Rate limit exceeded']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:360:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:374:20
 ERROR `in` is not supported between `Literal['Invalid credentials']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:379:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:393:20
 ERROR `in` is not supported between `Literal['Invalid parameters']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:398:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:412:20
 ERROR `in` is not supported between `Literal['Connection to external service failed']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:417:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:431:20
 ERROR `in` is not supported between `Literal['Service temporarily unavailable']` and `None` [not-iterable]
-   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:436:20
+   --> tests/unit_tests/core/plugin/test_plugin_runtime.py:450:20
 ERROR Argument `list[SystemPromptMessage | UserPromptMessage]` is not assignable to parameter `prompt_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]
   --> tests/unit_tests/core/prompt/test_agent_history_prompt_transform.py:59:25
 ERROR Argument `list[AssistantPromptMessage | SystemPromptMessage | ToolPromptMessage | UserPromptMessage]` is not assignable to parameter `history_messages` with type `list[PromptMessage]` in function `core.prompt.agent_history_prompt_transform.AgentHistoryPromptTransform.__init__` [bad-argument-type]

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 1, 2026
@fatelei fatelei added this pull request to the merge queue Apr 1, 2026
Merged via the queue into langgenius:main with commit 57f358a Apr 1, 2026
27 checks passed
@fatelei fatelei deleted the issue-34309 branch April 1, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

use global httpx client instead per request create a new one

2 participants