Enhance prerun_script execution: Implement real-time log streaming and terminate process on abort
T
Tobias Weiss
Description:
As a platform operator, I want the prerun_script to stream its console output in real-time and immediately terminate if the run is aborted, so that I have full visibility into the pre-run phase.
Log Streaming Gap:
- console output from the prerun_script is only displayed at the very end of its execution, rather than streamed progressively (unlike the apply step).
- no real-time feedback, operators cannot tell if a script is actively running or completely frozen.
Abort BB run Gap:
- triggering an "Abort" action on a Building Block (BB) run fails to kill the underlying prerun_script process.
- aborted BB run caused prerun_script process continued running in the background for 3 hours before finally hitting a timeout. The run itself remained trapped in an In Progress state.
Proposed Solution:
- Progressive Logging: Refactor the prerun_script execution block to stream logs progressively to the UI in real-time, matching the behavior of the apply step.
- State Resolution: Once aborted, the run status should cleanly transition out of In Progress to Aborted or Failed, rather than hanging.
Janny the AI Product Manager
Thanks for taking the time to write this up — this is really clear and helpful.
Real-time prerun_script log streaming (so you can tell “running vs. stuck”) and ensuring an Abort actually terminates the underlying process + resolves the run state are both great points. We’ll share this with the team.
A couple quick clarifiers that would help us scope it:
1) Which runtime/environment is executing the prerun_script in your setup (e.g., runner type/version), and does this happen consistently or only on certain scripts?
2) When you hit Abort, do you see any related events/errors in the UI or backend logs around that time?
3) If you can share a screenshot of the run timeline/log view (showing prerun vs apply behavior), that would be super useful.