Skip to content

Document how common.ai agent tasks recover from provider and worker failures - #74708

Merged
kaxil merged 1 commit into
apache:mainfrom
astronomer:commonai-recovery-docs
Oct 14, 2026
Merged

kaxil merged 1 commit into
apache:mainfrom
astronomer:commonai-recovery-docs

Conversation

@kaxil

@kaxil kaxil commented Oct 14, 2026

Copy link
Copy Markdown
Member

The common.ai docs describe fallback_conn_ids and durable=True on separate pages, but nothing tells a platform owner what an agent task actually survives. This adds a "Recovering from failures" page under Reliability and operations. A table gives, per failure (provider error or timeout, whole chain down, worker lost or execution_timeout), the setting that handles it and whether the steps the agent already completed are kept, replayed or run again. A new example Dag combines the two settings, and the page ends with what neither covers.

The claim most likely to surprise a reviewer is that a failover continues an agent run rather than restarting it. FallbackModel fails over per model request, and pydantic-ai sends the run's whole message history with every request, so the standby receives every tool result and no tool runs again. This was checked against real models (OpenAI gpt-5-mini and Anthropic claude-sonnet-5), with the primary made to fail after a fixed number of requests:

Scenario Result
OpenAI answers two steps, then fails Claude's first request carried both tool results; each tool ran once
Claude, with thinking on, answers two steps, then fails OpenAI continued from Claude's history; each tool ran once
durable=True, whole chain fails on attempt 1 Attempt 2 replayed the step OpenAI answered, sent no OpenAI request, finished on Claude
Same, with the chain reordered between attempts Nothing replayed; the tool ran again

The last row is why the page warns that editing fallback_conn_ids between attempts discards the journal: the model in a step's fingerprint is the whole chain. The log block on the page comes from airflow dags test of the new example with the primary pointed at a port nothing listens on.

Two corrections to existing pages ride along, because the new page links to them. provider_fallback.rst and retry_policies.rst said a 30-second timeout across three connections is a 90-second worst case; the OpenAI and Anthropic SDKs retry a timed-out request twice, so it is up to 270 seconds. provider_fallback.rst also said a malformed prompt costs "N timeouts"; a 400 comes back at once and neither SDK retries it.


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

…ailures

Add a "Recovering from failures" page that states, per failure, which
setting handles it and whether completed steps are kept, replayed or run
again, with a runnable example combining fallback_conn_ids and
durable=True. Correct the timeout cost of a fallback chain in the
provider fallback and retry policy pages: the OpenAI and Anthropic SDKs
retry a timed-out request twice, and a rejected 400 is not retried.
@kaxil
kaxil merged commit 64c207d into apache:main Oct 14, 2026
85 checks passed
@kaxil
kaxil deleted the commonai-recovery-docs branch October 14, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants