mirror of
https://github.com/langgenius/dify.git
synced 2026-10-04 13:47:55 +08:00
FINDING 1 (dataset visibility): DatasetService.get_datasets requires user parameter and silently omits ONLY_ME/PARTIAL_TEAM datasets on RBAC tenants. Query Dataset model directly by tenant_id for complete grounding inventory. FINDING 2 (normalization guard): Move fetch+normalize inside _safe to prevent malformed records from raising after _safe returns. Use lambda builders to wrap complete resource transformation including record normalization. FINDING 3 (test coverage): Add test_mixed_failure_partial_success (one source fails, others succeed) and test_malformed_tool_record_degrades (missing tool_name key gracefully degrades). Minor: compute model id once and reuse for both id and label fields; ensure E302 two blank lines between test functions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>