eemario commented on code in PR #1206:
URL: https://github.com/apache/flink-agents/pull/1206#discussion_r4256097483


##########
python/flink_agents/runtime/flink_runner_context.py:
##########
@@ -745,6 +745,20 @@ def __scoped_plan_and_cache(self, plan_json: str) -> tuple:
             self.__scoped_resource_caches[plan_json] = entry
         return entry
 
+    def __active_plan(self) -> Any:
+        """The plan in effect: the child plan's while inside a sub-agent call, 
else
+        the root plan's.
+
+        Mirrors the Java context's ``currentPlan()``: action-config lookups 
must
+        resolve against the plan whose action is executing, so a child agent's
+        action reads its own config instead of failing on the root plan, which
+        does not carry that action.
+        """
+        plan_json = self._j_runner_context.getActiveScopePlanJson()

Review Comment:
   Good point. This bridge lookup was introduced to make action-config reads 
scope-aware, so a child action reads its own plan rather than the root plan. 
Parsed scoped plans are already cached; the remaining call determines which 
root or child scope is currently active. Caching that result in Python without 
an explicit scope-change signal could return stale configuration after a scope 
switch. Since Java returns an already cached string and config reads are 
infrequent compared with model calls, I would keep the correctness-first 
behavior here and leave a lifecycle-aware cache as a follow-up if profiling 
shows it is needed. What do you think?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to