Drop stale observation fields during overlay

This commit is contained in:
2569718930@qq.com
2026-06-15 23:32:47 +08:00
parent 3984e12c44
commit ed0447f408
2 changed files with 13 additions and 3 deletions
+2 -3
View File
@@ -423,12 +423,11 @@ def _observation_source_code(block: Any) -> str:
def _merge_latest_observation_block(base_block: Any, latest_block: Dict[str, Any]) -> Dict[str, Any]:
base = dict(base_block) if isinstance(base_block, dict) else {}
latest_source = _observation_source_code(latest_block)
base_source = _observation_source_code(base)
if base_source and latest_source and base_source != latest_source:
if latest_source:
base = {
key: value
for key, value in base.items()
if key not in _SOURCE_BOUND_OBSERVATION_FIELDS
if key not in _SOURCE_BOUND_OBSERVATION_FIELDS or key in latest_block
}
return {**base, **latest_block}