Skip to content

fix: isolate citation registries per pipeline - #487

Open
ump45nose wants to merge 1 commit into
OpenBMB:mainfrom
ump45nose:agent/citation-registry-isolation
Open

fix: isolate citation registries per pipeline#487
ump45nose wants to merge 1 commit into
OpenBMB:mainfrom
ump45nose:agent/citation-registry-isolation

Conversation

@ump45nose

Copy link
Copy Markdown

Summary

  • isolate citation state behind a unique registry ID for each LightResearch pipeline run
  • pass that ID through the generated tool metadata and release the registry when the pipeline completes
  • add a focused regression test that interleaves two runs and verifies their citation counters remain independent

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 -q
  • ultrarag build examples/demos/LightResearch.yaml
  • generated MCP metadata smoke for init, assign, and clear tool contracts
  • ruff check --select I,F,E9 tests/test_citation_registry.py
  • ruff check --select I servers/custom/src/custom.py

Fixes #394

@ump45nose
ump45nose marked this pull request as ready for review August 12, 2026 06:57
@ump45nose

Copy link
Copy Markdown
Author

@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 servers/custom/src/custom.py and the related demo pipelines, could you take a look when convenient?

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.

Bug: CitationRegistry global state causes cross-request citation contamination

1 participant