nexu-io/open-design · error · SystemExit

job {job_id} is missing prompt_file or output_path

Error message

job {job_id} is missing prompt_file or output_path

What it means

Raised in the main job loop when a selected job's prompt_file or output_path is missing or not a string. Both fields are required to know which prompt to send and where to write the decoded image.

Source

Thrown at skills/hatch-pet/scripts/generate_pet_images.py:257

    run_dir = Path(args.run_dir).expanduser().resolve()
    manifest_path = run_dir / "imagegen-jobs.json"
    manifest = load_manifest(run_dir)
    jobs = select_jobs(
        manifest,
        states=parse_states(args.states),
        skip_base=args.skip_base,
        job_ids=args.job_id,
    )
    raw_dir = run_dir / "raw"

    completed = []
    for job in jobs:
        job_id = str(job.get("id"))
        prompt_raw = job.get("prompt_file")
        output_raw = job.get("output_path")
        if not isinstance(prompt_raw, str) or not isinstance(output_raw, str):
            raise SystemExit(f"job {job_id} is missing prompt_file or output_path")
        prompt_file = (run_dir / prompt_raw).resolve()
        output_image = (run_dir / output_raw).resolve()
        if not prompt_file.is_relative_to(run_dir):
            raise SystemExit(f"path traversal detected in prompt_file for job {job_id}")
        if not output_image.is_relative_to(run_dir):
            raise SystemExit(f"path traversal detected in output_path for job {job_id}")
        print(f"Generating {job_id} with secondary fallback")
        image_paths = path_list(run_dir, job)
        if image_paths:
            response = run_image_edit(
                model=args.model,
                prompt_file=prompt_file,
                image_paths=image_paths,
                output_json=raw_dir / f"{job_id}.response.json",
                size=args.size,
                api_key=api_key,
            )
        else:

View on GitHub (pinned to 5be4028344)

Solutions

  1. Open imagegen-jobs.json and find the job id from the message.
  2. Ensure both prompt_file (e.g. "prompts/rows/idle.md") and output_path (e.g. "decoded/idle.png") are strings relative to run_dir.
  3. If the schema drifted, regenerate the manifest with prepare_pet_run.py.
  4. Rerun the job.

Example fix

// before (manifest job)
{"id": "idle", "prompt_file": null, "output_path": "decoded/idle.png"}

// after
{"id": "idle", "prompt_file": "prompts/rows/idle.md", "output_path": "decoded/idle.png"}
Defensive patterns

Strategy: validation

Validate before calling

def require_str(job: dict, key: str) -> str:
    value = job.get(key)
    if not isinstance(value, str):
        raise SystemExit(f"job {job.get('id')} is missing {key}")
    return value

Type guard

def has_str_field(job: dict, key: str) -> bool:
    return isinstance(job.get(key), str)

Prevention

When it happens

Trigger: A job in imagegen-jobs.json lacks prompt_file or output_path, or sets one to null/number/object. select_jobs already matched the job by id, but the per-job fields are malformed.

Common situations: Hand-edited manifest with incomplete job entries; a manifest from an older/newer schema that renamed these fields; corrupted JSON.

Related errors


AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12). Data as JSON: /api/errors/2fba96f76c660fef. Report an issue: GitHub.