[CLEAN] Synthetic Benchmark PR #30323 - fix(api): remove tool provider list cache to fix cache inconsistency #144
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.
Benchmark PR langgenius#30323
Type: Clean (correct implementation)
Original PR Title: fix(api): remove tool provider list cache to fix cache inconsistency
Original PR Description: ## Summary
Remove the Redis caching mechanism for tool provider list API that was introduced in langgenius#29101.
Problems with the current caching approach
Cache inconsistency: After CRUD operations on tool providers, cached data may not be properly invalidated, causing stale data to be returned to users.
Race conditions: Cache invalidation timing issues - invalidating cache inside Redis locks caused timeouts (fix(api): move cache invalidation outside redis lock to prevent timeout langgenius/dify#30150), but moving it outside can cause race conditions.
Hard to maintain: Manual cache invalidation is scattered across multiple service files (
api_tools_manage_service.py,workflow_tools_manage_service.py,builtin_tools_manage_service.py,tool_providers.py), making it error-prone and difficult to maintain. Missing any invalidation call leads to inconsistency.User-facing symptoms:
Changes
ToolProviderListCacheclass and its test filetool_manager.py)Test plan
make lintpassesmake type-checkpassesFixes langgenius#30322
🤖 Generated with Claude Code
Original PR URL: langgenius#30323