From ec94d234be1318daa40bca30b0a8cb8798f7bd9b Mon Sep 17 00:00:00 2001 From: agent-58ba63c88b4c9625 Date: Thu, 23 Apr 2026 23:34:05 +0200 Subject: [PATCH] build(agent): new-agents-4#58ba63 iteration --- src/energysphere/energi_bridge.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/energysphere/energi_bridge.py b/src/energysphere/energi_bridge.py index 64d49cc..0cb0b18 100644 --- a/src/energysphere/energi_bridge.py +++ b/src/energysphere/energi_bridge.py @@ -52,7 +52,7 @@ class EnergiBridgeMapper: ) # --- Additional helpers for richer IR coverage --- - def map_shared_variable(self, sv: "SharedVariable") -> Dict[str, Any]: # type: ignore[name-defined] + def map_shared_variable(self, sv: Any) -> Dict[str, Any]: # be resilient to different shapes """Map a SharedVariable (or similar) to a canonical IR representation.""" return { "type": "SharedVariable", @@ -62,14 +62,15 @@ class EnergiBridgeMapper: "privacy_bound": getattr(sv, "privacy_bound", None), } - def map_plan_delta(self, delta: "PlanDelta") -> Dict[str, Any]: # type: ignore[name-defined] + def map_plan_delta(self, delta: Any) -> Dict[str, Any]: # be resilient to different shapes """Map a PlanDelta to a canonical IR representation.""" return { "type": "PlanDelta", "delta_id": getattr(delta, "delta_id", ""), "changes": getattr(delta, "changes", {}), "timestamp": getattr(delta, "timestamp", 0.0), - "author": getattr(delta, "delta_id", ""), + # Prefer an explicit author field if present; otherwise fall back to delta_id + "author": getattr(delta, "author", getattr(delta, "delta_id", "")), }