`initialize_from(resume_at_next_action=False)` does not go back to the entrypoint
Los mantenedores suelen responder en 4 días
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 70/100
Línea de trabajo
Start in ApplicationBuilder._init_state_from_persister, where the resume_at_next_action=False branch is a bare pass, and check how __PRIOR_STEP in the loaded state drives get_next_action(). Compare with the failed-status branch that already calls reset_to_entrypoint(). Done when a persister-backed app built with False starts at counter with its loaded state intact, a test covers this with InMemoryPersister, and docs/concepts/state-persistence.rst matches the behavior.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
With resume_at_next_action=False, loading from a persister behaves the same as True: the app continues after the saved step instead of starting at default_entrypoint.
Current behavior
After loading, get_next_action() returns the action after the last saved step, whether resume_at_next_action is True or False.
Steps to replicate behavior
from burr.core import ApplicationBuilder, State, action, default
from burr.core.persistence import InMemoryPersister
@action(reads=[], writes=["count"])
def counter(state: State) -> State:
return state.update(count=state.get("count", 0) + 1)
@action(reads=["count"], writes=[])
def done(state: State) -> State:
return state
persister = InMemoryPersister()
def build(resume_at_next_action):
return (
ApplicationBuilder()
.with_actions(counter=counter, done=done)
.with_transitions(("counter", "done", default))
.initialize_from(
persister,
resume_at_next_action=resume_at_next_action,
default_state={},
default_entrypoint="counter",
)
.with_identifiers(app_id="app", partition_key="pk")
.with_state_persister(persister)
.build()
)
build(True).step() # runs "counter" and saves it
for flag in (True, False):
app = build(flag)
print(f"resume_at_next_action={flag}: next action = {app.get_next_action().name}")
Output:
resume_at_next_action=True: next action = done
resume_at_next_action=False: next action = done
Library & System Information
apache-burr 0.43.0 and main (222b32c3), Python 3.13, macOS
Expected behavior
docs/concepts/state-persistence.rst describes it as "whether to start where you left off, or go back to the default_entrypoint", so with False the next action should be counter, keeping the loaded state.
Additional context
In ApplicationBuilder._init_state_from_persister the False branch is just pass ("self.start is already set to the default"), but the loaded state still has __PRIOR_STEP, and get_next_action() uses it. The existing tests that use False load from a fake loader or from the local tracker, and neither has __PRIOR_STEP in the loaded state, so they don't catch this. For the same reason the local tracker isn't affected, only persisters (in-memory, SQLite, etc.).
With False, the starting point also depends on how many times a step failed: after one failed attempt the app starts at the failed action, after two at the entrypoint, because the failed-status path removes __PRIOR_STEP when it restarts the action. I mentioned this on the dev list durable-execution thread: https://lists.apache.org/thread/3xp1mfozrxtrc0w8oqh0xh5lgt22kvwj
I'm opening a PR with a fix (calling reset_to_entrypoint() there, like the failed-status branch already does) and tests. If the current behavior is intended, I'm happy to update the docs instead.
- Lenguaje dominante
- Python
- Estrellas
- 2.6k
- Forks
- 212
- Merge medio
- 5 d 14 h
- PR fusionados (30 d)
- 39
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/burr
-
Notebook UI launcher should use the current Python interpreterPosiblemente ocupada @sivakumar-mahalingam la tomó hace 18 días. Abiertostatus/needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 4 días
-
astep() passes unprocessed inputs to pre_run_step hooksPosiblemente ocupada @sivakumar-mahalingam la tomó hace 18 días. Abiertostatus/needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 4 días
-
`burr` fails to start when the Python path has a space in itPosiblemente ocupada @enekoreto la tomó hace 21 días. Abiertostatus/needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 4 días
-
Add more instructions for applying ORM migrations for S3 deploymentPosiblemente ocupada @ShryukGrandhi la tomó hace 6 días. Abiertoarea/storage area/ui help wanted kind/documentation priority/low
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
apache/burr#524 · 11 comentarios ·
Los mantenedores suelen responder en 4 días
-
Add documentation on how to run the Burr UI serverPosiblemente ocupada @enu-emu la tomó hace 141 días. Abiertoarea/ui good first issue kind/documentation priority/low
Dificultad 2/5 Medio día Aptitud para principiantes 68/100
apache/burr#272 · 5 comentarios ·
Los mantenedores suelen responder en 4 días
Todos los issues de apache/burr
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
cline/mcp-marketplace#3576 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
griptape-ai/griptape-nodes-library-elevenlabs#30 ·
Los mantenedores suelen responder en 1 día
-
docs: Release playbookAbiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
awslabs/social-messaging-agent-runtime-toolkit#140 ·
Los mantenedores suelen responder en 1 día
-
subtask
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
fga-eps-mds/2026.2-MeasureSoftGram-DOC#187 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
NSPG13/agent-bounties#1747 ·
Los mantenedores suelen responder en 1 día