Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

astep() passes unprocessed inputs to pre_run_step hooks

Aperta Adatta ai principianti
#979 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 6 giorni

@sivakumar-mahalingam ci sta già lavorando.

Dal 18/10/2026.

  • #980 di @sivakumar-mahalingam — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Leggi le implementazioni sincrona di _step() e asincrona di _astep(), concentrandoti su dove viene eseguito _process_inputs() rispetto a pre_run_step. Aggiungi o adatta test per gli input elaborati e per gli input obbligatori mancanti, usando come guida gli esempi dell’issue. Il lavoro è completato quando entrambi i percorsi forniscono all’hook gli stessi input elaborati forniti all’azione e saltano l’hook se la convalida non riesce.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

status/needs-triage

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

  1. 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)
  1. 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_step is 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_step should 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.

Lingua principale
Python
Stelle
2.6k
Fork
209
Merge medio
10g 9h
PR unite (30g)
17

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/burr

Tutte le issue di apache/burr

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.