{"record":{"id":"b6e61969078f19d7","repo":"nexu-io/open-design","slug":"input-image-for-job-job-get-id-not-found-pa","errorCode":null,"errorMessage":"input image for job {job.get('id')} not found: {path}","messagePattern":"input image for job (.+?) not found: (.+?)","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/generate_pet_images.py","lineNumber":221,"sourceCode":"    if request_path.exists():\n        request = json.loads(request_path.read_text(encoding=\"utf-8\"))\n        request[\"canonical_identity_reference\"] = reference\n        request_path.write_text(json.dumps(request, indent=2) + \"\\n\", encoding=\"utf-8\")\n\n\ndef path_list(run_dir: Path, job: dict[str, object]) -> list[Path]:\n    inputs = job.get(\"input_images\")\n    if not isinstance(inputs, list):\n        raise SystemExit(f\"job {job.get('id')} has invalid input_images\")\n    paths = []\n    for item in inputs:\n        if not isinstance(item, dict) or not isinstance(item.get(\"path\"), str):\n            raise SystemExit(f\"job {job.get('id')} has invalid input image entry\")\n        path = (run_dir / item[\"path\"]).resolve()\n        if not path.is_relative_to(run_dir):\n            raise SystemExit(f\"path traversal detected in input_images for job {job.get('id')}\")\n        if not path.is_file():\n            raise SystemExit(f\"input image for job {job.get('id')} not found: {path}\")\n        paths.append(path)\n    return paths\n\n\ndef main() -> None:\n    parser = argparse.ArgumentParser(description=__doc__)\n    parser.add_argument(\"--run-dir\", required=True)\n    parser.add_argument(\"--model\", default=\"gpt-image-2\")\n    parser.add_argument(\"--size\", default=\"1024x1024\")\n    parser.add_argument(\"--states\", default=\"all\")\n    parser.add_argument(\"--job-id\", action=\"append\", default=[])\n    parser.add_argument(\"--skip-base\", action=\"store_true\")\n    args = parser.parse_args()\n\n    api_key = os.environ.get(\"OPENAI_API_KEY\")\n    if not api_key:\n        raise SystemExit(\"OPENAI_API_KEY is not set\")\n","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/generate_pet_images.py#L203-L239","documentation":"Raised by path_list when an input_images entry resolves inside run_dir but no file exists at that resolved path. The script will not call the image API until every declared input image is present.","triggerScenarios":"The manifest references decoded/base.png or references/layout-guides/<state>.png before that dependency has been generated/copied, or a previously generated file was deleted/moved.","commonSituations":"Running a row-strip job before the base job completed (decoded/base.png missing); running generate_pet_images.py against a partial run dir; deleted intermediate files; wrong run_dir passed to --run-dir.","solutions":["Run the base job first (--job-id base, or omit --skip-base) so decoded/base.png exists.","Confirm --run-dir points at the dir that contains imagegen-jobs.json and its decoded/references subfolders.","If files were deleted, regenerate the run dir with prepare_pet_run.py.","Use pet_job_status.py --run-dir <dir> to see which jobs are ready vs blocked by missing dependencies."],"exampleFix":"// before\npython generate_pet_images.py --run-dir /tmp/pet-run --job-id idle\n# fails: decoded/base.png not found\n\n// after - generate base first, then rows\npython generate_pet_images.py --run-dir /tmp/pet-run --job-id base\npython generate_pet_images.py --run-dir /tmp/pet-run --states idle,waving","handlingStrategy":"validation","validationCode":"def ensure_inputs_exist(run_dir: Path, job: dict) -> None:\n    for item in job.get(\"input_images\", []):\n        path = (run_dir / item[\"path\"]).resolve()\n        if not path.is_file():\n            raise SystemExit(f\"missing input: {path}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run pet_job_status.py first; its ready/blocked view shows which jobs have all their files.","Generate the base job before any row-strip job (rows depend on decoded/base.png).","Do not delete intermediate files under decoded/ between runs."],"tags":["filesystem","dependencies","manifest","system-exit"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}