fix: isolate citation registries per pipeline - #487
Conversation
|
@xhd0728 This focused LightResearch concurrency fix is ready for review. It scopes citation registries by pipeline-run ID, carries that ID through generated tool metadata, and releases the registry on completion; the regression interleaves two runs and verifies independent counters. The focused pytest, pipeline build, MCP metadata smoke, and targeted Ruff checks pass. Since you maintain and review |
|
Thanks for the fix! The registry isolation works in our interleaved-request tests, but further testing found two issues:
Could you move cleanup into a guaranteed lifecycle/finally path that preserves the generated result and handles failures and cancellation? Please also add regression tests for these cases before merging. |
Summary
Root cause
init_citation_registry()reset a class-level dictionary shared by every request. Starting a second pipeline therefore erased the first pipeline's in-progress citation mappings.Validation
pytest -p no:cacheprovider tests/test_citation_registry.py -qultrarag build examples/demos/LightResearch.yamlruff check --select I,F,E9 tests/test_citation_registry.pyruff check --select I servers/custom/src/custom.pyFixes #394