File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -164,19 +164,16 @@ def _load_agent_state(
164164 ctx : InvocationContext ,
165165 state_type : Type [AgentState ],
166166 ) -> Optional [AgentState ]:
167- """Loads the agent state from the invocation context, handling resumption .
167+ """Loads the agent state from the invocation context.
168168
169169 Args:
170170 ctx: The invocation context.
171171 state_type: The type of the agent state.
172172
173173 Returns:
174- The current state if resuming , otherwise None.
174+ The current state if exists , otherwise None.
175175 """
176- if not ctx .is_resumable :
177- return None
178-
179- if self .name not in ctx .agent_states :
176+ if ctx .agent_states is None or self .name not in ctx .agent_states :
180177 return None
181178 else :
182179 return state_type .model_validate (ctx .agent_states .get (self .name ))
You can’t perform that action at this time.
0 commit comments