Skip to content

[test-build] ComponentDiscoveryEngine shares component registry across instances #56

@huanghuoguoguo

Description

@huanghuoguoguo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions