h
This commit is contained in:
@@ -1153,6 +1153,16 @@ class PipelineLiveProgress:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Auto-stop Live rendering once all pipes are complete so the progress
|
||||
# UI clears itself even if callers forget to stop it explicitly.
|
||||
try:
|
||||
if self._live is not None and self._pipe_labels:
|
||||
total_pipes = len(self._pipe_labels)
|
||||
if total_pipes > 0 and completed >= total_pipes:
|
||||
self.stop()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def begin_pipe_steps(self, pipe_index: int, *, total_steps: int) -> None:
|
||||
"""Initialize step tracking for a pipe.
|
||||
|
||||
|
||||
@@ -2821,6 +2821,7 @@ class PipelineExecutor:
|
||||
|
||||
pipe_idx = pipe_index_by_stage.get(stage_index)
|
||||
|
||||
overlay_table: Any | None = None
|
||||
session = WorkerStages.begin_stage(
|
||||
worker_manager,
|
||||
cmd_name=cmd_name,
|
||||
@@ -2856,24 +2857,17 @@ class PipelineExecutor:
|
||||
# Pipeline overlay tables (e.g., get-url detail views) need to be
|
||||
# rendered when running inside a pipeline because the CLI path
|
||||
# normally handles rendering. The overlay is only useful when
|
||||
# we're at the terminal stage of the pipeline.
|
||||
# we're at the terminal stage of the pipeline. Save the table so
|
||||
# it can be printed after the pipe finishes.
|
||||
overlay_table = None
|
||||
if stage_index + 1 >= len(stages):
|
||||
display_table = None
|
||||
try:
|
||||
display_table = (
|
||||
overlay_table = (
|
||||
ctx.get_display_table()
|
||||
if hasattr(ctx, "get_display_table") else None
|
||||
)
|
||||
except Exception:
|
||||
display_table = None
|
||||
if display_table is not None:
|
||||
try:
|
||||
from SYS.rich_display import stdout_console
|
||||
|
||||
stdout_console().print()
|
||||
stdout_console().print(display_table)
|
||||
except Exception:
|
||||
pass
|
||||
overlay_table = None
|
||||
|
||||
# Update piped_result for next stage from emitted items
|
||||
stage_emits = list(stage_ctx.emits)
|
||||
@@ -2884,6 +2878,14 @@ class PipelineExecutor:
|
||||
finally:
|
||||
if progress_ui is not None and pipe_idx is not None:
|
||||
progress_ui.finish_pipe(pipe_idx)
|
||||
if overlay_table is not None:
|
||||
try:
|
||||
from SYS.rich_display import stdout_console
|
||||
|
||||
stdout_console().print()
|
||||
stdout_console().print(overlay_table)
|
||||
except Exception:
|
||||
pass
|
||||
if session:
|
||||
try:
|
||||
session.close()
|
||||
|
||||
Reference in New Issue
Block a user