What this thread does
Pass task_timeout to Pydantic Evals and choose explicitly whether a timed-out attempt may retry.
What changed
The 2.63.0 release adds a timeout for each task attempt. PyPI lists 2.63.0 uploaded October 28, 2026, MIT, Python >=3.11; checked 2026-10-28.
Do first: python -m pip show pydantic-evals
1. Check python -m pip show pydantic-evals. This recipe targets 2.63.0. 2. Find whether the delay happens inside the task, a lifecycle hook, or an evaluator. task_timeout covers the task only. 3. On your existing dataset and async task, start with a deadline appropriate to your workload. The following 30 seconds and three attempts are example policy choices:
from tenacity import retry_if_not_exception_type, stop_after_attempt
report = dataset.evaluate_sync(
task,
task_timeout=30,
retry_task={
'stop': stop_after_attempt(3),
'retry': retry_if_not_exception_type(TimeoutError),
'reraise': True,
},
)
4. Use a deliberately slow async task in a disposable evaluation. Expect its failure to appear in report.failures while other cases finish. Then verify one ordinary exception still follows your retry policy.
The official retry guide documents this combination. Backoff time is outside the per-attempt timeout, so this does not impose a deadline on the whole dataset.
Diagnostic: TimeoutError: Task timed out after 30s
This is the documented deadline failure for the example setting. Check the failure report before increasing the deadline; a slow evaluator needs a separate timeout.
Choose the retry policy
| Option | What it is for; when it wins | When it loses; limit checked 2026-10-28 | Pick this if |
|---|---|---|---|
Deadline, excluding TimeoutError retries | Fail a slow attempt once | A transient timeout gets no second chance | You need predictable case completion |
| Deadline, with bounded timeout retries | Recover from transient stalls | Each retry can spend another full task allowance | You can afford repeated work |
| Provider/client deadline as well | Stop the underlying call where supported | Requires client-specific configuration | The task includes blocking I/O |
PR #10291 explains that synchronous tasks run in worker threads: the evaluation can stop waiting, but Python cannot interrupt that thread. It can continue alongside a retry, outside max_concurrency accounting. Use positive finite deadlines; hooks, evaluators and online evaluation are outside this feature's scope. No provider charge reduction is guaranteed by a task deadline.
Recommendation by constraint
For a solo experiment, start with an async task and no timeout retry. For a small team's CI, use the same policy plus a total job deadline. For enterprise batch work, also enforce the downstream client's deadline and review whether retries can repeat side effects. These are policy recommendations.
Evidence
In issue #2904, baek54321 wrote “the evaluation gets stuck at around 98%” on September 16, 2025. Their September 19 follow-up reports success with an explicit timeout wrapper; it does not test 2.63.0. David Montague (dmontagu), PR #10291, October 15, 2026, describes an “opt-in per-attempt timeout”; merged October 27.
Prompt for your agent
Find the evaluation entry point, distinguish task time from evaluator time, set an explicit task deadline and bounded retries, and demonstrate that a stalled async case fails while another case completes. Report whether any synchronous work continues after cancellation.
Mistakes
Do not treat a retry stop condition as cancellation of a running attempt. Do not assume a failed evaluation cancels a provider's billable work. Do not raise concurrency to hide abandoned synchronous tasks.
Limits
No evaluation or provider request was run. The older issue also discusses unrelated multiprocessing errors; this recipe does not resolve those. This is a feature setup recipe, not a complete dependency migration from an earlier supported version.
Started from a post by @dmontagu, packaged by the editor. Original post