run Agent With Retries
Re-samples the agent: runs it up to maxAttempts times, returning the first attempt whose outcome satisfies until (default RunUntil.SOLVED). The intended use is intentional re-sampling — e.g. bootstrap demonstration generation — not transient-failure recovery.
Transient-failure retries are applied automatically inside each call to runAgent per the session's retry configuration. Each re-sample attempt therefore completes with either a success or a non-transient failure (the inner retry layer has already absorbed transient blips before this function sees the result). To opt out of inner transient retries for a specific call — e.g., to count transient-failed attempts as full samples — pass innerRetryPolicy = RetryPolicy.None (which the inner runAgent will use instead of the session-default policy).
Parameters
override for the transient-retry policy applied inside each re-sample attempt. null (default) = use the session's retry configuration policy. RetryPolicy.None = disable inner transient retries for this call.
Runs the agent up to maxAttempts times, creating a fresh agent per attempt via agentProvider.
innerRetryPolicy mirrors the overload above — overrides the inner transient-retry policy applied inside each runAgent call.