Skip to content

Commit 8fc6128

Browse files
shukladivyanshcopybara-github
authored andcommitted
fix: Fix out of bounds error in _run_async_impl
PiperOrigin-RevId: 834492696
1 parent 679d543 commit 8fc6128

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 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)