fix: add bounded timeout to WaterCrawl auth credential validation#37538
Open
ifer47 wants to merge 2 commits into
Open
fix: add bounded timeout to WaterCrawl auth credential validation#37538ifer47 wants to merge 2 commits into
ifer47 wants to merge 2 commits into
Conversation
WatercrawlAuth._get_request used httpx.get without a timeout parameter, meaning credential validation could hang indefinitely on network issues. Add httpx.Timeout(10.0, connect=3.0) constant matching the pattern used across Dify and pass it to the GET request. Co-Authored-By: zhipu/glm-5 <zai-org@claude-code-best.win>
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-06-16 19:24:01.348619042 +0000
+++ /tmp/pyrefly_pr.txt 2026-06-16 19:23:47.080427017 +0000
@@ -2883,48 +2883,44 @@
--> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:652:52
ERROR `(**kwargs: Unknown) -> Literal['failed']` is not assignable to attribute `workflow_node_finish_to_stream_response` with type `(self: WorkflowResponseConverter, *, event: QueueNodeExceptionEvent | QueueNodeFailedEvent | QueueNodeSucceededEvent, task_id: str) -> NodeFinishStreamResponse | None` [bad-assignment]
--> tests/unit_tests/core/app/apps/advanced_chat/test_generate_task_pipeline_core.py:674:89
-ERROR Object of class `NoneType` has no attribute `prompt_messages` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:168:23
ERROR Object of class `NoneType` has no attribute `message` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:186:12
+ --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:176:12
ERROR Object of class `NoneType` has no attribute `model` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:187:12
+ --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:177:12
ERROR Object of class `NoneType` has no attribute `message` [missing-attribute]
--> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:65:12
-ERROR Object of class `NoneType` has no attribute `prompt_messages` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:70:23
ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AgentAppGenerateEntity` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_input_guards` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:82:41
+ --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:75:41
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_input_guards` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:83:23
+ --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:76:23
ERROR Argument `SimpleNamespace` is not assignable to parameter `message` with type `Message` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_input_guards` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:84:21
+ --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:77:21
ERROR Argument `_FakeQueueManager` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_input_guards` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:85:27
+ --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:78:27
ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AgentAppGenerateEntity` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_input_guards` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:98:41
+ --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:91:41
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_input_guards` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:99:23
+ --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:92:23
ERROR Argument `SimpleNamespace` is not assignable to parameter `message` with type `Message` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_input_guards` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:100:21
+ --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:93:21
ERROR Argument `_FakeQueueManager` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_input_guards` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:101:27
+ --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:94:27
ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AgentAppGenerateEntity` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_input_guards` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:114:41
+ --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:107:41
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_input_guards` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:115:23
+ --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:108:23
ERROR Argument `SimpleNamespace` is not assignable to parameter `message` with type `Message` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_input_guards` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:116:21
+ --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:109:21
ERROR Argument `_FakeQueueManager` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_input_guards` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:117:27
+ --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:110:27
ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AgentAppGenerateEntity` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_input_guards` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:131:41
+ --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:123:41
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_input_guards` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:132:23
+ --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:124:23
ERROR Argument `SimpleNamespace` is not assignable to parameter `message` with type `Message` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_input_guards` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:133:21
+ --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:125:21
ERROR Argument `_FakeQueueManager` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_input_guards` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:134:27
+ --> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:126:27
ERROR Object of class `LayerConfig` has no attribute `plugin_id`
ERROR Object of class `LayerConfig` has no attribute `model_provider`
ERROR Object of class `LayerConfig` has no attribute `conversation_id`
|
Contributor
Pyrefly Type Coverage
|
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.
Summary
WatercrawlAuth._get_requestusedhttpx.getwithout a timeout parameter, meaning credential validation could hang indefinitely on network issueshttpx.Timeout(10.0, connect=3.0)constant (matching the pattern used across Dify) and pass it to the GET requestSame class of issue as #37524 (Jina auth validation timeout).
Test plan
test_should_validate_valid_credentials_successfullyto assert the timeout parametertest_should_pass_bounded_timeout_to_credential_validationtest🤖 Generated with Claude Code Best