Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

This PR migrates resume_flow_run from the @sync_compatible decorator to the @async_dispatch pattern, following the approach established in #19632.

Changes:

  • Create aresume_flow_run as the explicit async implementation
  • Convert resume_flow_run to a sync function decorated with @async_dispatch(aresume_flow_run)
  • Export aresume_flow_run from main.py and __init__.py
  • Add tests for both sync and async code paths
  • Add None checks for flow_run.state and response.state for robustness (previously would raise AttributeError if state was None)

Review notes:

  • The None checks on lines 474 and 480 (async) and 498 and 504 (sync) are new defensive additions - the original code assumed state was always present
  • Tests verify the async dispatch behavior but don't test the full success path for resuming a paused flow (requires deployment setup)

Closes #15008 (partial - this is one function in the incremental migration)

Link to Devin run: https://app.devin.ai/sessions/b9cefdf38a744dfd8403c97230ef5cd1
Requested by: Nate Nowack ([email protected]) / @zzstoatzz

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
  • If this pull request adds new functionality, it includes unit tests that cover the changes
  • If this pull request removes docs files, it includes redirect settings in mint.json.
  • If this pull request adds functions or classes, it includes helpful docstrings.

This change follows the pattern established in PR #19632 to migrate
resume_flow_run from the @sync_compatible decorator to the @async_dispatch
pattern.

Changes:
- Create aresume_flow_run as the explicit async implementation
- Create resume_flow_run as the sync implementation with @async_dispatch
- Export aresume_flow_run from main.py and __init__.py
- Add tests for both sync and async code paths
- Add None checks for flow_run.state and response.state for robustness

Related to #15008

Co-Authored-By: Nate Nowack <[email protected]>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions github-actions bot added the enhancement An improvement of an existing feature label Dec 15, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 15, 2025

CodSpeed Performance Report

Merging #19792 will not alter performance

Comparing devin/1765821659-migrate-resume-flow-run-async-dispatch (ffa9331) with main (97d3356)

Summary

✅ 2 untouched

@zzstoatzz zzstoatzz marked this pull request as ready for review December 15, 2025 21:39
@zzstoatzz zzstoatzz merged commit ba81af8 into main Dec 15, 2025
61 checks passed
@zzstoatzz zzstoatzz deleted the devin/1765821659-migrate-resume-flow-run-async-dispatch branch December 15, 2025 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Synchronous and asynchronous compatibility within Prefect

3 participants