astep() passes unprocessed inputs to pre_run_step hooks
Los mantenedores suelen responder en 4 días
@sivakumar-mahalingam ya está trabajando en esto.
Desde el 18/10/2026.
- #980 de @sivakumar-mahalingam — abierto
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Lee las implementaciones síncrona de _step() y asíncrona de _astep(), prestando atención a dónde se ejecuta _process_inputs() en relación con pre_run_step. Añade o adapta pruebas para las entradas procesadas y para las entradas obligatorias que falten, usando como guía los ejemplos del issue. El trabajo estará terminado cuando ambas rutas proporcionen al hook las mismas entradas procesadas que a la acción y omitan el hook si falla la validación.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Application.astep() passes raw, unprocessed inputs to pre_run_step lifecycle hooks, while Application.step() passes the validated and processed inputs that are actually provided to the action. This causes inconsistent lifecycle and tracking behavior between synchronous and asynchronous execution.
Current behavior
Application.step() calls _process_inputs() before invoking the pre_run_step hook. Consequently, undeclared inputs are removed and required inputs are validated before the hook runs.
Application.astep() invokes pre_run_step with the original input dictionary before calling _process_inputs().
For an action that declares no inputs:
step hook inputs: {}
astep hook inputs: {"unused": 123}
There is also inconsistent behavior when a required input is missing:
pre_run_step calls:
step: 0
astep: 1
This means lifecycle adapters and tracking clients can record inputs that were never passed to the action.
Stack Traces
Not applicable. The inconsistency occurs without an exception when undeclared inputs are supplied.
Screenshots
Not applicable.
Steps to replicate behavior
- Run the following script:
import asyncio
from burr.core import ApplicationBuilder, State, action
from burr.lifecycle import PreRunStepHook
class CaptureInputs(PreRunStepHook):
def __init__(self):
self.inputs = []
def pre_run_step(self, *, inputs, **kwargs):
self.inputs.append(inputs)
@action(reads=[], writes=[])
def noop(state: State) -> State:
return state
sync_hook = CaptureInputs()
sync_app = (
ApplicationBuilder()
.with_actions(noop)
.with_entrypoint("noop")
.with_hooks(sync_hook)
.build()
)
sync_app.step(inputs={"unused": 123})
async_hook = CaptureInputs()
async_app = (
ApplicationBuilder()
.with_actions(noop)
.with_entrypoint("noop")
.with_hooks(async_hook)
.build()
)
asyncio.run(async_app.astep(inputs={"unused": 123}))
print("step hook inputs:", sync_hook.inputs)
print("astep hook inputs:", async_hook.inputs)
- Observe the output:
step hook inputs: [{}]
astep hook inputs: [{"unused": 123}]
Library & System Information
- Apache Burr: current
main(9088aad8cb6de62b9923816b89eaa562c1162c65) - Python 3
- Reproduced on Linux
Expected behavior
step() and astep() should have consistent lifecycle semantics:
- Inputs should be validated and processed before
pre_run_stepis invoked. - The hook should receive the processed inputs that will be passed to the action.
- The same processed input dictionary should be used by both the hook and the action.
pre_run_stepshould not be invoked when input validation fails.
Additional context
In _step(), _process_inputs() is called before pre_run_step, and the resulting action_inputs are passed to both the hook and the action.
In _astep(), pre_run_step currently receives the original inputs dictionary, and _process_inputs() is called later during action execution.
Related issue #36 added action inputs to lifecycle hooks and tracking, but it does not cover this synchronous/asynchronous inconsistency.
- Lenguaje dominante
- Python
- Estrellas
- 2.6k
- Forks
- 209
- Merge medio
- 8 d 9 h
- PR fusionados (30 d)
- 26
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 5 días. Abiertostatus/needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/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 7 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 Un pull request vinculado a esta issue está abierto o ya se fusionó. 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 serverQuizá libre de nuevo @iamSerafinnn la tomó hace 137 días y no hay ningún pull request abierto. 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
-
Add a Cloudflare Python Workers counter deployment examplePosiblemente ocupada @KiritoXDone la tomó hace 3 días. Abiertostatus/needs-triage
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 4 días
Todos los issues de apache/burr
Issues similares
-
Python Volcengine provider returns failures instead of raising themPosiblemente ocupada @Ricardo-M-L la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
agent-infra/sandbox#248 ·
-
Textractor leaves empty temporary files when remote retrieval failsPosiblemente ocupada @HuaTNA la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
test(bm_generation): pin the learning parameters and CPU sync shortcutPosiblemente ocupada @iloveeyjafjalla la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
qboson/kaiwu-pytorch-plugin#1341 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
elder-plinius/V3R1T4S#625 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
foxglove/mcap#1907 · 1 comentario ·
Los mantenedores suelen responder en 1 día