Skip to content

Restore outer ApplicationContext after nested execution - #867

Open
MrlixiangWE wants to merge 6 commits into
apache:mainfrom
MrlixiangWE:fix/application-context-nesting
Open

Restore outer ApplicationContext after nested execution#867
MrlixiangWE wants to merge 6 commits into
apache:mainfrom
MrlixiangWE:fix/application-context-nesting

Conversation

@MrlixiangWE

@MrlixiangWE MrlixiangWE commented Aug 2, 2026

Copy link
Copy Markdown

Problem

ApplicationContext.__exit__() clears the current context instead of restoring
the previous one. When an application runs another application from an action,
exiting the inner application leaves the outer action without its context.

Before / after

Before: after inner_app.run(), ApplicationContext.get() returns None in
the outer action.

After: exiting the inner application restores the outer application's context.

Verification

  • .venv/bin/pytest tests/core/test_application.py -k 'context' -q
  • .venv/bin/pre-commit run --files burr/core/application.py tests/core/test_application.py
  • .venv/bin/python -m build

@github-actions github-actions Bot added the area/core Application, State, Graph, Actions label Aug 2, 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.

1 participant