dify/api/core/plugin/impl
Taranum01 dcdca603e7 fix(plugin): fall back to generic listing when category route 404s
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.
2026-08-14 23:21:31 +05:30
..
agent.py feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
asset.py feat: introduce trigger functionality (#27644) 2025-11-12 17:59:37 +08:00
base.py fix(api): chain original exception in 13 except blocks per PEP 3134 (#40738) 2026-08-13 17:50:05 +00:00
datasource.py refactor: replace bare dict with typed annotations in core plugin module (#35096) 2026-04-13 19:23:21 +00:00
debugging.py refactor: rename plugin manager to plugin client and rename path from manager to impl (#18876) 2025-04-27 14:22:25 +08:00
dynamic_select.py feat: introduce trigger functionality (#27644) 2025-11-12 17:59:37 +08:00
endpoint.py fix(plugin): align plugin list endpoint counts with live endpoint state (#37179) 2026-06-10 08:11:11 +00:00
exc.py chore: improve lambda plugin runtime error display (#39437) 2026-07-23 06:05:14 +00:00
model_runtime_factory.py feat(plugin): cache plugin model providers by tenant (#36449) 2026-05-23 09:12:09 +00:00
model_runtime.py feat(api): isolate credentials from local packages (#39957) 2026-08-04 02:50:04 +00:00
model.py feat: optimize integrations initial loading (#40118) 2026-08-07 02:06:25 +00:00
oauth.py feat: oauth refresh token (#22744) 2025-07-23 13:12:39 +08:00
plugin.py fix(plugin): fall back to generic listing when category route 404s 2026-08-14 23:21:31 +05:30
tool.py feat: support config max size of plugin generated files (#30887) 2026-02-13 09:48:27 +08:00
trigger.py feat: introduce trigger functionality (#27644) 2025-11-12 17:59:37 +08:00