You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@burr.apache.org by "Eilen6316 (via GitHub)" <gi...@apache.org> on 2026/08/30 12:00:06 UTC
[PR] fix(core): consume iterate inputs once [burr]
Eilen6316 opened a new pull request, #908:
URL: https://github.com/apache/burr/pull/908
Fix repeated external inputs across iterative execution APIs.
## Changes
- Consume inputs only on the first step of iterate and aiterate.
- Apply the same behavior to stream_iterate and astream_iterate.
- Preserve inputs for first-step halt-before, retries, and resumed failed positions.
- Update human-in-the-loop documentation and regression coverage.
## How I tested this
- pytest -q tests/core/test_application.py (147 passed)
- black, isort, flake8, and Python AST checks passed on changed files.
## Notes
This changes behavior for callers that relied on external inputs being forwarded to later actions in the same run.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@burr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(core): consume iterate inputs once [burr]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #908:
URL: https://github.com/apache/burr/pull/908#issuecomment-6266922224
This PR has been inactive for 14 days after receiving review feedback.
Converting to draft.
Please mark it as ready for review when you have addressed the comments.
If no activity occurs within 90 days, it will be closed automatically.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@burr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(core): consume iterate inputs once [burr]
Posted by "sangkyoonnam (via GitHub)" <gi...@apache.org>.
sangkyoonnam commented on code in PR #908:
URL: https://github.com/apache/burr/pull/908#discussion_r4178409337
##########
tests/core/test_application.py:
##########
@@ -2178,21 +2193,132 @@ def test_iterate_with_inputs():
graph=Graph(
actions=[counter_action, result_action],
transitions=[
- Transition(counter_action, counter_action, Condition.expr("count < 2")),
Transition(counter_action, result_action, default),
Review Comment:
The loop this test had never ran a second `counter` step, since the first step already makes `count` 11. A test where the input-driven action runs twice would pin down the new behavior for self-loops.
##########
tests/core/test_application.py:
##########
@@ -2350,7 +2519,7 @@ def test_run_with_inputs():
def test_run_with_inputs_multiple_actions():
- """Tests that inputs aren't popped off and are passed through to multiple actions."""
+ """Inputs supplied to run are consumed by its first action only."""
Review Comment:
The old docstring said inputs "aren't popped off and are passed through to multiple actions", from 742b596a. Linking that commit in the Notes would help reviewers see the history.
##########
burr/core/application.py:
##########
@@ -1296,10 +1296,12 @@ def iterate(
result = None
prior_action: Optional[Action] = None
+ step_inputs = inputs
while self.has_next_action():
# self.step will only return None if there is no next action, so we can rely on tuple unpacking
- prior_action, result, state = self.step(inputs=inputs)
+ prior_action, result, state = self.step(inputs=step_inputs)
yield prior_action, result, state
+ step_inputs = {}
Review Comment:
Resetting here also drops inputs for a self-loop. This is the shape of the hello-world-counter example (excerpt):
```python
.with_transitions(("counter", "counter", expr("counter < 10")), ("counter", "result", default))
app.run(halt_after=["result"], inputs={"increment_by": 1})
```
On head the second `counter` step raises `missing required inputs` for `increment_by`. If this goes ahead, the example and the pydantic tests need updating in this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@burr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org