44import random
55import time
66from datetime import datetime , timezone
7- from typing import TYPE_CHECKING , Any , Callable , Dict , Optional , Sequence
7+ from typing import Any , Callable , Dict , Optional , Sequence
88
99from dapr .clients .grpc ._state import Concurrency , Consistency , StateOptions
1010from pydantic import BaseModel , ValidationError
1414 AgentRegistryConfig ,
1515 AgentStateConfig ,
1616 DEFAULT_AGENT_WORKFLOW_BUNDLE ,
17+ StateModelBundle ,
1718)
1819from dapr_agents .agents .schemas import AgentWorkflowEntry
1920from dapr_agents .storage .daprstores .stateservice import StateStoreError
2021from dapr_agents .types .workflow import DaprWorkflowStatus
2122
22- if TYPE_CHECKING :
23- from dapr_agents .agents .configs import StateModelBundle
24-
2523logger = logging .getLogger (__name__ )
2624
2725
@@ -46,7 +44,7 @@ def __init__(
4644 registry : Optional [AgentRegistryConfig ] = None ,
4745 base_metadata : Optional [Dict [str , Any ]] = None ,
4846 max_etag_attempts : int = 10 ,
49- default_bundle : Optional [" StateModelBundle" ] = None ,
47+ default_bundle : Optional [StateModelBundle ] = None ,
5048 ) -> None :
5149 """
5250 Initialize component wiring.
@@ -84,6 +82,9 @@ def __init__(
8482
8583 bundle = None
8684 if state is not None :
85+ # Allow default_bundle to override the state's bundle. This enables
86+ # orchestrators and agents to share the same AgentStateConfig instance
87+ # while each using their own specialized state model schemas.
8788 if default_bundle is not None :
8889 state .ensure_bundle (default_bundle )
8990 try :
0 commit comments