fix(api): fall back to fake Agent backend when base_url is missing#38339
Open
SquabbyZ wants to merge 1 commit into
Open
fix(api): fall back to fake Agent backend when base_url is missing#38339SquabbyZ wants to merge 1 commit into
SquabbyZ wants to merge 1 commit into
Conversation
In Dify v1.15.0 with Agent V2 enabled, the AgentAppGenerator raises
ValueError("base_url is required when creating a real Agent backend client")
from clients/agent_backend/factory.py:21 when a self-hosted deployment
has not set AGENT_BACKEND_BASE_URL (which defaults to None in
configs/extra/agent_backend_config.py).
The raise is unhelpful for default-config users: it surfaces at request
time inside _generate_worker (core/app/apps/agent_app/app_generator.py:331)
and aborts every Agent app call with HTTP 500, even though the in-process
fake client is perfectly capable of serving the request end-to-end.
This change makes create_agent_backend_run_client() treat missing /
empty base_url the same as use_fake=True: it returns a
FakeAgentBackendRunClient(scenario=fake_scenario) instead of raising.
Self-hosted deployments that want the real backend only need to set
AGENT_BACKEND_BASE_URL to a non-empty value (they implicitly disable
the fake by providing a real URL); deployments that want the fake
explicitly can still pass use_fake=True, unchanged.
diff --stat:
api/clients/agent_backend/factory.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Generated via peaks-loop (session 2026-07-02-session-95565c, request
2026-07-02-fix-agent-backend-base-url-fallback). Red-line scope was
limited to clients/agent_backend/factory.py.
Member
|
Thanks for the contribution. Before we review this PR, please open an issue first to describe the problem, expected behavior, and proposed approach, then link that issue here. This helps us confirm the scope and align on the fix before moving forward. |
Contributor
Author
|
@crazywoola Thanks for the guidance. Opened issue #38408 describing the |
Contributor
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-07-06 01:44:40.373293749 +0000
+++ /tmp/pyrefly_pr.txt 2026-07-06 01:44:25.639183641 +0000
@@ -724,12 +724,10 @@
--> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:593:23
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> tests/test_containers_integration_tests/core/rag/retrieval/test_dataset_retrieval_integration.py:603:23
-ERROR Argument `core.workflow.nodes.human_input.entities.HumanInputNodeData` is not assignable to parameter `data` with type `graphon.nodes.human_input.entities.HumanInputNodeData` in function `graphon.nodes.human_input.human_input_node.HumanInputNode.__init__` [bad-argument-type]
- --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:126:14
ERROR Argument `Connection | Engine` is not assignable to parameter `session_factory` with type `Engine | sessionmaker[Unknown]` in function `core.repositories.sqlalchemy_workflow_execution_repository.SQLAlchemyWorkflowExecutionRepository.__init__` [bad-argument-type]
- --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:269:29
+ --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:265:29
ERROR Argument `Connection | Engine` is not assignable to parameter `session_factory` with type `Engine | sessionmaker[Unknown]` in function `core.repositories.sqlalchemy_workflow_node_execution_repository.SQLAlchemyWorkflowNodeExecutionRepository.__init__` [bad-argument-type]
- --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:275:29
+ --> tests/test_containers_integration_tests/core/workflow/test_human_input_resume_node_execution.py:271:29
ERROR Argument `Literal['owner']` is not assignable to parameter `role` with type `SQLCoreOperations[TenantAccountRole] | TenantAccountRole` in function `models.account.TenantAccountJoin.__init__` [bad-argument-type]
--> tests/test_containers_integration_tests/helpers/execution_extra_content.py:48:14
ERROR Returned type `int | str` is not assignable to declared return type `str` [bad-return]
@@ -747,9 +745,9 @@
ERROR Cannot instantiate `DifyAPISQLAlchemyWorkflowNodeExecutionRepository` because the following members are abstract: `save`, `save_execution_data`, `get_by_workflow_execution` [bad-instantiation]
--> tests/test_containers_integration_tests/repositories/test_sqlalchemy_api_workflow_node_execution_repository.py:122:70
ERROR Class member `_TestWorkflowRunRepository.save` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
- --> tests/test_containers_integration_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:45:9
+ --> tests/test_containers_integration_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:44:9
ERROR Generator function should return `Generator` [bad-return]
- --> tests/test_containers_integration_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:139:56
+ --> tests/test_containers_integration_tests/repositories/test_sqlalchemy_api_workflow_run_repository.py:138:56
ERROR Argument `str | None` is not assignable to parameter `tenant_id` with type `str` in function `_create_node_execution_model` [bad-argument-type]
--> tests/test_containers_integration_tests/repositories/test_sqlalchemy_workflow_node_execution_repository.py:181:23
ERROR Argument `str | None` is not assignable to parameter `tenant_id` with type `str` in function `_create_node_execution_model` [bad-argument-type]
@@ -883,19 +881,19 @@
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> tests/test_containers_integration_tests/services/test_app_generate_service.py:190:38
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/services/test_app_generate_service.py:489:23
+ --> tests/test_containers_integration_tests/services/test_app_generate_service.py:449:23
ERROR Argument `Literal['invalid_mode']` is not assignable to parameter `value` with type `AppMode | SQLCoreOperations[AppMode]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_app_generate_service.py:568:20
+ --> tests/test_containers_integration_tests/services/test_app_generate_service.py:518:20
ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `args` with type `LoopNodeRunPayload` in function `services.app_generate_service.AppGenerateService.generate_single_loop` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_app_generate_service.py:811:64
+ --> tests/test_containers_integration_tests/services/test_app_generate_service.py:736:64
ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `args` with type `LoopNodeRunPayload` in function `services.app_generate_service.AppGenerateService.generate_single_loop` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_app_generate_service.py:838:64
+ --> tests/test_containers_integration_tests/services/test_app_generate_service.py:763:64
ERROR Argument `dict[str, dict[str, str]]` is not assignable to parameter `args` with type `LoopNodeRunPayload` in function `services.app_generate_service.AppGenerateService.generate_single_loop` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_app_generate_service.py:864:68
+ --> tests/test_containers_integration_tests/services/test_app_generate_service.py:789:68
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
- --> tests/test_containers_integration_tests/services/test_app_generate_service.py:914:23
+ --> tests/test_containers_integration_tests/services/test_app_generate_service.py:834:23
ERROR Argument `Literal['agent-chat']` is not assignable to parameter `value` with type `AppMode | SQLCoreOperations[AppMode]` in function `sqlalchemy.orm.base.Mapped.__set__` [bad-argument-type]
- --> tests/test_containers_integration_tests/services/test_app_generate_service.py:1050:20
+ --> tests/test_containers_integration_tests/services/test_app_generate_service.py:960:20
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
--> tests/test_containers_integration_tests/services/test_app_service.py:87:38
ERROR Object of class `NoneType` has no attribute `id` [missing-attribute]
@@ -1843,17 +1841,17 @@
ERROR Argument `dict[str, object]` is not assignable to parameter `configs` with type `Mapping[str, LayerConfigInput] | None` in function `agenton.compositor.core.Compositor._create_run` [bad-argument-type]
--> tests/unit_tests/clients/agent_backend/test_cleanup_composition_compositor_integration.py:97:17
ERROR Cannot index into `bool` [bad-index]
- --> tests/unit_tests/clients/agent_backend/test_event_adapter.py:54:12
+ --> tests/unit_tests/clients/agent_backend/test_event_adapter.py:53:12
ERROR Cannot index into `float` [bad-index]
- --> tests/unit_tests/clients/agent_backend/test_event_adapter.py:54:12
+ --> tests/unit_tests/clients/agent_backend/test_event_adapter.py:53:12
ERROR Cannot index into `int` [bad-index]
- --> tests/unit_tests/clients/agent_backend/test_event_adapter.py:54:12
+ --> tests/unit_tests/clients/agent_backend/test_event_adapter.py:53:12
ERROR Cannot index into `list[JsonValue]` [bad-index]
- --> tests/unit_tests/clients/agent_backend/test_event_adapter.py:54:12
+ --> tests/unit_tests/clients/agent_backend/test_event_adapter.py:53:12
ERROR Cannot index into `str` [bad-index]
- --> tests/unit_tests/clients/agent_backend/test_event_adapter.py:54:12
+ --> tests/unit_tests/clients/agent_backend/test_event_adapter.py:53:12
ERROR `None` is not subscriptable [unsupported-operation]
- --> tests/unit_tests/clients/agent_backend/test_event_adapter.py:54:12
+ --> tests/unit_tests/clients/agent_backend/test_event_adapter.py:53:12
ERROR Expected a callable, got `None` [not-callable]
--> tests/unit_tests/commands/test_clean_expired_messages.py:33:9
ERROR Expected a callable, got `None` [not-callable]
@@ -1862,10 +1860,6 @@
--> tests/unit_tests/commands/test_clean_expired_messages.py:94:9
ERROR Expected a callable, got `None` [not-callable]
--> tests/unit_tests/commands/test_clean_expired_messages.py:176:9
-ERROR Object of class `object` has no attribute `package` [missing-attribute]
- --> tests/unit_tests/commands/test_data_migration_commands.py:182:12
-ERROR Object of class `object` has no attribute `options_override` [missing-attribute]
- --> tests/unit_tests/commands/test_data_migration_commands.py:183:12
ERROR `(self: list[Unknown], object: Unknown, /) -> None` is not assignable to attribute `echo` with type `(message: Any | None = None, file: IO[Any] | None = None, nl: bool = True, err: bool = False, color: bool | None = None) -> None` [bad-assignment]
--> tests/unit_tests/commands/test_data_migration_wizard.py:142:33
ERROR Generator function should return `Generator` [bad-return]
@@ -1919,77 +1913,75 @@
ERROR No attribute `MethodView` in module `builtins` [missing-attribute]
--> tests/unit_tests/controllers/common/test_fields.py:8:5
ERROR Cannot index into `object` [bad-index]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:703:12
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:664:12
ERROR Cannot index into `object` [bad-index]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:704:12
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:665:12
ERROR Cannot index into `object` [bad-index]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:705:12
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:666:12
ERROR Cannot index into `object` [bad-index]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:706:12
-ERROR `in` is not supported between `Literal['Incorrect API key provided']` and `None` [not-iterable]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1458:12
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:667:12
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._create_build_chat_finalization_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1544:26
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1429:26
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._create_build_chat_finalization_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1545:23
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1430:23
ERROR Argument `test_drain_streaming_generate_response_returns_on_message_end.ClosableResponse` is not assignable to parameter `response` with type `Generator[str] | RateLimitGenerator` in function `controllers.console.app.completion._drain_streaming_generate_response` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1592:69
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1476:69
ERROR Argument `Iterator[Any]` is not assignable to parameter `response` with type `Generator[str] | RateLimitGenerator` in function `controllers.console.app.completion._drain_streaming_generate_response` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1600:66
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1484:66
ERROR Argument `Iterator[Any]` is not assignable to parameter `response` with type `Generator[str] | RateLimitGenerator` in function `controllers.console.app.completion._drain_streaming_generate_response` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1607:66
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1491:66
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1638:26
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1521:74
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1639:23
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1521:98
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1678:30
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1558:30
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1679:27
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1559:27
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._resolve_current_user_agent_debug_conversation_id` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1707:22
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1586:22
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._resolve_current_user_agent_debug_conversation_id` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1708:19
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1587:19
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._resolve_current_user_agent_debug_conversation_id` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1713:22
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1592:22
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._resolve_current_user_agent_debug_conversation_id` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1714:19
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1593:19
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1765:30
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1644:30
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.completion._create_chat_message` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1766:27
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1645:27
ERROR Object of class `object` has no attribute `data` [missing-attribute]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1849:50
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1727:50
ERROR Object of class `object` has no attribute `limit` [missing-attribute]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1850:30
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1728:30
ERROR Object of class `object` has no attribute `has_more` [missing-attribute]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1851:33
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1729:33
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.message._list_chat_messages` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1863:67
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1741:67
ERROR Object of class `object` has no attribute `data` [missing-attribute]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1889:50
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1767:50
ERROR Object of class `object` has no attribute `limit` [missing-attribute]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1890:30
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1768:30
ERROR Object of class `object` has no attribute `has_more` [missing-attribute]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1891:33
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1769:33
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.message._list_chat_messages` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1905:67
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1783:67
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account | None` in function `controllers.console.app.message._list_chat_messages` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1905:91
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1783:91
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.message._list_chat_messages` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1925:27
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1803:27
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account | None` in function `controllers.console.app.message._list_chat_messages` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1926:30
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1804:30
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.message._update_message_feedback` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1941:30
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1819:30
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.message._update_message_feedback` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1942:27
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1820:27
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.message._get_message_suggested_questions` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1978:26
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1856:26
ERROR Argument `SimpleNamespace` is not assignable to parameter `app_model` with type `App` in function `controllers.console.app.message._get_message_suggested_questions` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1979:23
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1857:23
ERROR Argument `Literal['00000000-0000-0000-0000-000000000002']` is not assignable to parameter `message_id` with type `UUID` in function `controllers.console.app.message._get_message_suggested_questions` [bad-argument-type]
- --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1980:24
+ --> tests/unit_tests/controllers/console/agent/test_agent_controllers.py:1858:24
ERROR Object of class `int` has no attribute `lower` [missing-attribute]
--> tests/unit_tests/controllers/console/app/test_annotation_security.py:221:38
ERROR Object of class `int` has no attribute `lower` [missing-attribute]
@@ -2005,19 +1997,19 @@
ERROR Argument `SimpleNamespace` is not assignable to parameter `current_user` with type `Account` in function `controllers.console.app.conversation._get_conversation` [bad-argument-type]
--> tests/unit_tests/controllers/console/app/test_conversation_api.py:105:47
ERROR Missing argument `app_model` in function `handler` [missing-argument]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:41:19
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:104:19
ERROR Unexpected keyword argument `app_id` in function `handler` [unexpected-keyword]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:41:20
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:104:20
ERROR Missing argument `app_model` in function `handler` [missing-argument]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:54:16
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:117:16
ERROR Unexpected keyword argument `app_id` in function `handler` [unexpected-keyword]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:54:17
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:117:17
ERROR Missing argument `app_model` in function `handler` [missing-argument]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:63:16
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:126:16
ERROR Missing argument `app_model` in function `Handler.get` [missing-argument]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:85:25
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:148:25
ERROR Unexpected keyword argument `app_id` in function `Handler.get` [unexpected-keyword]
- --> tests/unit_tests/controllers/console/app/test_wraps.py:85:35
+ --> tests/unit_tests/controllers/console/app/test_wraps.py:148:26
ERROR Cannot set item in `OrderedDict[str, bool | list[str] | str]` [unsupported-operation]
--> tests/unit_tests/controllers/console/app/workflow_draft_variables_test.py:137:47
ERROR `None` is not subscriptable [unsupported-operation]
@@ -2129,13 +2121,13 @@
ERROR `SimpleNamespace` is not assignable to attribute `request` with type `Request` [bad-assignment]
--> tests/unit_tests/controllers/files/test_upload.py:61:26
ERROR `SimpleNamespace` is not assignable to attribute `request` with type `Request` [bad-assignment]
- --> tests/unit_tests/controllers/files/test_upload.py:93:26
+ --> tests/unit_tests/controllers/files/test_upload.py:88:26
ERROR `SimpleNamespace` is not assignable to attribute `request` with type `Request` [bad-assignment]
- --> tests/unit_tests/controllers/files/test_upload.py:114:26
+ --> tests/unit_tests/controllers/files/test_upload.py:109:26
ERROR `SimpleNamespace` is not assignable to attribute `request` with type `Request` [bad-assignment]
- --> tests/unit_tests/controllers/files/test_upload.py:142:26
+ --> tests/unit_tests/controllers/files/test_upload.py:137:26
ERROR `SimpleNamespace` is not assignable to attribute `request` with type `Request` [bad-assignment]
- --> tests/unit_tests/controllers/files/test_upload.py:174:26
+ --> tests/unit_tests/controllers/files/test_upload.py:169:26
ERROR Could not find name `Import` [unknown-name]
--> tests/unit_tests/controllers/inner_api/app/test_dsl.py:120:71
ERROR Missing argument `tenant_model` in function `protected_view` [missing-argument]
@@ -2249,9 +2241,9 @@
ERROR Object of class `NoneType` has no attribute `total_tokens` [missing-attribute]
--> tests/unit_tests/controllers/openapi/test_models.py:13:12
ERROR Argument `test_verify_approval_grant_raises_on_missing_field._FakeKeyset` is not assignable to parameter `keyset` with type `KeySet` in function `libs.jws.sign` [bad-argument-type]
- --> tests/unit_tests/controllers/openapi/test_oauth_sso_claims.py:69:9
+ --> tests/unit_tests/controllers/openapi/test_oauth_sso_claims.py:67:9
ERROR Argument `test_verify_approval_grant_raises_on_missing_field._FakeKeyset` is not assignable to parameter `keyset` with type `KeySet` in function `libs.device_flow_security.verify_approval_grant` [bad-argument-type]
- --> tests/unit_tests/controllers/openapi/test_oauth_sso_claims.py:75:52
+ --> tests/unit_tests/controllers/openapi/test_oauth_sso_claims.py:73:52
ERROR Object of class `FunctionType` has no attribute `view_class` [missing-attribute]
--> tests/unit_tests/controllers/openapi/test_workspaces.py:38:12
ERROR `in` is not supported between `Literal['GET']` and `None` [not-iterable]
@@ -2286,14 +2278,6 @@
--> tests/unit_tests/controllers/service_api/app/test_audio.py:186:16
ERROR Argument `list[dict[str, Any]] | None` is not assignable to parameter `obj` with type `Sized` in function `len` [bad-argument-type]
--> tests/unit_tests/controllers/service_api/app/test_completion.py:152:20
-ERROR Missing argument `session` in function `services.app_generate_service.AppGenerateService.generate` [missing-argument]
- --> tests/unit_tests/controllers/service_api/app/test_completion.py:252:45
-ERROR Missing argument `session` in function `services.app_generate_service.AppGenerateService.generate` [missing-argument]
- --> tests/unit_tests/controllers/service_api/app/test_completion.py:264:40
-ERROR Missing argument `session` in function `services.app_generate_service.AppGenerateService.generate` [missing-argument]
- --> tests/unit_tests/controllers/service_api/app/test_completion.py:274:40
-ERROR Missing argument `session` in function `services.app_generate_service.AppGenerateService.generate` [missing-argument]
- --> tests/unit_tests/controllers/service_api/app/test_completion.py:284:40
ERROR Argument value `Literal[0]` violates Pydantic `ge` constraint `Literal[1]` for field `limit` [bad-argument-type]
--> tests/unit_tests/controllers/service_api/app/test_conversation.py:82:35
ERROR Argument value `Literal[101]` violates Pydantic `le` constraint `Literal[100]` for field `limit` [bad-argument-type]
@@ -2303,27 +2287,27 @@
ERROR Argument `SimpleNamespace` is not assignable to parameter `application_generate_entity` with type `AdvancedChatAppGenerateEntity | WorkflowAppGenerateEntity` in function `core.app.apps.common.workflow_response_converter.WorkflowResponseConverter.__init__` [bad-argument-type]
--> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:99:37
ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `WorkflowSnapshot` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline.__init__` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:435:22
+ --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:434:22
ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline.__init__` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:436:27
+ --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:435:27
ERROR Argument `SimpleNamespace` is not assignable to parameter `conversation` with type `ConversationSnapshot` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline.__init__` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:437:26
+ --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:436:26
ERROR Argument `SimpleNamespace` is not assignable to parameter `message` with type `MessageSnapshot` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline.__init__` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:438:21
+ --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:437:21
ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.advanced_chat.generate_task_pipeline.AdvancedChatAppGenerateTaskPipeline.__init__` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:448:37
+ --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:447:37
ERROR Argument `SimpleNamespace` is not assignable to parameter `workflow` with type `Workflow` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:528:22
+ --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:527:22
ERROR Argument `SimpleNamespace` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:529:27
+ --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:528:27
ERROR Argument `SimpleNamespace` is not assignable to parameter `user` with type `Account | EndUser` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:530:18
+ --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:529:18
ERROR Argument `(**kwargs: Unknown) -> None` is not assignable to parameter `draft_var_saver_factory` with type `DraftVariableSaverFactory` in function `core.app.apps.workflow.generate_task_pipeline.WorkflowAppGenerateTaskPipeline.__init__` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:532:37
+ --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:531:37
ERROR Argument `SimpleNamespace` is not assignable to parameter `graph_runtime_state` with type `GraphRuntimeState` in function `core.app.apps.common.workflow_response_converter.WorkflowResponseConverter.workflow_pause_to_stream_response` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:628:33
+ --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:627:33
ERROR Argument `() -> TestHitlServiceApi.test_snapshot_events_include_pause_payload_contract._SessionContext` is not assignable to parameter `session_maker` with type `sessionmaker[Session] | None` in function `services.workflow_event_snapshot_service._build_snapshot_events` [bad-argument-type]
- --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:703:27
+ --> tests/unit_tests/controllers/service_api/app/test_hitl_service_api.py:702:27
ERROR Argument value `Literal[0]` violates Pydantic `ge` constraint `Literal[1]` for field `limit` [bad-argument-type]
--> tests/unit_tests/controllers/service_api/app/test_message.py:90:63
ERROR Argument value `Literal[101]` violates Pydantic `le` constraint `Literal[100]` for field `limit` [bad-argument-type]
@@ -2350,14 +2334,6 @@
--> tests/unit_tests/controllers/service_api/app/test_workflow.py:239:16
ERROR Object of class `dict` has no attribute `limit` [missing-attribute]
--> tests/unit_tests/controllers/service_api/app/test_workflow.py:240:16
-ERROR Missing argument `session` in function `services.app_generate_service.AppGenerateService.generate` [missing-argument]
- --> tests/unit_tests/controllers/service_api/app/test_workflow.py:270:45
-ERROR Missing argument `session` in function `services.app_generate_service.AppGenerateService.generate` [missing-argument]
- --> tests/unit_tests/controllers/service_api/app/test_workflow.py:287:40
-ERROR Missing argument `session` in function `services.app_generate_service.AppGenerateService.generate` [missing-argument]
- --> tests/unit_tests/controllers/service_api/app/test_workflow.py:301:40
-ERROR Missing argument `session` in function `services.app_generate_service.AppGenerateService.generate` [missing-argument]
- --> tests/unit_tests/controllers/service_api/app/test_workflow.py:315:45
ERROR Object of class `NoneType` has no attribute `status` [missing-attribute]
--> tests/unit_tests/controllers/service_api/app/test_workflow.py:367:16
ERROR Argument `SimpleNamespace` is not assignable to parameter `obj` with type `WorkflowRun` in function `controllers.service_api.app.workflow.WorkflowRunStatusField.output` [bad-argument-type]
@@ -2550,78 +2526,44 @@
--> tests/unit_tests/core/agent/test_cot_agent_runner.py:24:9
ERROR `None` is not assignable to attribute `agent_callback` with type `DifyAgentCallbackHandler` [bad-assignment]
--> tests/unit_tests/core/agent/test_cot_agent_runner.py:80:29
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:83:5
ERROR Missing required key `action` for TypedDict `ActionDict` [bad-typed-dict-key]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:113:44
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:112:44
ERROR Missing required key `action_input` for TypedDict `ActionDict` [bad-typed-dict-key]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:113:44
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:112:44
ERROR Key `invalid` is not defined in TypedDict `ActionDict` [bad-typed-dict-key]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:113:45
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:167:55
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:180:55
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:204:35
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:112:45
ERROR `None` is not assignable to attribute `agent_callback` with type `DifyAgentCallbackHandler` [bad-assignment]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:223:33
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:226:29
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:222:33
ERROR Object of class `NoneType` has no attribute `max_iteration` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:229:9
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:228:9
ERROR `None` is not assignable to attribute `agent_callback` with type `DifyAgentCallbackHandler` [bad-assignment]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:245:33
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:248:29
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:259:35
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:244:33
ERROR Object of class `NoneType` has no attribute `max_iteration` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:263:9
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:275:29
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:262:9
ERROR Object of class `NoneType` has no attribute `max_iteration` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:280:9
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:279:9
ERROR `Literal[1]` is not assignable to attribute `prompt_price` with type `Decimal` [bad-assignment]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:286:32
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:285:32
ERROR `Literal[1]` is not assignable to attribute `completion_price` with type `Decimal` [bad-assignment]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:287:36
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:286:36
ERROR `Literal[2]` is not assignable to attribute `total_price` with type `Decimal` [bad-assignment]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:288:31
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:287:31
ERROR `Literal[1]` is not assignable to attribute `prompt_price` with type `Decimal` [bad-assignment]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:294:32
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:293:32
ERROR `Literal[1]` is not assignable to attribute `completion_price` with type `Decimal` [bad-assignment]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:295:36
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:294:36
ERROR `Literal[2]` is not assignable to attribute `total_price` with type `Decimal` [bad-assignment]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:296:31
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:324:35
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:343:35
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:357:25
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:295:31
ERROR Object of class `NoneType` has no attribute `max_iteration` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:377:9
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:376:9
ERROR `None` is not assignable to attribute `agent_callback` with type `DifyAgentCallbackHandler` [bad-assignment]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:385:33
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:387:25
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:384:33
ERROR `list[str]` is not assignable to attribute `_agent_scratchpad` with type `list[AgentScratchpadUnit]` [bad-assignment]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:417:36
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:439:55
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:416:36
ERROR Object of class `FunctionType` has no attribute `assert_called` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:443:9
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:442:9
ERROR Class member `BadValue.__str__` overrides a member in a parent class but is missing an `@override` decorator [missing-override-decorator]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:453:17
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:509:35
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:523:35
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:537:35
-ERROR Object of class `DummyRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_cot_agent_runner.py:552:35
+ --> tests/unit_tests/core/agent/test_cot_agent_runner.py:452:17
ERROR `list[DummyTool]` is not assignable to attribute `_prompt_messages_tools` with type `Sequence[PromptMessageTool]` [bad-assignment]
--> tests/unit_tests/core/agent/test_cot_chat_agent_runner.py:49:37
ERROR `DummyGenerateEntity` is not assignable to attribute `application_generate_entity` with type `AgentChatAppGenerateEntity` [bad-assignment]
@@ -2644,54 +2586,34 @@
--> tests/unit_tests/core/agent/test_fc_agent_runner.py:31:30
ERROR `Literal[0]` is not assignable to attribute `total_price` with type `Decimal` [bad-assignment]
--> tests/unit_tests/core/agent/test_fc_agent_runner.py:32:25
-ERROR Missing argument `session` in function `core.agent.base_agent_runner.BaseAgentRunner.__init__` [missing-argument]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:102:37
-ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:133:5
ERROR Argument `DummyChunk` is not assignable to parameter `llm_result_chunk` with type `LLMResultChunk` in function `core.agent.fc_agent_runner.FunctionCallAgentRunner.check_tool_calls` [bad-argument-type]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:153:40
+ --> tests/unit_tests/core/agent/test_fc_agent_runner.py:152:40
ERROR Argument `DummyResult` is not assignable to parameter `llm_result` with type `LLMResult` in function `core.agent.fc_agent_runner.FunctionCallAgentRunner.check_blocking_tool_calls` [bad-argument-type]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:158:49
+ --> tests/unit_tests/core/agent/test_fc_agent_runner.py:157:49
ERROR Argument `DummyChunk` is not assignable to parameter `llm_result_chunk` with type `LLMResultChunk` in function `core.agent.fc_agent_runner.FunctionCallAgentRunner.extract_tool_calls` [bad-argument-type]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:174:43
+ --> tests/unit_tests/core/agent/test_fc_agent_runner.py:173:43
ERROR Argument `DummyChunk` is not assignable to parameter `llm_result_chunk` with type `LLMResultChunk` in function `core.agent.fc_agent_runner.FunctionCallAgentRunner.extract_tool_calls` [bad-argument-type]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:185:43
+ --> tests/unit_tests/core/agent/test_fc_agent_runner.py:184:43
ERROR Argument `DummyResult` is not assignable to parameter `llm_result` with type `LLMResult` in function `core.agent.fc_agent_runner.FunctionCallAgentRunner.extract_blocking_tool_calls` [bad-argument-type]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:196:52
+ --> tests/unit_tests/core/agent/test_fc_agent_runner.py:195:52
ERROR Argument `None` is not assignable to parameter `query` with type `str` in function `core.agent.fc_agent_runner.FunctionCallAgentRunner._organize_user_query` [bad-argument-type]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:232:46
-ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:300:35
+ --> tests/unit_tests/core/agent/test_fc_agent_runner.py:231:46
ERROR Object of class `FunctionType` has no attribute `assert_called` [missing-attribute]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:302:9
+ --> tests/unit_tests/core/agent/test_fc_agent_runner.py:301:9
ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:304:23
+ --> tests/unit_tests/core/agent/test_fc_agent_runner.py:303:23
ERROR Argument `list[TextPromptMessageContent]` is not assignable to parameter `content` with type `str | None` in function `DummyMessage.__init__` [bad-argument-type]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:312:57
-ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:319:35
+ --> tests/unit_tests/core/agent/test_fc_agent_runner.py:311:57
ERROR Argument `list[TextPromptMessageContent]` is not assignable to parameter `content` with type `str | None` in function `DummyMessage.__init__` [bad-argument-type]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:332:57
-ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:342:35
+ --> tests/unit_tests/core/agent/test_fc_agent_runner.py:331:57
ERROR Argument `list[TextPromptMessageContent]` is not assignable to parameter `content` with type `str | None` in function `DummyMessage.__init__` [bad-argument-type]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:348:46
-ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:353:35
+ --> tests/unit_tests/core/agent/test_fc_agent_runner.py:347:46
ERROR Object of class `FunctionType` has no attribute `call_args` [missing-attribute]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:355:16
-ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:382:35
-ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:400:35
-ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:429:35
+ --> tests/unit_tests/core/agent/test_fc_agent_runner.py:354:16
ERROR Object of class `FunctionType` has no attribute `call_args_list` [missing-attribute]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:435:25
+ --> tests/unit_tests/core/agent/test_fc_agent_runner.py:434:25
ERROR Object of class `NoneType` has no attribute `max_iteration` [missing-attribute]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:439:9
-ERROR Object of class `FunctionCallAgentRunner` has no attribute `session` [missing-attribute]
- --> tests/unit_tests/core/agent/test_fc_agent_runner.py:454:29
+ --> tests/unit_tests/core/agent/test_fc_agent_runner.py:438:9
ERROR Missing argument `description` in function `core.agent.plugin_entities.AgentStrategyEntity.__init__` [missing-argument]
--> tests/unit_tests/core/agent/test_plugin_entities.py:281:32
ERROR Invalid key for TypedDict `AppParametersDict`, got `Unknown` [bad-typed-dict-key]
@@ -3235,30 +3157,14 @@
--> tests/unit_tests/core/app/apps/agent_app/test_app_generator.py:242:22
ERROR Argument `DummyAccount` is not assignable to parameter `user` with type `Account | EndUser` in function `core.app.apps.agent_app.app_generator.AgentAppGenerator._run_stateless` [bad-argument-type]
--> tests/unit_tests/core/app/apps/agent_app/test_app_generator.py:258:18
-ERROR Argument `float | None` is not assignable to parameter `text_delta_debounce_seconds` with type `float` in function `core.app.apps.agent_app.app_runner.AgentAppRunner.__init__` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:422:37
ERROR Object of class `NoneType` has no attribute `message` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:479:12
+ --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:367:12
ERROR Object of class `NoneType` has no attribute `model` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:480:12
+ --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:368:12
ERROR Object of class `NoneType` has no attribute `message` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:506:12
-ERROR Object of class `NoneType` has no attribute `usage` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:507:12
-ERROR Object of class `NoneType` has no attribute `usage` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:508:12
-ERROR Object of class `NoneType` has no attribute `usage` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:509:12
-ERROR Object of class `NoneType` has no attribute `message` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:524:12
-ERROR Object of class `NoneType` has no attribute `message` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:538:12
-ERROR Object of class `NoneType` has no attribute `message` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:552:12
-ERROR Object of class `NoneType` has no attribute `message` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:589:12
+ --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:399:12
ERROR Object of class `NoneType` has no attribute `message` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:604:12
+ --> tests/unit_tests/core/app/apps/agent_app/test_app_runner.py:414:12
ERROR Object of class `NoneType` has no attribute `message` [missing-attribute]
--> tests/unit_tests/core/app/apps/agent_app/test_input_guards.py:67:12
ERROR Object of class `NoneType` has no attribute `prompt_messages` [missing-attribute]
@@ -3310,35 +3216,34 @@
ERROR Object of class `LayerConfig` has no attribute `invoke_from`
ERROR Object of class `LayerConfig` has no attribute `agent_mode`
ERROR `list[dict[str, str]]` is not assignable to attribute `dify_tools` with type `list[AgentSoulDifyToolConfig]` [bad-assignment]
- --> tests/unit_tests/core/app/apps/agent_app/test_runtime_request_builder.py:216:33
+ --> tests/unit_tests/core/app/apps/agent_app/test_runtime_request_builder.py:214:33
ERROR `list[dict[str, str]]` is not assignable to attribute `dify_tools` with type `list[AgentSoulDifyToolConfig]` [bad-assignment]
- --> tests/unit_tests/core/app/apps/agent_app/test_runtime_request_builder.py:237:33
+ --> tests/unit_tests/core/app/apps/agent_app/test_runtime_request_builder.py:235:33
ERROR `list[dict[str, str]]` is not assignable to attribute `dify_tools` with type `list[AgentSoulDifyToolConfig]` [bad-assignment]
- --> tests/unit_tests/core/app/apps/agent_app/test_runtime_request_builder.py:258:33
+ --> tests/unit_tests/core/app/apps/agent_app/test_runtime_request_builder.py:256:33
ERROR Object of class `NoneType` has no attribute `plugin_id` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_runtime_request_builder.py:278:9
+ --> tests/unit_tests/core/app/apps/agent_app/test_runtime_request_builder.py:276:9
ERROR Object of class `LayerConfig` has no attribute `plugin_id`
ERROR Object of class `LayerConfig` has no attribute `model_provider`
ERROR Object of class `Mapping` has no attribute `model_dump`
ERROR Object of class `LayerConfig` has no attribute `agent_id`
ERROR Object of class `LayerConfig` has no attribute `config_version`
ERROR Object of class `object` has no attribute `id` [missing-attribute]
- --> tests/unit_tests/core/app/apps/agent_app/test_runtime_request_builder.py:412:16
-ERROR Object of class `object` has no attribute `kind` [missing-attribute]
--> tests/unit_tests/core/app/apps/agent_app/test_runtime_request_builder.py:413:16
-ERROR Object of class `object` has no attribute `writable` [missing-attribute]
+ERROR Object of class `object` has no attribute `kind` [missing-attribute]
--> tests/unit_tests/core/app/apps/agent_app/test_runtime_request_builder.py:414:16
+ERROR Object of class `object` has no attribute `writable` [missing-attribute]
+ --> tests/unit_tests/core/app/apps/agent_app/test_runtime_request_builder.py:415:16
ERROR Object of class `LayerConfig` has no attribute `skills`
ERROR Object of class `LayerConfig` has no attribute `files`
ERROR Object of class `LayerConfig` has no attribute `note`
ERROR Object of class `LayerConfig` has no attribute `mentioned_skill_names`
ERROR Object of class `LayerConfig` has no attribute `mentioned_file_names`
-ERROR Object of class `Mapping` has no attribute `model_dump`
ERROR Object of class `LayerConfig` has no attribute `agent_stub_drive_ref`
ERROR Object of class `Mapping` has no attribute `model_dump`
ERROR Object of class `LayerConfig` has no attribute `prefix`
ERROR `not in` is not supported between `Literal['[§']` and `object` [not-iterable]
- --> tests/unit_tests/core/app/apps/agent_app/test_runtime_request_builder.py:504:16
+ --> tests/unit_tests/core/app/apps/agent_app/test_runtime_request_builder.py:517:16
ERROR Object of class `LayerConfig` has no attribute `prefix`
ERROR Object of class `FromClause` has no attribute `create` [missing-attribute]
--> tests/unit_tests/core/app/apps/agent_app/test_session_store.py:58:5
@@ -3374,62 +3279,62 @@
--> tests/unit_tests/core/app/apps/chat/test_app_config_manager.py:35:34
ERROR Argument `dict[str, str]` is not assignable to parameter `override_config_dict` with type `AppModelConfigDict | None` in function `core.app.apps.chat.app_config_manager.ChatAppConfigManager.get_app_config` [bad-argument-type]
--> tests/unit_tests/core/app/apps/chat/test_app_config_manager.py:37:38
-ERROR No matching overload found for function `core.app.apps.chat.app_generator.ChatAppGenerator.generate` called with arguments: (session=MagicMock, app_model=SimpleNamespace, user=SimpleNamespace, args=dict[str, dict[@_, @_]], invoke_from=Literal[InvokeFrom.SERVICE_API], streaming=Literal[False]) [no-matching-overload]
+ERROR No matching overload found for function `core.app.apps.chat.app_generator.ChatAppGenerator.generate` called with arguments: (app_model=SimpleNamespace, user=SimpleNamespace, args=dict[str, dict[@_, @_]], invoke_from=Literal[InvokeFrom.SERVICE_API], streaming=Literal[False]) [no-matching-overload]
--> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:50:31
-ERROR No matching overload found for function `core.app.apps.chat.app_generator.ChatAppGenerator.generate` called with arguments: (session=MagicMock, app_model=SimpleNamespace, user=SimpleNamespace, args=dict[str, dict[@_, @_] | int], invoke_from=Literal[InvokeFrom.SERVICE_API], streaming=Literal[False]) [no-matching-overload]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:62:31
-ERROR No matching overload found for function `core.app.apps.chat.app_generator.ChatAppGenerator.generate` called with arguments: (MagicMock, SimpleNamespace, SimpleNamespace, dict[str, dict[Unknown, Unknown] | str | dict[str, str]], Literal[InvokeFrom.DEBUGGER], streaming=Literal[False]) [no-matching-overload]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:110:40
-ERROR No matching overload found for function `core.app.apps.chat.app_generator.ChatAppGenerator.generate` called with arguments: (session=MagicMock, app_model=SimpleNamespace, user=SimpleNamespace, args=dict[str, dict[@_, @_] | str | dict[str, str]], invoke_from=Literal[InvokeFrom.SERVICE_API], streaming=Literal[False]) [no-matching-overload]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:123:35
+ERROR No matching overload found for function `core.app.apps.chat.app_generator.ChatAppGenerator.generate` called with arguments: (app_model=SimpleNamespace, user=SimpleNamespace, args=dict[str, dict[@_, @_] | int], invoke_from=Literal[InvokeFrom.SERVICE_API], streaming=Literal[False]) [no-matching-overload]
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:61:31
+ERROR No matching overload found for function `core.app.apps.chat.app_generator.ChatAppGenerator.generate` called with arguments: (SimpleNamespace, SimpleNamespace, dict[str, dict[Unknown, Unknown] | str | dict[str, str]], Literal[InvokeFrom.DEBUGGER], streaming=Literal[False]) [no-matching-overload]
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:108:40
+ERROR No matching overload found for function `core.app.apps.chat.app_generator.ChatAppGenerator.generate` called with arguments: (app_model=SimpleNamespace, user=SimpleNamespace, args=dict[str, dict[@_, @_] | str | dict[str, str]], invoke_from=Literal[InvokeFrom.SERVICE_API], streaming=Literal[False]) [no-matching-overload]
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:121:35
ERROR Argument `DummyGenerateEntity` is not assignable to parameter `application_generate_entity` with type `ChatAppGenerateEntity` in function `core.app.apps.chat.app_generator.ChatAppGenerator._generate_worker` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:146:45
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:142:45
ERROR Argument `DummyQueueManager` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.chat.app_generator.ChatAppGenerator._generate_worker` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:147:31
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:143:31
ERROR Argument `DummyGenerateEntity` is not assignable to parameter `application_generate_entity` with type `ChatAppGenerateEntity` in function `core.app.apps.chat.app_generator.ChatAppGenerator._generate_worker` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:163:45
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:158:45
ERROR Argument `DummyQueueManager` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.chat.app_generator.ChatAppGenerator._generate_worker` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:164:31
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:159:31
ERROR Argument `DummyGenerateEntity` is not assignable to parameter `application_generate_entity` with type `ChatAppGenerateEntity` in function `core.app.apps.chat.app_runner.ChatAppRunner.run` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:192:34
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:186:28
ERROR Argument `DummyQueueManager` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.chat.app_runner.ChatAppRunner.run` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:192:55
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:186:49
ERROR Argument `SimpleNamespace` is not assignable to parameter `conversation` with type `Conversation` in function `core.app.apps.chat.app_runner.ChatAppRunner.run` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:192:76
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:186:70
ERROR Argument `SimpleNamespace` is not assignable to parameter `message` with type `Message` in function `core.app.apps.chat.app_runner.ChatAppRunner.run` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:192:95
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:186:89
ERROR Argument `DummyGenerateEntity` is not assignable to parameter `application_generate_entity` with type `ChatAppGenerateEntity` in function `core.app.apps.chat.app_runner.ChatAppRunner.run` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:225:30
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:217:24
ERROR Argument `DummyQueueManager` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.chat.app_runner.ChatAppRunner.run` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:225:51
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:217:45
ERROR Argument `SimpleNamespace` is not assignable to parameter `conversation` with type `Conversation` in function `core.app.apps.chat.app_runner.ChatAppRunner.run` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:225:72
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:217:66
ERROR Argument `SimpleNamespace` is not assignable to parameter `message` with type `Message` in function `core.app.apps.chat.app_runner.ChatAppRunner.run` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:225:91
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:217:85
ERROR Argument `DummyGenerateEntity` is not assignable to parameter `application_generate_entity` with type `ChatAppGenerateEntity` in function `core.app.apps.chat.app_runner.ChatAppRunner.run` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:263:37
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:254:24
ERROR Argument `DummyQueueManager` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.chat.app_runner.ChatAppRunner.run` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:263:58
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:254:45
ERROR Argument `SimpleNamespace` is not assignable to parameter `conversation` with type `Conversation` in function `core.app.apps.chat.app_runner.ChatAppRunner.run` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:263:73
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:254:60
ERROR Argument `SimpleNamespace` is not assignable to parameter `message` with type `Message` in function `core.app.apps.chat.app_runner.ChatAppRunner.run` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:263:92
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:254:79
ERROR Argument `DummyGenerateEntity` is not assignable to parameter `application_generate_entity` with type `ChatAppGenerateEntity` in function `core.app.apps.chat.app_runner.ChatAppRunner.run` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:299:30
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:289:24
ERROR Argument `DummyQueueManager` is not assignable to parameter `queue_manager` with type `AppQueueManager` in function `core.app.apps.chat.app_runner.ChatAppRunner.run` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:299:51
+ --> tests/unit_tests/core/app/apps/chat/test_app_generator_and_runner.py:289:45
ERROR Argument `SimpleNamespace` is not assignable to parameter `conversation` with type `Conversation` in function `core.app.apps.chat.app_runner.ChatAppRunner.run` [bad-argument-type]
- --> tests/unit_tests/core/app/apps/chat/test\n\n... (truncated) ... |
Contributor
Pyrefly Type Coverage
|
Contributor
|
style check failed |
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.
Fixes #38408
Summary
In Dify v1.15.0 with Agent V2 enabled,
AgentAppGeneratorraisesValueError("base_url is required when creating a real Agent backend client")fromclients/agent_backend/factory.py:21when a self-hosted deployment has not setAGENT_BACKEND_BASE_URL(which defaults toNoneinconfigs/extra/agent_backend_config.py).The raise is unhelpful for default-config users: it surfaces at request time inside
_generate_worker(core/app/apps/agent_app/app_generator.py:331) and aborts every Agent app call with HTTP 500, even though the in-process fake client is perfectly capable of serving the request end-to-end.Changes
api/clients/agent_backend/factory.py:create_agent_backend_run_client()now treats a missing or emptybase_urlthe same asuse_fake=True??it returns aFakeAgentBackendRunClient(scenario=fake_scenario)instead of raising.AGENT_BACKEND_BASE_URLto a non-empty value (they implicitly disable the fake by providing a real URL).use_fake=True, unchanged.FakeAgentBackendRunClientandDifyAgentBackendRunClienttest suites still apply (one new branch covered, no existing test should regress).Diff stat
Test plan
ruff check api/clients/agent_backend/factory.pyclean.test_fake_client.pyandtest_client.pypass.AGENT_BACKEND_BASE_URLunset, enable Agent V2, send a chat request ??confirm the request now succeeds (returns the fake client's default success response) instead of raisingValueError.AGENT_BACKEND_BASE_URL=http://localhost:9999??confirm the real client is wired and the missing backend surfaces as a connection error from the agent runtime, not thebase_url is requiredValueError.Risk / behavior preservation
base_urlis provided, the function still constructs a realDifyAgentBackendRunClient??unchanged.use_fake=True, the function still returns the fake client ??unchanged.base_url is None or not base_url.strip(). Self-hosted deployments that intentionally want the real backend must provide a real URL ??which is whatAGENT_BACKEND_BASE_URL: str | Nonealready documents.Related
peaks-loopsession2026-07-02-session-95565cduring an issue sweep on 2026-07-02.Automation
Generated via peaks-loop (full-auto mode). Red-line scope was limited to
api/clients/agent_backend/factory.py. Commit message includes the peaks-loop provenance line for traceability.?? Generated with Claude Code via peaks-loop