{"record":{"id":"2fba96f76c660fef","repo":"nexu-io/open-design","slug":"job-job-id-is-missing-prompt-file-or-output-path","errorCode":null,"errorMessage":"job {job_id} is missing prompt_file or output_path","messagePattern":"job (.+?) is missing prompt_file or output_path","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/generate_pet_images.py","lineNumber":257,"sourceCode":"\n    run_dir = Path(args.run_dir).expanduser().resolve()\n    manifest_path = run_dir / \"imagegen-jobs.json\"\n    manifest = load_manifest(run_dir)\n    jobs = select_jobs(\n        manifest,\n        states=parse_states(args.states),\n        skip_base=args.skip_base,\n        job_ids=args.job_id,\n    )\n    raw_dir = run_dir / \"raw\"\n\n    completed = []\n    for job in jobs:\n        job_id = str(job.get(\"id\"))\n        prompt_raw = job.get(\"prompt_file\")\n        output_raw = job.get(\"output_path\")\n        if not isinstance(prompt_raw, str) or not isinstance(output_raw, str):\n            raise SystemExit(f\"job {job_id} is missing prompt_file or output_path\")\n        prompt_file = (run_dir / prompt_raw).resolve()\n        output_image = (run_dir / output_raw).resolve()\n        if not prompt_file.is_relative_to(run_dir):\n            raise SystemExit(f\"path traversal detected in prompt_file for job {job_id}\")\n        if not output_image.is_relative_to(run_dir):\n            raise SystemExit(f\"path traversal detected in output_path for job {job_id}\")\n        print(f\"Generating {job_id} with secondary fallback\")\n        image_paths = path_list(run_dir, job)\n        if image_paths:\n            response = run_image_edit(\n                model=args.model,\n                prompt_file=prompt_file,\n                image_paths=image_paths,\n                output_json=raw_dir / f\"{job_id}.response.json\",\n                size=args.size,\n                api_key=api_key,\n            )\n        else:","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/generate_pet_images.py#L239-L275","documentation":"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.","triggerScenarios":"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.","commonSituations":"Hand-edited manifest with incomplete job entries; a manifest from an older/newer schema that renamed these fields; corrupted JSON.","solutions":["Open imagegen-jobs.json and find the job id from the message.","Ensure both prompt_file (e.g. \"prompts/rows/idle.md\") and output_path (e.g. \"decoded/idle.png\") are strings relative to run_dir.","If the schema drifted, regenerate the manifest with prepare_pet_run.py.","Rerun the job."],"exampleFix":"// before (manifest job)\n{\"id\": \"idle\", \"prompt_file\": null, \"output_path\": \"decoded/idle.png\"}\n\n// after\n{\"id\": \"idle\", \"prompt_file\": \"prompts/rows/idle.md\", \"output_path\": \"decoded/idle.png\"}","handlingStrategy":"validation","validationCode":"def require_str(job: dict, key: str) -> str:\n    value = job.get(key)\n    if not isinstance(value, str):\n        raise SystemExit(f\"job {job.get('id')} is missing {key}\")\n    return value","typeGuard":"def has_str_field(job: dict, key: str) -> bool:\n    return isinstance(job.get(key), str)","tryCatchPattern":null,"preventionTips":["Generate the manifest with prepare_pet_run.py so prompt_file/output_path are always present.","Lint imagegen-jobs.json with jsonschema before running generation.","Diff a hand-edited manifest against a freshly generated one to catch missing fields."],"tags":["manifest","json-schema","validation","system-exit"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}