LightRAG/lightrag
BukeLy fe1576943f fix: Add default workspace support for backward compatibility
Fixes two compatibility issues in workspace isolation:

1. Problem: lightrag_server.py calls initialize_pipeline_status()
   without workspace parameter, causing pipeline to initialize in
   global namespace instead of rag's workspace.

   Solution: Add set_default_workspace() mechanism in shared_storage.
   LightRAG.initialize_storages() now sets default workspace, which
   initialize_pipeline_status() uses when called without parameters.

2. Problem: /health endpoint hardcoded to use "pipeline_status",
   cannot return workspace-specific status or support frontend
   workspace selection.

   Solution: Add LIGHTRAG-WORKSPACE header support. Endpoint now
   extracts workspace from header or falls back to server default,
   returning correct workspace-specific pipeline status.

Changes:
- lightrag/kg/shared_storage.py: Add set/get_default_workspace()
- lightrag/lightrag.py: Call set_default_workspace() in initialize_storages()
- lightrag/api/lightrag_server.py: Add get_workspace_from_request() helper,
  update /health endpoint to support LIGHTRAG-WORKSPACE header

Testing:
- Backward compatibility: Old code works without modification
- Multi-instance safety: Explicit workspace passing preserved
- /health endpoint: Supports both default and header-specified workspaces

Related: #2353
(cherry picked from commit 18a4870229)
2025-12-04 19:11:16 +08:00
..
api fix: Add default workspace support for backward compatibility 2025-12-04 19:11:16 +08:00
evaluation feat(evaluation): Add sample documents for reproducible RAGAS testing 2025-12-04 19:11:09 +08:00
kg fix: Add default workspace support for backward compatibility 2025-12-04 19:11:16 +08:00
llm Refactor keyword_extraction from kwargs to explicit parameter 2025-12-04 19:11:09 +08:00
models tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
services tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
tools Improve LightRAG initialization checker tool with better usage docs 2025-12-04 19:09:05 +08:00
__init__.py Bump core version to 1.4.9.1 2025-09-28 15:25:02 +08:00
base.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
constants.py fix: sync core modules with upstream for compatibility 2025-12-04 19:10:46 +08:00
exceptions.py Add Qdrant legacy collection migration with workspace support 2025-12-04 19:11:15 +08:00
lightrag.py fix: Add default workspace support for backward compatibility 2025-12-04 19:11:16 +08:00
namespace.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
operate.py Improve error handling and add cancellation checks in pipeline 2025-12-04 19:11:15 +08:00
prompt.py Improve prompt clarity by standardizing terminology and formatting 2025-09-28 13:31:55 +08:00
rerank.py Fix trailing whitespace and update test mocking for rerank module 2025-12-04 19:11:14 +08:00
security.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
tenant_rag_manager.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
types.py
utils.py Remove ascii_colors dependency and fix stream handling errors 2025-12-04 19:11:13 +08:00
utils_context.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
utils_graph.py Improve entity merge logging by removing redundant message and fixing typo 2025-12-04 19:09:02 +08:00