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
This commit is contained in:
Google Team Member
2025-12-09 14:47:57 -08:00
committed by Copybara-Service
parent ee743bd19a
commit 4f54660d6d
+1 -4
View File
@@ -469,10 +469,7 @@ class LlmAgent(BaseAgent):
if ctx.is_resumable:
events = ctx._get_events(current_invocation=True, current_branch=True)
if events and (
ctx.should_pause_invocation(events[-1])
or ctx.should_pause_invocation(events[-2])
):
if events and any(ctx.should_pause_invocation(e) for e in events[-2:]):
return
# Only yield an end state if the last event is no longer a long running
# tool call.