This commit is contained in:
2026-01-16 04:57:05 -08:00
parent 00bee0011c
commit 0f71ec7873
8 changed files with 446 additions and 137 deletions

18
CLI.py
View File

@@ -2118,13 +2118,23 @@ class PipelineExecutor:
except Exception:
effective_source = current_source
selection_only = bool(
len(stages) == 1 and stages[0] and stages[0][0].startswith("@")
selection_start = bool(
stages and stages[0] and stages[0][0].startswith("@")
)
if pending_tail and selection_only:
def _tail_is_suffix(existing: List[List[str]], tail: List[List[str]]) -> bool:
if not tail or not existing:
return False
if len(tail) > len(existing):
return False
return existing[-len(tail):] == tail
if pending_tail and selection_start:
if (pending_source is None) or (effective_source
and pending_source == effective_source):
stages = list(stages) + list(pending_tail)
# Only append the pending tail if the user hasn't already provided it.
if not _tail_is_suffix(stages, pending_tail):
stages = list(stages) + list(pending_tail)
try:
if hasattr(ctx, "clear_pending_pipeline_tail"):
ctx.clear_pending_pipeline_tail()