Skip to content

Commit d271c5c

Browse files
author
MiniMax-M2
committed
fix: address Copilot review comments
- Set exit_code=0 in dry-run mode (CommandStep) instead of None, matching the COMPLETED status and not breaking expression evaluation - Add dry_run parameter documentation to WorkflowEngine.execute() docstring - Fix contradictory 'Run with --dry-run' hint messages in specify specify/plan commands (the message appeared inside the dry-run block itself)
1 parent 071414f commit d271c5c

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/specify_cli/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ def specify_specify(
616616
)
617617
console.print(f"\n[{status_color}]Status: {state.status.value}[/{status_color}]")
618618
if dry_run:
619-
console.print("[dim]Run with --dry-run to see step details. Run without --dry-run to execute.[/dim]")
619+
console.print("[dim]Run without --dry-run to execute.[/dim]")
620620

621621

622622
@specify_app.command("plan")
@@ -684,7 +684,7 @@ def specify_plan(
684684
)
685685
console.print(f"\n[{status_color}]Status: {state.status.value}[/{status_color}]")
686686
if dry_run:
687-
console.print("[dim]Run with --dry-run to see step details. Run without --dry-run to execute.[/dim]")
687+
console.print("[dim]Run without --dry-run to execute.[/dim]")
688688

689689

690690
# ===== Extension Commands =====

src/specify_cli/workflows/engine.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,14 @@ def execute(
427427
User-provided input values.
428428
run_id:
429429
Optional run ID (auto-generated if not provided).
430+
dry_run:
431+
If ``True``, each step is executed normally but without
432+
invoking the underlying AI integration (e.g. no CLI subprocess
433+
is spawned for ``command`` steps, interactive gates return
434+
``COMPLETED`` immediately, etc.). The workflow state is
435+
still persisted to disk so ``specify workflow resume`` works.
436+
Use this to preview the resolved inputs and prompts for a
437+
workflow without making any AI API calls.
430438
431439
Returns
432440
-------

src/specify_cli/workflows/steps/command/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def execute(self, config: dict[str, Any], context: StepContext) -> StepResult:
6868
invoke_str = f"{command} {args_str}".strip()
6969
output["dispatched"] = False
7070
output["dry_run"] = True
71-
output["exit_code"] = None
71+
output["exit_code"] = 0
7272
output["stdout"] = ""
7373
output["stderr"] = ""
7474
output["invoke_command"] = invoke_str

0 commit comments

Comments
 (0)