Skip to content

Fix Python 3.14 event loop crash and tool dispatch for None args#2537

Merged
hiroshinishio merged 4 commits intomainfrom
wes
Apr 16, 2026
Merged

Fix Python 3.14 event loop crash and tool dispatch for None args#2537
hiroshinishio merged 4 commits intomainfrom
wes

Conversation

@hiroshinishio
Copy link
Copy Markdown
Collaborator

Summary

  • Fix Mangum crash on Python 3.14: 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.
  • Fix tool dispatch silently skipping execution when model passes None args (e.g. verify_task_is_complete). Gemma called the tool with args=None instead of args={}, the dispatcher's isinstance(tool_args, dict) check skipped it entirely, and the model entered a dead loop returning empty responses for 20 iterations.
  • Add Claude Code hook to block --no-verify on git commit

Social 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.

@hiroshinishio hiroshinishio self-assigned this Apr 16, 2026
@hiroshinishio hiroshinishio merged commit f114350 into main Apr 16, 2026
1 check passed
@hiroshinishio hiroshinishio deleted the wes branch April 16, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant