Repository navigation
Fix common.ai managed agent failover when an identity cannot resolve - #72786
Merged
Lee-W merged 3 commits intoOct 8, 2026
Merged
Conversation
kaxil
reviewed
Sep 9, 2026
Lee-W
added a commit
to astronomer/airflow
that referenced
this pull request
Sep 10, 2026
Incrementing after the call returned made ``managed_agent.invoked`` a count of answers, which is a misleading denominator: a total outage still increments ``managed_agent.failover`` while ``invoked`` stays flat, so the documented ratio climbs fastest exactly when the group has stopped answering, and there is nothing to divide by when nothing succeeds at all. Counting attempts also matches what the name says. A failover group never consumes its own ``timeout``, so accepting one and silently dropping it left the author to discover the gap from a note they may never read. The group now rejects it and points at the members, alongside the validation it already does for too few members. The metrics table the docs send readers to still described two counters and listed the wrong tags for the two it had. Raised in review of apache#72786.
Lee-W
force-pushed
the
common-ai-managed-agent-review-followup
branch
from
September 10, 2026 03:59
a28ba4c to
307b2f2
Compare
Lee-W
added a commit
to astronomer/airflow
that referenced
this pull request
Sep 11, 2026
Incrementing after the call returned made ``managed_agent.invoked`` a count of answers, which is a misleading denominator: a total outage still increments ``managed_agent.failover`` while ``invoked`` stays flat, so the documented ratio climbs fastest exactly when the group has stopped answering, and there is nothing to divide by when nothing succeeds at all. Counting attempts also matches what the name says. A failover group never consumes its own ``timeout``, so accepting one and silently dropping it left the author to discover the gap from a note they may never read. The group now rejects it and points at the members, alongside the validation it already does for too few members. The metrics table the docs send readers to still described two counters and listed the wrong tags for the two it had. Raised in review of apache#72786.
Lee-W
force-pushed
the
common-ai-managed-agent-review-followup
branch
from
September 11, 2026 10:11
307b2f2 to
9f0c538
Compare
Lee-W
added a commit
to astronomer/airflow
that referenced
this pull request
Sep 16, 2026
Incrementing after the call returned made ``managed_agent.invoked`` a count of answers, which is a misleading denominator: a total outage still increments ``managed_agent.failover`` while ``invoked`` stays flat, so the documented ratio climbs fastest exactly when the group has stopped answering, and there is nothing to divide by when nothing succeeds at all. Counting attempts also matches what the name says. A failover group never consumes its own ``timeout``, so accepting one and silently dropping it left the author to discover the gap from a note they may never read. The group now rejects it and points at the members, alongside the validation it already does for too few members. The metrics table the docs send readers to still described two counters and listed the wrong tags for the two it had. Raised in review of apache#72786.
Lee-W
force-pushed
the
common-ai-managed-agent-review-followup
branch
from
September 16, 2026 13:42
9f0c538 to
896743b
Compare
Lee-W
added a commit
to astronomer/airflow
that referenced
this pull request
Sep 17, 2026
Incrementing after the call returned made ``managed_agent.invoked`` a count of answers, which is a misleading denominator: a total outage still increments ``managed_agent.failover`` while ``invoked`` stays flat, so the documented ratio climbs fastest exactly when the group has stopped answering, and there is nothing to divide by when nothing succeeds at all. Counting attempts also matches what the name says. A failover group never consumes its own ``timeout``, so accepting one and silently dropping it left the author to discover the gap from a note they may never read. The group now rejects it and points at the members, alongside the validation it already does for too few members. The metrics table the docs send readers to still described two counters and listed the wrong tags for the two it had. Raised in review of apache#72786.
Lee-W
force-pushed
the
common-ai-managed-agent-review-followup
branch
from
September 17, 2026 07:15
896743b to
70f8fab
Compare
Lee-W
added a commit
to astronomer/airflow
that referenced
this pull request
Sep 17, 2026
Incrementing after the call returned made ``managed_agent.invoked`` a count of answers, which is a misleading denominator: a total outage still increments ``managed_agent.failover`` while ``invoked`` stays flat, so the documented ratio climbs fastest exactly when the group has stopped answering, and there is nothing to divide by when nothing succeeds at all. Counting attempts also matches what the name says. A failover group never consumes its own ``timeout``, so accepting one and silently dropping it left the author to discover the gap from a note they may never read. The group now rejects it and points at the members, alongside the validation it already does for too few members. The metrics table the docs send readers to still described two counters and listed the wrong tags for the two it had. Raised in review of apache#72786.
Lee-W
force-pushed
the
common-ai-managed-agent-review-followup
branch
from
September 17, 2026 07:56
70f8fab to
e32f86d
Compare
Lee-W
added a commit
to astronomer/airflow
that referenced
this pull request
Sep 17, 2026
Incrementing after the call returned made ``managed_agent.invoked`` a count of answers, which is a misleading denominator: a total outage still increments ``managed_agent.failover`` while ``invoked`` stays flat, so the documented ratio climbs fastest exactly when the group has stopped answering, and there is nothing to divide by when nothing succeeds at all. Counting attempts also matches what the name says. A failover group never consumes its own ``timeout``, so accepting one and silently dropping it left the author to discover the gap from a note they may never read. The group now rejects it and points at the members, alongside the validation it already does for too few members. The metrics table the docs send readers to still described two counters and listed the wrong tags for the two it had. Raised in review of apache#72786.
Lee-W
force-pushed
the
common-ai-managed-agent-review-followup
branch
from
September 17, 2026 08:08
e32f86d to
f5a1c02
Compare
Lee-W
added a commit
to astronomer/airflow
that referenced
this pull request
Sep 17, 2026
Incrementing after the call returned made ``managed_agent.invoked`` a count of answers, which is a misleading denominator: a total outage still increments ``managed_agent.failover`` while ``invoked`` stays flat, so the documented ratio climbs fastest exactly when the group has stopped answering, and there is nothing to divide by when nothing succeeds at all. Counting attempts also matches what the name says. A failover group never consumes its own ``timeout``, so accepting one and silently dropping it left the author to discover the gap from a note they may never read. The group now rejects it and points at the members, alongside the validation it already does for too few members. The metrics table the docs send readers to still described two counters and listed the wrong tags for the two it had. Raised in review of apache#72786.
Lee-W
force-pushed
the
common-ai-managed-agent-review-followup
branch
from
September 17, 2026 08:14
f5a1c02 to
30363e2
Compare
Lee-W
added a commit
to astronomer/airflow
that referenced
this pull request
Sep 17, 2026
Incrementing after the call returned made ``managed_agent.invoked`` a count of answers, which is a misleading denominator: a total outage still increments ``managed_agent.failover`` while ``invoked`` stays flat, so the documented ratio climbs fastest exactly when the group has stopped answering, and there is nothing to divide by when nothing succeeds at all. Counting attempts also matches what the name says. A failover group never consumes its own ``timeout``, so accepting one and silently dropping it left the author to discover the gap from a note they may never read. The group now rejects it and points at the members, alongside the validation it already does for too few members. The metrics table the docs send readers to still described two counters and listed the wrong tags for the two it had. Raised in review of apache#72786.
Lee-W
force-pushed
the
common-ai-managed-agent-review-followup
branch
from
September 17, 2026 08:44
30363e2 to
a06c0e9
Compare
Lee-W
marked this pull request as ready for review
September 17, 2026 08:54
Lee-W
requested review from
amoghrajesh,
ashb,
gopidesupavan and
potiuk
as code owners
September 17, 2026 08:54
Lee-W
added a commit
to astronomer/airflow
that referenced
this pull request
Sep 18, 2026
Incrementing after the call returned made ``managed_agent.invoked`` a count of answers, which is a misleading denominator: a total outage still increments ``managed_agent.failover`` while ``invoked`` stays flat, so the documented ratio climbs fastest exactly when the group has stopped answering, and there is nothing to divide by when nothing succeeds at all. Counting attempts also matches what the name says. A failover group never consumes its own ``timeout``, so accepting one and silently dropping it left the author to discover the gap from a note they may never read. The group now rejects it and points at the members, alongside the validation it already does for too few members. The metrics table the docs send readers to still described two counters and listed the wrong tags for the two it had. Raised in review of apache#72786.
Lee-W
force-pushed
the
common-ai-managed-agent-review-followup
branch
from
September 18, 2026 09:18
3ded16f to
133d869
Compare
kaxil
reviewed
Sep 18, 2026
Lee-W
added a commit
to astronomer/airflow
that referenced
this pull request
Sep 24, 2026
Incrementing after the call returned made ``managed_agent.invoked`` a count of answers, which is a misleading denominator: a total outage still increments ``managed_agent.failover`` while ``invoked`` stays flat, so the documented ratio climbs fastest exactly when the group has stopped answering, and there is nothing to divide by when nothing succeeds at all. Counting attempts also matches what the name says. A failover group never consumes its own ``timeout``, so accepting one and silently dropping it left the author to discover the gap from a note they may never read. The group now rejects it and points at the members, alongside the validation it already does for too few members. The metrics table the docs send readers to still described two counters and listed the wrong tags for the two it had. Raised in review of apache#72786.
Lee-W
force-pushed
the
common-ai-managed-agent-review-followup
branch
from
September 24, 2026 06:22
133d869 to
52bf53c
Compare
Lee-W
added a commit
to astronomer/airflow
that referenced
this pull request
Sep 30, 2026
Incrementing after the call returned made ``managed_agent.invoked`` a count of answers, which is a misleading denominator: a total outage still increments ``managed_agent.failover`` while ``invoked`` stays flat, so the documented ratio climbs fastest exactly when the group has stopped answering, and there is nothing to divide by when nothing succeeds at all. Counting attempts also matches what the name says. A failover group never consumes its own ``timeout``, so accepting one and silently dropping it left the author to discover the gap from a note they may never read. The group now rejects it and points at the members, alongside the validation it already does for too few members. The metrics table the docs send readers to still described two counters and listed the wrong tags for the two it had. Raised in review of apache#72786.
Lee-W
force-pushed
the
common-ai-managed-agent-review-followup
branch
3 times, most recently
from
October 4, 2026 14:09
a4e5d4b to
3f2d2f2
Compare
An operator watching these counters has no way to interpret an "unknown" platform bucket on their dashboard, and it is precisely the case this change introduced: identity resolution failed, a warning was logged, and the invocation went out anyway. Without it written down the bucket looks like a broken vendor name rather than a pointer back to the task log.
_resolve_agent_ref() wraps the identity lookup in a bare except Exception so a subclass's broken agent_ref only costs a logged warning instead of failing a call that already succeeded. That catch-all reached too far: pydantic-ai's ModelRetry is control flow the calling model raises on purpose, not a resolution failure, and this module already re-raises it everywhere else agent_ref or invoke can produce one. Left unguarded, a model's own retry request would have been silently discarded as yet another "identity unresolved" warning.
guan404ming
approved these changes
Oct 8, 2026
guan404ming
reviewed
Oct 8, 2026
…to a warning _resolve_agent_ref() runs after invoke() has already produced an answer, and no agent_ref implementation raises ModelRetry (only invoke_sync does, when the client rejects a request). The except ModelRetry branch could therefore never be reached, and if it were, re-raising would discard a good answer. Remove it so every identity lookup failure is logged and resolved to None.
Lee-W
force-pushed
the
common-ai-managed-agent-review-followup
branch
from
October 8, 2026 09:00
3f2d2f2 to
3770cf4
Compare
This was referenced Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Follow-up to review comments on #71946.
When identity resolution fails, a warning is logged and the invocation still goes out, tagged with the literal platform
unknown. An operator watching the counters has no way to interpret that bucket, so it looks like a broken vendor name rather than a pointer back to the task log.What
docs/toolsets/managed_agent.rst: explain thatplatformcan be"unknown"(connection lookup failed, or a bug in the subclass'sagent_ref), that the call proceeds anyway, and that the task log warning at the same timestamp says why.metrics_template.yaml: reword themanaged_agent.serveddescription to say the same thing.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines
🤖 Generated with Claude Code