Lee-W commented on code in PR #72786:
URL: https://github.com/apache/airflow/pull/72786#discussion_r4052553822


##########
providers/common/ai/src/airflow/providers/common/ai/toolsets/managed_agent.py:
##########
@@ -234,6 +283,14 @@ async def call_tool(
     ) -> Any:
         ref = self.agent_ref
         log.info("Consulting managed agent %s on %s", ref.get("name"), 
ref.get("platform"))
+        # Emitted before invoke() runs, not after -- an attempt, not an answer,
+        # so a total outage still moves this counter and it stays the right
+        # per-tool denominator for managed_agent.failover even when nothing
+        # succeeds at all.
+        Stats.incr(
+            "managed_agent.invoked",
+            tags={"tool": self._tool_name, "platform": ref.get("platform", 
"unknown")},

Review Comment:
   `test_call_tool_tags_unknown_when_agent_ref_omits_platform` covers a 
subclass whose `agent_ref` returns a dict with no `platform` key. 
   
   The default moved while doing this. `call_tool` reads the identity through 
the same `_normalize_agent_ref` the group path uses, which also settles a 
disagreement one line up: `log.info` had no fallback while the tag did, so a 
subclass omitting `platform` was reported as `platform=unknown` and logged as 
`None` in the same call. The identity is still read unmediated, so a raise 
still fails the call rather than going out under an `unknown` tag.
   



-- 
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