Skip to content

fix(flows): use inspect.iscoroutinefunction for action handlers - #6467

Open
maoxor wants to merge 2 commits into
pipecat-ai:mainfrom
maoxor:inspect-iscoroutinefunction
Open

maoxor wants to merge 2 commits into
pipecat-ai:mainfrom
maoxor:inspect-iscoroutinefunction

Conversation

@maoxor

@maoxor maoxor commented Oct 29, 2026 •

Copy link
Copy Markdown

Please describe the changes in your PR. If it is addressing an issue, please reference that as well.

ActionManager in pipecat/flows/actions.py decides whether to await a custom action handler with asyncio.iscoroutinefunction. That function is deprecated since Python 3.14 and slated for removal in 3.16. So every custom action on 3.14+ emits a DeprecationWarning, and on 3.16 running a custom action would raise AttributeError. This switches both checks (flow-manager-aware handlers and legacy single-argument handlers) to inspect.iscoroutinefunction, the documented replacement (inspect was already imported). For handlers, both functions give the same result on 3.11+.

What I ran. The flag is -W "error:'asyncio.iscoroutinefunction':DeprecationWarning:pipecat.flows.actions":

test_flows_actions.py, test_flows_manager.py, test_flows_flow.py main this branch
3.14 + flag 13 failed, 86 passed 99 passed
3.11 + flag 99 passed
  • Full suite (uv run pytest) on 3.14: 9103 passed, 71 skipped.
  • ruff check / ruff format --check: clean.
  • Changelog fragment: changelog/6467.fixed.md.

maoxor added a commit to maoxor/pipecat that referenced this pull request Oct 29, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
asyncio.iscoroutinefunction is deprecated since Python 3.14 and slated
for removal in 3.16. The action manager called it for every custom
action it ran.
@maoxor
maoxor force-pushed the inspect-iscoroutinefunction branch from 06446a4 to 1154f14 Compare October 29, 2026 16:01

This branch has not been deployed

No deployments
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