Skip to content

feat(core): add get_prior_action() to Application#800

Open
section9-lab wants to merge 1 commit into
apache:mainfrom
section9-lab:feat/get-prior-action
Open

feat(core): add get_prior_action() to Application#800
section9-lab wants to merge 1 commit into
apache:mainfrom
section9-lab:feat/get-prior-action

Conversation

@section9-lab

Copy link
Copy Markdown

Summary

Adds Application.get_prior_action() as the symmetric counterpart to get_next_action().

  • Returns the Action that was executed in the most recent step
  • Returns None when no step has been executed yet (application is at its entrypoint)
  • The data already exists in state under __PRIOR_STEP; this simply exposes it as a first-class public API

Closes #502

Changes

  • burr/core/application.py: add get_prior_action() next to get_next_action()
  • tests/core/test_application.py: add test_app_get_prior_step() mirroring the existing test_app_get_next_step()

Test plan

  • test_app_get_prior_step — verifies None before any step, then correct action name after each step() call
  • Existing test_app_get_next_step still passes

Adds the symmetric counterpart to get_next_action(). The data already
lives in state under __PRIOR_STEP -- this exposes it as a public API.

Returns None when no step has been executed yet (app at entrypoint).

Closes apache#502
@github-actions github-actions Bot added the area/core Application, State, Graph, Actions label Jun 5, 2026
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.

Get last run action from application object

1 participant