Ignore `max_retries` in OpenAI, Anthropic and Gemini batch requests instead of raising `UserError`
Part of #9334 (no closing keyword: this is a prerequisite, not the fix).
The OpenAI, Anthropic and Gemini batch encoders raised UserError whenever ModelSettings['max_retries'] was present. A batched request is run by the provider itself, so no SDK client retries it and the setting has nothing to apply to. It is now ignored silently, as we do for other settings that don't apply. timeout, extra_headers and the other per-request options that a batch genuinely can't honor still raise.
This matters for #9334: the RetryOnModelErrors capability sets max_retries=0 so that it is the only retry owner, and with the old behavior any agent combining it with BatchModelRequests failed. An agent-level or run-level max_retries set for the non-batched requests hit the same error.
docs/batch.mdno longer saysmax_retriesraises.- Each provider's batch tests now check that encoding with
max_retries=0gives the same request as encoding without it. Against the old code, all three raised theUserError.
Checklist
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
- PR title is fit for the release changelog.
š¤ Generated with Claude Code