# What Happens When the PPT Master Generation Workflow Is Interrupted Midway?

> Discover what happens when the PPT Master generation workflow is interrupted. Learn how it handles interruptions, preserves files, and halts the pipeline.

- Repository: [HugoHe/ppt-master](https://github.com/hugohe3/ppt-master)
- Tags: internals
- Published: 2026-04-24

---

**When the PPT Master generation workflow is interrupted by pressing Ctrl+C, the active script catches the KeyboardInterrupt exception, exits with status 130, preserves any files already written to disk, and halts the sequential pipeline before the next stage begins.**

The **PPT Master** toolkit by hugohe3/ppt-master processes presentation creation through a strictly sequential pipeline defined in [`AGENTS.md`](https://github.com/hugohe3/ppt-master/blob/main/AGENTS.md). Understanding how the generation workflow handles interruptions is critical for managing long-running AI image generation tasks and avoiding duplicate work. When interrupted midway, the system prioritizes data preservation over rollback, allowing you to resume exactly where you left off.

## How Interruption Is Handled in the Source Code

### Image Generation Script

In [`skills/ppt-master/scripts/image_gen.py`](https://github.com/hugohe3/ppt-master/blob/main/skills/ppt-master/scripts/image_gen.py), the main execution loop wraps critical operations in a try-except block that specifically catches `KeyboardInterrupt`. At line 433, when the user presses Ctrl+C, the script prints a friendly notice and exits with code 130:

```python
except KeyboardInterrupt:
    print("\n\nInterrupted by user.")          # ← friendly notice

    sys.exit(130)                             # ← non‑zero exit code

```

This non-zero exit code signals to the parent process or shell that the operation was aborted by user intervention rather than completing successfully or failing technically.

### Interactive Coordinate Calculator

The interactive helper at [`skills/ppt-master/scripts/svg_position_calculator.py`](https://github.com/hugohe3/ppt-master/blob/main/skills/ppt-master/scripts/svg_position_calculator.py) handles interruptions differently. At line 1223, catching `KeyboardInterrupt` allows the script to break out of its interactive loop cleanly without terminating the entire process abruptly:

```python
except KeyboardInterrupt:
    print("\nExiting interactive mode")
    break

```

### Pipeline Stage Scripts

Throughout the remaining workflow—[`total_md_split.py`](https://github.com/hugohe3/ppt-master/blob/main/total_md_split.py), [`finalize_svg.py`](https://github.com/hugohe3/ppt-master/blob/main/finalize_svg.py), and [`svg_to_pptx.py`](https://github.com/hugohe3/ppt-master/blob/main/svg_to_pptx.py)—each script uses `sys.exit()` calls to terminate. Because the pipeline is strictly sequential as documented in [`AGENTS.md`](https://github.com/hugohe3/ppt-master/blob/main/AGENTS.md), an interruption in any step prevents the subsequent scripts from ever launching.

## State of the Project Directory After Interruption

When the PPT Master generation workflow is interrupted midway, the system does not perform automatic cleanup. This design decision preserves expensive-to-generate assets:

- **Current step stops immediately**: Any in-memory data is lost.
- **Partial artifacts remain**: Generated images, SVG fragments, and split markdown files already written to the project folder stay on disk.
- **No rollback mechanism**: The workflow does not delete or revert files created before the interruption.
- **Later stages skipped**: Because execution is sequential, [`finalize_svg.py`](https://github.com/hugohe3/ppt-master/blob/main/finalize_svg.py) and [`svg_to_pptx.py`](https://github.com/hugohe3/ppt-master/blob/main/svg_to_pptx.py) are not invoked if an earlier step aborts.

## Resuming the Workflow Safely

Because partial artifacts persist, you can safely re-run the interrupted command or continue to the next step. The scripts are designed to overwrite or append to existing files as appropriate.

**Interrupting image generation:**

```bash

# Start generation (may take minutes)

python -m skills.ppt-master.scripts.image_gen "A futuristic cityscape" -b openai

# Press Ctrl+C

# Output:

# 
# 

# Interrupted by user.

# (exit status 130)

```

**Resuming after interruption:**

```bash

# Re-run the same command to continue generating remaining prompts

python -m skills.ppt-master.scripts.image_gen "A futuristic cityscape" -b openai

```

**Continuing the pipeline:**

If you interrupted after [`total_md_split.py`](https://github.com/hugohe3/ppt-master/blob/main/total_md_split.py) but before finalization:

```bash

# Re-run the split step (safe to overwrite existing parts)

python -m skills.ppt-master.scripts.total_md_split ./my_project

# Continue with finalization and export

python -m skills.ppt-master.scripts.finalize_svg ./my_project
python -m skills.ppt-master.scripts.svg_to_pptx ./my_project -s final

```

## Summary

- **Immediate exit**: The active script catches `KeyboardInterrupt` and exits with status 130, stopping the current operation instantly.
- **Artifact preservation**: Partial files remain in the `projects/` folder, allowing you to resume the PPT Master generation workflow without regenerating expensive AI images.
- **Sequential halt**: Because the pipeline runs step-by-step per [`AGENTS.md`](https://github.com/hugohe3/ppt-master/blob/main/AGENTS.md), interrupting one stage prevents subsequent stages from starting.
- **Safe resumption**: Re-invoking the same command or the next pipeline step allows you to continue without data loss.

## Frequently Asked Questions

### Does PPT Master delete partial files when I press Ctrl+C?

No. The PPT Master generation workflow intentionally does not delete partial artifacts. Files generated up to the point of interruption—including images, SVG fragments, and split markdown—remain in the project directory so you can resume the workflow without losing expensive AI generation work.

### What exit code does PPT Master return when interrupted?

When interrupted via Ctrl+C during image generation in [`image_gen.py`](https://github.com/hugohe3/ppt-master/blob/main/image_gen.py), the script exits with status code **130**. This specific non-zero code indicates user-initiated termination, distinguishing it from technical failures that might return different exit codes.

### Can I resume the PPT Master workflow from the middle of a step?

If you interrupt during a single script execution (such as halfway through image generation), re-running the same command will restart that specific step. The script will overwrite or append to existing files as its logic dictates. You cannot resume from the exact API call mid-way, but you will not lose the images already successfully generated and saved to disk.

### Will an interruption corrupt my PowerPoint project files?

No. Because the workflow writes files atomically and catches interruptions gracefully, existing project files remain intact. The sequential nature of the pipeline (defined in [`AGENTS.md`](https://github.com/hugohe3/ppt-master/blob/main/AGENTS.md)) ensures that downstream scripts like [`svg_to_pptx.py`](https://github.com/hugohe3/ppt-master/blob/main/svg_to_pptx.py) never run if an upstream step fails or is interrupted, preventing partial PPTX writes.