Support frozen Render `Retry` options in the snapshot test

Merged
DS
1mo ago
+2-1

This pull request was posted by Claude Code using claude-opus-5-5 on behalf of David.

Closes #12338

Render 1.7.0 makes Retry a frozen dataclass. The task-options snapshot test fails while changing max_retries, before it reaches its assertion. Replace the retry value through the mutable Options object with dataclasses.replace(); the existing rejection assertion remains in place.

This changes test setup only. Public behavior and the render>=1.2.0 dependency range stay the same. Docs N/A: no public API or behavior change.

Verification on Python 3.12:

  • Reproduced the original pass with Render 1.2.0 and FrozenInstanceError with 1.7.0.
  • The changed test file passes all 9 tests with Render 1.7.0 and BlockBuster enabled.
  • Render suite: 155 passed, 3 existing external-runtime skips on both 1.2.0 and 1.7.0, using the canary's BLOCKBUSTER_ENABLED=false.
  • Focused Pyright passes on both SDK versions; make format lint and the pre-commit complexity hook pass.
  • A separate MCP metadata-import BlockBuster failure in an isolated Render-only run also reproduces on unchanged main.
  • After merging main, the changed test file passes all 9 tests on Render 1.2.0 and 1.7.0.
PR decisions

2026-11-03 · pre-push review 1 of 3 at 370a74429f063869dd4ffef7e8c0387f4edad1f7 · iter -

2026-11-03 · Keep the fix in the test setup · iter -

  • Decision: Replace the frozen Retry value inside mutable Options; leave runtime code and dependency ranges unchanged
  • Why: Current main passes with Render 1.2.0 and fails only during test setup with 1.7.0; the existing UserError snapshot assertion passes after replacement
  • Source: https://github.com/pydantic/pydantic-ai/issues/12338
  • Session: 01a1a073-1e66-74ad-92cb-caf46ccd80fa

2026-11-03 · pre-push review 1 of 3 at 370a74429f063869dd4ffef7e8c0387f4edad1f7 · iter -

2026-11-03 · adopted PR #12339 at 2026-11-03 · iter -

  • Decision: Branch-context bootstrapped from existing PR + issue(s). Decisions prior to this entry are backfilled from resolved threads.
  • Why: PR predates the branch-context setup
  • Source: https://github.com/pydantic/pydantic-ai/pull/12339
  • Session: c86fe447-01d1-4f8b-8ec3-61d2ecef9637

2026-11-03 · exempt delta at 81075bf2588567f966b46af3d7a6bcbd767bb45f · iter -

2026-11-03 · Package Label failures on 370a744 superseded · iter -

  • Decision: No rerun; both failed runs were label-event runs from an intermediate label state, and the later label-event run passed
  • Why: Job 125803766193 failed before any pkg label existed; job 125811033077 failed while test-suite and bug were both set; job 125811468212 passed on the final labels
  • Source: https://github.com/pydantic/pydantic-ai/actions/runs/41604679937/job/125811468212
  • Session: c86fe447-01d1-4f8b-8ec3-61d2ecef9637

2026-11-03 · Sprites stderr-timeout failure on 81075bf treated as new flake · iter -

2026-11-03 · douwebot label and draft state owners · iter -

  • Decision: Agent applies douwebot once the current head is green and self-reviewed; the PR stays draft until David marks it ready
  • Why: David chose 'Workers label it' and: 'Do not mark a draft PR ready: David does that himself.'
  • Source: https://github.com/pydantic/pydantic-ai/pull/12339
  • Session: c86fe447-01d1-4f8b-8ec3-61d2ecef9637

2026-11-03 · final metadata check at 81075bf · iter -

2026-11-03 · second-opinion review surface · iter -

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.

Summary by cubic

Closes #12338: fixes the task-options snapshot test to work with Render 1.7.0, where Retry is now a frozen dataclass.

Render 1.7.0 makes Retry immutable, so the test's max_retries mutation raised FrozenInstanceError before reaching its assertion. The test now replaces the Retry value inside the mutable Options object with dataclasses.replace(), keeping the existing rejection assertion intact. This is a test-setup-only change; public behavior and the render>=1.2.0 dependency range are unchanged.