Background
While building the SDK test-build coverage branch, a contract test showed that ComponentDiscoveryEngine.components is shared across engine instances.
Reproducer
first = ComponentDiscoveryEngine()
second = ComponentDiscoveryEngine()
first.load_component_manifest('tool.yaml', no_save=False)
assert second.get_components_by_kind('Tool') == []
Expected: each discovery engine instance should have an isolated registry.
Actual: second can see components loaded by first, because components is defined as a class variable.
Risk
- Multiple plugin/blueprint discovery runs in one process can leak component state into each other.
- Tests become order-dependent.
- Plugin reload or multi-plugin scans may produce duplicate or stale component lists.
Test Signal
Locked in test-build as an xfail(strict=True) contract test:
tests/utils/test_discovery.py::test_component_registry_should_be_isolated_per_engine_instance
No source fix is included in the test-build branch.
Background
While building the SDK
test-buildcoverage branch, a contract test showed thatComponentDiscoveryEngine.componentsis shared across engine instances.Reproducer
Expected: each discovery engine instance should have an isolated registry.
Actual:
secondcan see components loaded byfirst, becausecomponentsis defined as a class variable.Risk
Test Signal
Locked in
test-buildas anxfail(strict=True)contract test:tests/utils/test_discovery.py::test_component_registry_should_be_isolated_per_engine_instanceNo source fix is included in the test-build branch.