Jump to solution
Verify

The Fix

pip install pydantic==2.6.0

Based on closed pydantic/pydantic issue #8530 · PR/commit linked

Jump to Verify Open PR/Commit
@@ -1319,8 +1319,12 @@ print(error_locations) ## Required fields -To declare a field as required, you may declare it using just an annotation, or you may use `Ellipsis`/`...` -as the value: +To declare a field as required, you may declare it using an annotation, or an annotation in combination with a `Field` specification.
repro.py
from pydantic import validate_call @validate_call def validate_foo(a: int, b: int): def foo(): print("Inside foo") return a + b return foo def main(): foo = validate_foo(a=1, b=2) print("Before calling foo") print(foo()) main()
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Upgrade to fixed release\npip install pydantic==2.6.0\nWhen NOT to use: This fix is not applicable if pre-validation is not required for your function calls.\n\nOption C — Workaround\nto the docs.\nWhen NOT to use: This fix is not applicable if pre-validation is not required for your function calls.\n\n

Why This Fix Works in Production

  • Trigger: A solution right now is to create BaseModel that copy the function signature, but this is done manually so it take time and is error prone.
  • Mechanism: The validate_call feature did not support pre-validation of function arguments before execution
  • Why the fix works: Added documentation for validating function arguments before calling the function, addressing issue #8530. (first fixed release: 2.6.0).

Why This Breaks in Prod

  • The validate_call feature did not support pre-validation of function arguments before execution
  • Production symptom (often without a traceback): A solution right now is to create BaseModel that copy the function signature, but this is done manually so it take time and is error prone.

Proof / Evidence

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“@samsja, Thanks for suggesting this feature”
@sydney-runkle · 2024-01-10 · source
“Here's an approach you can take right now:”
@alexmojaki · 2024-01-10 · source
“@samsja, Great! Glad to hear you worked it out”
@sydney-runkle · 2024-01-12 · source
“TBC I think it'd be better to document an example similar to https://github.com/pydantic/pydantic/issues/8530#issuecomment-1885573821 rather than suggesting people write code involving things like __pydantic_validator__ which may…”
@alexmojaki · 2024-01-12 · source

Failure Signature (Search String)

  • A solution right now is to create BaseModel that copy the function signature, but this is done manually so it take time and is error prone.
  • - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)
Copy-friendly signature
signature.txt
Failure Signature ----------------- A solution right now is to create BaseModel that copy the function signature, but this is done manually so it take time and is error prone. - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- A solution right now is to create BaseModel that copy the function signature, but this is done manually so it take time and is error prone. - [ ] [Compatibility between releases](https://docs.pydantic.dev/changelog/)

Minimal Reproduction

repro.py
from pydantic import validate_call @validate_call def validate_foo(a: int, b: int): def foo(): print("Inside foo") return a + b return foo def main(): foo = validate_foo(a=1, b=2) print("Before calling foo") print(foo()) main()

What Broke

Users experienced delays due to late validation of function arguments after resource-intensive operations.

Why It Broke

The validate_call feature did not support pre-validation of function arguments before execution

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install pydantic==2.6.0

When NOT to use: This fix is not applicable if pre-validation is not required for your function calls.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Option C — Workaround Temporary workaround

to the docs.

When NOT to use: This fix is not applicable if pre-validation is not required for your function calls.

Use only if you cannot change versions today. Treat this as a stopgap and remove once upgraded.

Option D — Guard side-effects with OnceOnly Guardrail for side-effects

Mitigate duplicate external side-effects under retries/timeouts/agent loops by gating the operation before calling external systems.

  • Place OnceOnly between your code/agent and real side-effects (Stripe, emails, CRM, APIs).
  • Use a stable key per side-effect (e.g., customer_id + action + idempotency_key).
  • Fail-safe: configure fail-open vs fail-closed based on blast radius and spend risk.
Show example snippet (optional)
onceonly.py
from onceonly import OnceOnly import os once = OnceOnly(api_key=os.environ["ONCEONLY_API_KEY"], fail_open=True) # Stable idempotency key per real side-effect. # Use a request id / job id / webhook delivery id / Stripe event id, etc. event_id = "evt_..." # replace key = f"stripe:webhook:{event_id}" res = once.check_lock(key=key, ttl=3600) if res.duplicate: return {"status": "already_processed"} # Safe to execute the side-effect exactly once. handle_event(event_id)

See OnceOnly SDK

When NOT to use: Do not use this to hide logic bugs or data corruption. Use it to block duplicate external side-effects and enforce tool permissions/spend caps.

Fix reference: https://github.com/pydantic/pydantic/pull/8645

First fixed release: 2.6.0

Last verified: 2026-02-09. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix is not applicable if pre-validation is not required for your function calls.
  • Do not use this to hide logic bugs or data corruption. Use it to block duplicate external side-effects and enforce tool permissions/spend caps.

Verify Fix

verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.

Did This Fix Work in Your Case?

Quick signal helps us prioritize which fixes to verify and improve.

Prevention

  • Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
  • Upgrade behind a canary and run integration tests against the canary before 100% rollout.

Version Compatibility Table

VersionStatus
2.6.0 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.