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