nexu-io/open-design · error · SystemExit
unknown state(s): {', '.join(unknown)}
Error message
unknown state(s): {', '.join(unknown)} What it means
Raised by parse_states in generate_pet_images.py when the --states argument contains tokens not in ALL_STATES (idle, running-right, running-left, waving, jumping, failed, waiting, running, review). The literal 'all' expands to every state; anything else must match the canonical set exactly.
Source
Thrown at skills/hatch-pet/scripts/generate_pet_images.py:37
"running-right",
"running-left",
"waving",
"jumping",
"failed",
"waiting",
"running",
"review",
]
CANONICAL_BASE_PATH = "references/canonical-base.png"
def parse_states(raw: str) -> list[str]:
if raw.strip().lower() == "all":
return ALL_STATES
states = [item.strip() for item in raw.split(",") if item.strip()]
unknown = sorted(set(states) - set(ALL_STATES))
if unknown:
raise SystemExit(f"unknown state(s): {', '.join(unknown)}")
return states
def load_manifest(run_dir: Path) -> dict[str, object]:
path = run_dir / "imagegen-jobs.json"
if not path.exists():
raise SystemExit(f"job manifest not found: {path}")
return json.loads(path.read_text(encoding="utf-8"))
def manifest_jobs(manifest: dict[str, object]) -> list[dict[str, object]]:
jobs = manifest.get("jobs")
if not isinstance(jobs, list):
raise SystemExit("invalid imagegen-jobs.json: jobs must be a list")
return [job for job in jobs if isinstance(job, dict)]
def select_jobs(View on GitHub (pinned to 5be4028344)
Solutions
- Use --states all to process every canonical state.
- Pass only state names from ALL_STATES: idle, running-right, running-left, waving, jumping, failed, waiting, running, review.
- Copy the exact token from ALL_STATES in generate_pet_images.py to avoid typos.
Example fix
// before generate_pet_images.py --run-dir r --states runing-left // after generate_pet_images.py --run-dir r --states running-left
Defensive patterns
Strategy: validation
Validate before calling
ALL_STATES = {'idle','running-right','running-left','waving','jumping','failed','waiting','running','review'}
raw = args.states
states = ALL_STATES if raw.strip().lower() == 'all' else {s.strip() for s in raw.split(',') if s.strip()}
if unknown := states - ALL_STATES:
raise ValueError(f'unknown states: {sorted(unknown)}') Type guard
ALL_STATES = {'idle','running-right','running-left','waving','jumping','failed','waiting','running','review'}
def is_state(value: str) -> bool:
return value in ALL_STATES Prevention
- Use --states all to avoid typos.
- Copy state tokens directly from ALL_STATES in generate_pet_images.py.
- Remember individual state names are case-sensitive (only 'all' is lowercased).
When it happens
Trigger: Passing --states with a typo or unrecognized state name (e.g. 'runing-right', 'sleep') that is not in ALL_STATES and not the literal 'all'.
Common situations: Typing a state name from memory; using a state name from a different/older schema; case issues are tolerated only for the 'all' literal (it is lowercased), but individual state names are case-sensitive.
Related errors
- job manifest not found: {path}
- unknown job id(s): {', '.join(sorted(missing))}
- invalid JSON in ${filePath}: ${message}
- ${filePath} must contain a JSON object
- unknown flag: --${key}. Run with --help for the list of acce
AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12).
Data as JSON: /api/errors/0df001967bf22da3.
Report an issue: GitHub.