Skip to content

Conversation

@tomerqodo
Copy link

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

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

  2. 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.

  3. 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.

  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

Test plan

  • make lint passes
  • make type-check passes
  • Unit tests pass
  • Manual testing: verify tool CRUD operations reflect immediately without stale data

Fixes langgenius#30322

🤖 Generated with Claude Code
Original PR URL: langgenius#30323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants