Skip to content

Commit 5843105

Browse files
committed
fix(3298): add ModelRetry error as non-retryable to return control back to agent on tool failure
1 parent cedee4a commit 5843105

File tree

1 file changed

+2
-1
lines changed
  • pydantic_ai_slim/pydantic_ai/durable_exec/temporal

1 file changed

+2
-1
lines changed

pydantic_ai_slim/pydantic_ai/durable_exec/temporal/_agent.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from pydantic_ai.agent import AbstractAgent, AgentRun, AgentRunResult, EventStreamHandler, WrapperAgent
2727
from pydantic_ai.agent.abstract import Instructions, RunOutputDataT
2828
from pydantic_ai.builtin_tools import AbstractBuiltinTool
29-
from pydantic_ai.exceptions import UserError
29+
from pydantic_ai.exceptions import ModelRetry, UserError
3030
from pydantic_ai.models import Model
3131
from pydantic_ai.output import OutputDataT, OutputSpec
3232
from pydantic_ai.result import StreamedRunResult
@@ -112,6 +112,7 @@ def __init__(
112112
*(retry_policy.non_retryable_error_types or []),
113113
UserError.__name__,
114114
PydanticUserError.__name__,
115+
ModelRetry.__name__,
115116
]
116117
activity_config['retry_policy'] = retry_policy
117118
self.activity_config = activity_config

0 commit comments

Comments
 (0)