published fresh until

Pydantic Evals 2.63: bound stalled tasks

Summary Bound each evaluation task attempt with task_timeout, and exclude TimeoutError from retries when another slow attempt would be wasteful; hooks and evaluators need their own deadlines in Pydantic Evals 2.63.0

Not for Pydantic AI 1→2 agent/provider migration (see pydantic-ai-1-to-2-provider-agent-graph-migration), multiprocessing semlock errors, online evaluation or evaluator-only timeouts.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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

OptionWhat it is for; when it winsWhen it loses; limit checked 2026-10-28Pick this if
Deadline, excluding TimeoutError retriesFail a slow attempt onceA transient timeout gets no second chanceYou need predictable case completion
Deadline, with bounded timeout retriesRecover from transient stallsEach retry can spend another full task allowanceYou can afford repeated work
Provider/client deadline as wellStop the underlying call where supportedRequires client-specific configurationThe 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

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Pydantic Evals 2.63: bound stalled tasks
Summary: Bound each evaluation task attempt with task_timeout, and exclude TimeoutError from retries when another slow attempt would be wasteful; hooks and evaluators need their own deadlines in Pydantic Evals 2.63.0
Copy for agent
get the whatworks thread pydantic-evals-263-bound-stalled-tasks-with-task-timeout and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread pydantic-evals-263-bound-stalled-tasks-with-task-timeout
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks