Background
While continuing the SDK test-build coverage work, a runtime container roundtrip test found that PluginContainer.from_dict() does not preserve install metadata emitted by PluginContainer.model_dump().
Reproducer
container = PluginContainer(
install_source='marketplace',
install_info={'id': 'tester/demo'},
...
)
restored = PluginContainer.from_dict(container.model_dump())
assert restored.install_source == 'marketplace'
assert restored.install_info == {'id': 'tester/demo'}
Expected: serialized container metadata roundtrips.
Actual: from_dict() does not pass install_source or install_info, so the restored container falls back to default empty values.
Risk
- Plugin install provenance can be lost after persistence/cache roundtrip.
- Runtime management, upgrades, diagnostics, or marketplace-origin logic may make decisions with missing metadata.
model_dump() and from_dict() are not inverse operations.
Test Signal
Locked in test-build as an xfail(strict=True) contract test:
tests/runtime/plugin/test_container.py::test_plugin_container_roundtrip_should_preserve_install_metadata
No source fix is included in the test-build branch.
Background
While continuing the SDK
test-buildcoverage work, a runtime container roundtrip test found thatPluginContainer.from_dict()does not preserve install metadata emitted byPluginContainer.model_dump().Reproducer
Expected: serialized container metadata roundtrips.
Actual:
from_dict()does not passinstall_sourceorinstall_info, so the restored container falls back to default empty values.Risk
model_dump()andfrom_dict()are not inverse operations.Test Signal
Locked in
test-buildas anxfail(strict=True)contract test:tests/runtime/plugin/test_container.py::test_plugin_container_roundtrip_should_preserve_install_metadataNo source fix is included in the test-build branch.