feat(plugin): cache plugin model providers by tenant#36449
Merged
Conversation
Contributor
Pyrefly Type Coverage
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #36449 +/- ##
==========================================
+ Coverage 86.06% 86.11% +0.04%
==========================================
Files 4483 4483
Lines 214838 214909 +71
Branches 39891 39897 +6
==========================================
+ Hits 184911 185060 +149
+ Misses 26554 26457 -97
- Partials 3373 3392 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Move PluginService into core.plugin and make it own tenant-scoped plugin model provider cache reads, writes, and invalidation. Inject PluginService into PluginModelRuntime and remove the request-scoped provider cache so install, uninstall, and upgrade flows share the same cache owner.
Delete services.plugin.plugin_service and update remaining tests to import and patch core.plugin.plugin_service directly. This completes the move of PluginService ownership into core.plugin without retaining the compatibility module.
Increase the default provider cache TTL to one day and document the setting in API and Docker environment examples.
Add unit coverage for tenant-scoped plugin model provider cache reads, invalidation, Redis failure handling, lifecycle cache invalidation, and deleted-tools plugin service resolution.
e37be5b to
43ed1dc
Compare
WH-2099
approved these changes
May 23, 2026
ryuta-kobayashi-ug
added a commit
to ryuta-kobayashi-ug/dify
that referenced
this pull request
May 24, 2026
The PluginModelRuntime.invoke_llm() now forwards app_id to the plugin client. Update the existing assert_called_once_with checks in test_model_runtime_adapter.py (added by langgenius#36449 on main) to include app_id=None for parity.
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
Fixes #36448.
PluginServiceintocore.pluginso plugin lifecycle changes and provider discovery share one cache owner.PluginServiceintoPluginModelRuntimeand remove the per-runtime provider cache.services.plugin.plugin_servicemodule and update imports tocore.plugin.plugin_service.Screenshots
N/A, backend-only change.