Skip to content

fix: add bounded timeout to Firecrawl auth credential validation#37539

Open
ifer47 wants to merge 2 commits into
langgenius:mainfrom
ifer47:fix/firecrawl-auth-validation-timeout
Open

fix: add bounded timeout to Firecrawl auth credential validation#37539
ifer47 wants to merge 2 commits into
langgenius:mainfrom
ifer47:fix/firecrawl-auth-validation-timeout

Conversation

@ifer47

@ifer47 ifer47 commented Jun 16, 2026

Copy link
Copy Markdown

Summary

  • FirecrawlAuth._post_request used httpx.post 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 POST request
  • Update existing test assertions and add a new test verifying the bounded timeout is passed

Closes #37521

Test plan

  • Updated test_should_validate_valid_credentials_successfully to assert the timeout parameter
  • Added test_should_pass_bounded_timeout_to_credential_validation test
  • All existing tests continue to pass

🤖 Generated with Claude Code Best

…ggenius#37521)

FirecrawlAuth._post_request used httpx.post 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 POST request.

Co-Authored-By: zhipu/glm-5 <zai-org@claude-code-best.win>
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Diff

base → PR
--- /tmp/pyrefly_base.txt	2026-06-16 19:22:19.011349978 +0000
+++ /tmp/pyrefly_pr.txt	2026-06-16 19:22:09.180315181 +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`

@github-actions

Copy link
Copy Markdown
Contributor

Pyrefly Type Coverage

Metric Base PR Delta
Type coverage 48.59% 48.59% -0.00%
Strict coverage 48.10% 48.10% -0.00%
Typed symbols 27,995 27,994 -1
Untyped symbols 29,922 29,925 +3
Modules 2892 2892 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Firecrawl credential validation POST lacks bounded timeout

1 participant