A streamed generation fails mid-way.
When is it safe to silently fall back to another provider?
- AAny time during the stream
- BOnly before the first chunk has been sent
- CNever fall back
- DOnly after the stream finished
Answer: B
Only before the first chunk has been sent
Why
Once partial output has streamed to the user, a silent fallback would replay/garble it. Fall back only before the first chunk.
- Errors & recoveryA tool call returns HTTP 400 “invalid parameter: date must be ISO-8601”.
- Errors & recoveryYour fleet of agents all hit a 429 rate-limit at once and every one immediately retries on a fixed 1-second timer.
- Errors & recoveryAn agent processes a batch of 100 records.
- Errors & recoveryA payment tool times out.
More on Way of the Agent
- Course programThe first three modules are free: start in the browser or the app, no card needed.
- Library: guides, skills and promptsReady prompt templates, grouped into collections.
- AI ChroniclesSourced stories from the history of AI.
- ConceptsPlain-language explainers of agent engineering.
- Learn AI agentsApps and courses for learning AI agents, compared honestly.
Real situations from building agents - with the answer and why.
Solve a new one every day on the Path