mohitdixit02 commented on issue #1017:
URL: https://github.com/apache/burr/issues/1017#issuecomment-6562028386

   Thanks @xihaian251 for the exceptionally clear write-up and reproduction 
steps!
   
   I was able to reproduce both behaviors locally:
   1. `pre_run_step` seeing the raw input dictionary rather than the 
processed/injected inputs (`__context` / `__tracer`).
   2. Firing `pre_run_step` and `post_run_step` on invalid inputs.
   
   I also reviewed the note regarding the trap in 
`TracerFactoryContextHook.post_run_step` (to avoid the `KeyError` on 
`self.token_pointer_map`). My approach:
   - Move `_process_inputs()` **up** before `_increment_sequence_id()` and 
`pre_run_step` in both `stream_result()` and `astream_result()`.
   - Pass the processed `action_inputs` to `pre_run_step` (matching `step()`).
   - On validation failure, the exception raises before sequence increment or 
any lifecycle hook dispatch (preventing orphan tracking entries and avoiding 
the `KeyError`).
   - Reuse `action_inputs` downstream rather than recomputing them.
   
   I'd like to take this on and submit a PR with regression tests.


-- 
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