Skip to content

fix(execution): enter and exit context manager resources per item in EACH mode (#124) - #125

Merged
mvallebr merged 3 commits into
mainfrom
fix/issue-124-each-mode-cm-resources
Jul 28, 2026
Merged

fix(execution): enter and exit context manager resources per item in EACH mode (#124)#125
mvallebr merged 3 commits into
mainfrom
fix/issue-124-each-mode-cm-resources

Conversation

@mvallebr

Copy link
Copy Markdown
Contributor

Summary

Fixes #124 where context-manager resources in EACH-mode steps were entered once before the first item and exited once after the last item, instead of wrapping each individual item invocation.

Changes

  • Sync & Async argument builders: defer context manager resolution when step mode is EACH
  • Sync & Async step runners: wrap per-item execution with ExitStack / AsyncExitStack inside generate()
  • Sync & Async executors: pass deferred_resources map to step runners
  • Documentation: update resources.md with EACH mode per-item resource lifecycle rules

Tests

  • Added sync unit tests in test_runner_each_resource_lifecycle.py
  • Added async unit tests in test_async_runner_each_resource_lifecycle.py
  • Verified test parity gate (test_parity.py) and sync/async parity suites

Marcelo Elias Del Valle added 3 commits July 28, 2026 01:32
…EACH mode (#124)

### Summary
Fixes #124 where context-manager resources in EACH-mode steps were entered once before the first item and exited once after the last item, instead of wrapping each individual item invocation.

### Changes
- Sync & Async argument builders: defer context manager resolution when step is in EACH mode
- Sync & Async step runners: wrap item execution with ExitStack / AsyncExitStack inside generate()
- Sync & Async executors: pass deferred_resources map down to step runners
- Documentation: update resources.md with EACH mode per-item resource lifecycle rules

### Tests
- Added sync unit tests in test_runner_each_resource_lifecycle.py
- Added async unit tests in test_async_runner_each_resource_lifecycle.py
- Verified test parity gate (test_parity.py) and sync/async parity suites
@mvallebr
mvallebr merged commit a23e491 into main Jul 28, 2026
5 checks passed
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.

Context manager resources are entered/exited once per step, not per item in EACH mode

1 participant