Fix Python 3.14 event loop crash and tool dispatch for None args#2537
Merged
hiroshinishio merged 4 commits intomainfrom Apr 16, 2026
Merged
Fix Python 3.14 event loop crash and tool dispatch for None args#2537hiroshinishio merged 4 commits intomainfrom
hiroshinishio merged 4 commits intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
asyncio.get_event_loop()no longer creates implicit event loops, causing every webhook invocation to fail with RuntimeError. Ensure one exists before calling mangum_handler.Noneargs (e.g.verify_task_is_complete). Gemma called the tool withargs=Noneinstead ofargs={}, the dispatcher'sisinstance(tool_args, dict)check skipped it entirely, and the model entered a dead loop returning empty responses for 20 iterations.--no-verifyon git commitSocial Media Post (GitAuto)
Two silent failures in one deploy. Python 3.14 removed implicit event loop creation, crashing every webhook through our ASGI adapter. And when a model passed None instead of empty dict as tool args, the dispatcher skipped execution entirely. The model got a None result back, went blank, and burned 20 iterations doing nothing. Both were one-line-level fixes hidden behind hours of log reading.
Social Media Post (Wes)
Spent an hour reading CloudWatch logs for a bug that was five lines to fix. Python 3.14 changed asyncio.get_event_loop() to raise instead of creating a loop. Our webhook adapter used the old pattern. Schedule triggers worked fine since they bypass the adapter. Then found a second bug: when the model passes None instead of {} as tool args, we silently skip the tool call. The model gets None back and gives up. Two invisible failures, two small fixes.