dify/api/core/helper
Harry 70d0d46678 fix(api): remove tool provider list cache to fix cache inconsistency
This commit removes the Redis caching mechanism for tool provider list
API that was introduced in #29101.

## Problems with the current caching approach

1. **Cache inconsistency**: After CRUD operations on tool providers,
   cached data may not be properly invalidated, causing stale data.

2. **Race conditions**: Cache invalidation timing issues - invalidating
   inside Redis locks caused timeouts (#30150), moving outside causes
   race conditions.

3. **Hard to maintain**: Manual cache invalidation scattered across
   multiple service files is error-prone and difficult to maintain.

4. **User-facing symptoms**:
   - Newly created tools not appearing in the list
   - Deleted tools still showing up
   - Updated tool configurations not reflecting immediately
   - MCP provider auth state not updating correctly

## Changes

- Remove `ToolProviderListCache` class and its usage
- Remove cache invalidation calls from all service files
- Remove related test mocks
- Keep the code optimizations from #29101 (session management, batch processing)

Fixes #30322

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 16:32:42 +08:00
..
code_executor fix(template-transform): use base64 encoding for Jinja2 templates to fix #26818 (#30223) 2025-12-29 13:03:39 +08:00
__init__.py feat: server multi models support (#799) 2023-08-12 00:57:00 +08:00
credential_utils.py Feat/credential policy (#25151) 2025-09-08 23:45:05 -07:00
csv_sanitizer.py fix: csv injection in annotations export (#29462) 2025-12-15 17:14:05 +08:00
download.py Introduce Plugins (#13836) 2025-02-17 17:05:13 +08:00
encrypter.py feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
http_client_pooling.py improve: pooling httpx clients for requests to code sandbox and ssrf (#26052) 2025-09-24 22:14:50 +08:00
marketplace.py feat(api): Implement EventManager error logging and add coverage (#29204) 2025-12-08 09:40:40 +08:00
model_provider_cache.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
moderation.py make logging not use f-str, change others to f-str (#22882) 2025-07-25 10:32:48 +08:00
module_import_helper.py rm type ignore (#25715) 2025-10-21 11:26:58 +08:00
name_generator.py feat: introduce trigger functionality (#27644) 2025-11-12 17:59:37 +08:00
position_helper.py feat(stress-test): add comprehensive stress testing suite using Locust (#25617) 2025-09-12 22:25:05 +08:00
provider_cache.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
provider_encryption.py feat: introduce trigger functionality (#27644) 2025-11-12 17:59:37 +08:00
ssrf_proxy.py fix: fix use build_request lead unexpect param (#30095) 2025-12-24 17:23:30 +08:00
tool_parameter_cache.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
trace_id_helper.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00