Skip to content

Commit 9bbfb72

Browse files
committed
Yield and clear tasks before any explicit yield
1 parent 259d1aa commit 9bbfb72

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

samples-v2/openai_agents/durable_decorators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def wrapper(durable_orchestration_context: DurableOrchestrationContext):
2525
while True:
2626
try:
2727
# send whatever was sent into us down to the subgenerator
28+
yield from durable_ai_agent_context.yield_and_clear_tasks()
2829
sent = yield value
2930
except GeneratorExit:
3031
# ensure the subgenerator is closed

0 commit comments

Comments
 (0)