Skip to content

Commit 4f54660

Browse files
google-genai-botcopybara-github
authored andcommitted
fix: Update the code to work with either 1 event or more than 1 events
Update the code to work with either 1 event or more than 1 events. PiperOrigin-RevId: 842406345
1 parent ee743bd commit 4f54660

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/google/adk/agents/llm_agent.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,10 +469,7 @@ async def _run_async_impl(
469469

470470
if ctx.is_resumable:
471471
events = ctx._get_events(current_invocation=True, current_branch=True)
472-
if events and (
473-
ctx.should_pause_invocation(events[-1])
474-
or ctx.should_pause_invocation(events[-2])
475-
):
472+
if events and any(ctx.should_pause_invocation(e) for e in events[-2:]):
476473
return
477474
# Only yield an end state if the last event is no longer a long running
478475
# tool call.

0 commit comments

Comments
 (0)