Skip to content

Fix async step persistence for synchronous actions - #895

Merged
jernejfrank merged 3 commits into
apache:mainfrom
Eilen6316:fix/astep-sync-persistence-state
Aug 29, 2026
Merged

Fix async step persistence for synchronous actions#895
jernejfrank merged 3 commits into
apache:mainfrom
Eilen6316:fix/astep-sync-persistence-state

Conversation

@Eilen6316

Copy link
Copy Markdown
Contributor

Summary

When Application.astep() executes a synchronous action, it now forwards the action result and updated state returned by _step() to the async post-step hooks.

This prevents async persisters from saving the pre-step state as completed and ensures lifecycle hooks observe the actual result and state.

Testing

  • tests/core/test_application.py: 138 passed
  • tests/core excluding optional Graphviz display tests: 390 passed
  • flake8 burr/core/application.py tests/core/test_application.py

The two Graphviz display tests require the optional graphviz Python package, which is not installed in the test environment.

@github-actions github-actions Bot added the area/core Application, State, Graph, Actions label Aug 19, 2026

@jernejfrank jernejfrank left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, just the one minor thing to keep the code clean. Looks good otherwise

Comment thread burr/core/application.py Outdated
return self._step(
output = self._step(
inputs=inputs, _run_hooks=False
) # Skip hooks as we already ran all of them/will run all of them in this function's finally

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is out of place now, would be good to document inline here as well that we want to run async hooks for things like async persisters saving state of sync steps

@jernejfrank

Copy link
Copy Markdown
Contributor

Could you also run pre-commit hooks please?

@Eilen6316

Copy link
Copy Markdown
Contributor Author

Sure! I’ll clarify the comment inline and run the pre-commit hooks, then push an update. Thanks!

@jernejfrank
jernejfrank merged commit 49e7770 into apache:main Aug 29, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Application, State, Graph, Actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants