Lee-W opened a new pull request, #72786:
URL: https://github.com/apache/airflow/pull/72786
Follow-up to review comments on #71946.
`agent_ref` exists only to label a call for logs and metrics, but it was
resolved eagerly and unguarded. A failover group resolves *every* member's
identity, so one misconfigured standby — usually on a different cloud from the
primary — failed the whole tool call before the healthy primary was ever tried
(`group.invoke(prompt)` worked while `group.call_tool(...)` raised
`RuntimeError: Connection 'azure_standby' not found`). The same gap made
failover itself depend on identity resolution.
- `_safe_agent_ref` degrades a failed identity lookup to a warning, so
identity resolution can no longer pre-empt or bypass failover. Applied at the
four sites that resolve a ref: `call_tool`, the group's own `agent_ref`, and
both lookups in the group's `invoke`.
- `timeout` is now a public read-only property. The base class still never
enforces it — honouring it is the implementation's job, like `agent_ref` — but
a subclass no longer has to reach into another package's private `_timeout`.
- New `managed_agent.invoked` counter, emitted from the shared `call_tool`
for both a lone toolset and a group, giving `managed_agent.failover` a
denominator. `managed_agent.served` and `managed_agent.failover` are untouched.
- Docs now state that a member's `tool_name` / `description` / `max_retries`
are inert inside a group, that a group's own `timeout` is inert too, and that
`managed_agent.invoked` and `managed_agent.served` do not share a population.
##### Test plan
11 new unit tests, each mutation-checked (the corresponding fix reverted,
the named assertion confirmed red, then restored). `providers/common/ai`
toolsets suite: 323 passed. mypy, ruff, and both prek stages clean.
<!-- SPDX-License-Identifier: Apache-2.0
https://www.apache.org/licenses/LICENSE-2.0 -->
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Opus 5)
Generated-by: Claude Code (Opus 5) following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]