enekoreto opened a new pull request, #1021:
URL: https://github.com/apache/burr/pull/1021

   `initialize_from(..., resume_at_next_action=False)` kept the loaded 
`__PRIOR_STEP`, so the app continued from where it left off instead of starting 
at `default_entrypoint`.
   
   Closes #1020
   
   ## Changes
   
   - In `_init_state_from_persister`, the `False` branch now calls 
`reset_to_entrypoint()`, like the failed-status branch already does. That 
clears `__PRIOR_STEP`; the rest of the loaded state is kept.
   
   ## How I tested this
   
   - Added `test_initialize_from_resume_at_next_action` (sync, 
`InMemoryPersister`) and an async version (`AsyncInMemoryPersister`). The 
`False` cases fail on main and pass here, the `True` cases pass on both.
   - Also checked by hand: forking, resuming after a failed step, 
`override_state_values`, SQLite, and the local tracker as the loader. With 
`True` nothing changes; with the tracker nothing changes either, since it never 
saves `__PRIOR_STEP`.
   - Full test suite and pre-commit pass, on Python 3.13 and 3.10.
   
   ## Notes
   
   The existing tests that use `False` load from a fake loader or the local 
tracker, neither of which has `__PRIOR_STEP` in the loaded state, which is why 
this wasn't caught before.
   
   Compatibility: this only changes apps that load from a persister with 
`resume_at_next_action=False`. They now start at `default_entrypoint`, as 
`state-persistence.rst` documents. `True` and the local tracker behave as 
before. Burr's own examples and notebooks that pass `False` 
(multi-modal-chatbot, streaming-fastapi, the templates, conversational-rag) 
load from the tracker, so they don't change, and their comments ("always resume 
from entrypoint in the case of failure") already describe the new behavior.
   
   This was done with AI assistance (Claude Code), and checked by running the 
tests described above.
   
   ## Checklist
   
   - [x] PR has an informative and human-readable title (this will be pulled 
into the release notes)
   - [x] Changes are limited to a single goal (no scope creep)
   - [x] Code passed the pre-commit check & code is left cleaner/nicer than 
when first encountered.
   - [x] Any _change_ in functionality is tested
   - [ ] New functions are documented (with a description, list of inputs, and 
expected output)
   - [ ] Placeholder code is flagged / future TODOs are captured in comments
   - [ ] Project documentation has been updated if adding/changing 
functionality.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to