In this article
Require each fallback to appear once in the run's accounting where the documented behavior applies.
Pydantic AI v2.77.0, released November 27, counts fallback XSearch and ImageGeneration sub-agent requests toward run usage and UsageLimits. This describes those fallback paths. Provider charges and application budgets still need their own reconciliation.
What the source establishes
A request can complete a main turn while also dispatching a fallback. A policy based only on top-level model calls can miss part of the work performed for that turn. Keep the model, task and tool definitions fixed while you change the session behavior.
Design the comparison
In staging use a benign request with a deterministic fallback condition and one without a fallback. Record the run ID, attempt IDs and usage callbacks. Repeat with a limit close to ordinary consumption. Use simulated state and authorized no-op tools for the decision points in the example. Trace the structured result as well as the visible text.
Read the results
Compare aggregate requests, registered budget events and per-attempt usage. Look for delayed accounting and duplicate entries. Interpret a stopped run alongside the usage captured before stopping. Check exactly which state the next turn receives. Classify decisions made by the runtime separately from those made by the model. Collect the primary outcome together with a measure of workload size. Preserve errors, timeouts and explicit fallbacks in the reported population. A median from successful samples can conceal a subgroup that operates on a different path. Store enough diagnostic context for another engineer to explain which part of the system caused the difference.
Decide what goes into service
Require each fallback to appear once in the run’s accounting where the documented behavior applies. Compare the application’s limit decisions against the provider invoice separately. State the acceptance threshold before choosing the implementation. Add the tested boundary and conditions for revisiting it to the release record. If an observed behavior differs from expectations, narrow the scope of the rollout while collecting evidence for that case. Keep the prior artifact or configuration available so the comparison remains repeatable.
Sources
Related reading
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.