mirror of
https://github.com/langgenius/dify.git
synced 2026-09-08 19:15:59 +08:00
Fixes #40683 `PluginInstaller.list_plugins_by_category` calls `GET /plugin/{tenant_id}/management/{category}/list` on the plugin daemon. Local plugin daemons (e.g. 0.6.x) don't expose the category-segmented route and return 404. The current code raises this 404, which then breaks the model-provider integration page even though the generic listing route is available. On 404, fall back to `GET /plugin/{tenant_id}/management/list` and filter the result locally by `declaration.category`. The generic route is the same one used by the unrestricted `list_plugins_with_total`. Apply the caller's page/page_size on the filtered result (cap page_size at 1000 for the fallback fetch — adequate for any reasonable category). Added a regression test in `test_plugin_manager.py` that asserts the 404-fallback path produces the correct filtered list with the right `has_more` flag. |
||
|---|---|---|
| .. | ||
| fixtures/workflow | ||
| helpers | ||
| integration_tests | ||
| test_containers_integration_tests | ||
| unit_tests | ||
| __init__.py | ||
| conftest.py | ||
| pytest_dify.py | ||
| seed_legacy_model_type_dirty_data.py | ||
| workflow_test_utils.py | ||