{"record":{"id":"1816d16061194812","repo":"NousResearch/hermes-agent","slug":"could-not-write-spritesheet-for-slug-exc","errorCode":null,"errorMessage":"could not write spritesheet for '{slug}': {exc}","messagePattern":"could not write spritesheet for '(.+?)': (.+?)","errorType":"exception","errorClass":"PetStoreError","httpStatus":null,"severity":"error","filePath":"agent/pet/store.py","lineNumber":261,"sourceCode":"    slug: str,\n    display_name: str = \"\",\n    description: str = \"\",\n) -> InstalledPet:\n    \"\"\"Write a locally-generated pet into the store and return it.\n\n    *spritesheet* may be a PIL image, raw WebP/PNG bytes, or a path. The pet\n    appears in :func:`installed_pets` immediately, and because :func:`install_pet`\n    returns an already-on-disk pet before consulting the manifest, it can be\n    adopted (``pet.select`` / ``/pet <slug>``) without a manifest entry.\n    \"\"\"\n    slug = slugify(slug)\n    directory = pets_dir() / slug\n    directory.mkdir(parents=True, exist_ok=True)\n    sprite_path = directory / \"spritesheet.webp\"\n    try:\n        _write_spritesheet(spritesheet, sprite_path)\n    except Exception as exc:  # noqa: BLE001 - normalize to one error type\n        raise PetStoreError(f\"could not write spritesheet for '{slug}': {exc}\") from exc\n\n    meta = {\n        \"id\": slug,\n        \"displayName\": display_name or slug,\n        \"description\": description or \"\",\n        \"spritesheetPath\": sprite_path.name,\n        \"createdBy\": \"generator\",\n    }\n    (directory / \"pet.json\").write_text(json.dumps(meta, indent=2), encoding=\"utf-8\")\n\n    pet = load_pet(slug)\n    if pet is None or not pet.exists:\n        raise PetStoreError(f\"register of generated pet '{slug}' did not produce a spritesheet\")\n    return pet\n\n\ndef export_pet(slug: str) -> tuple[str, bytes]:\n    \"\"\"Zip an installed pet's folder (pet.json + spritesheet) → (filename, bytes).","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/agent/pet/store.py#L243-L279","documentation":"Error \"could not write spritesheet for '{slug}': {exc}\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at agent/pet/store.py:261 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the pet store directory permissions and disk space, then retry.","Remove any partial spritesheet file and reinstall the pet."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}