{"record":{"id":"8d8ea1590eecea61","repo":"can1357/oh-my-pi","slug":"unsupported-todo-status-seed-status","errorCode":null,"errorMessage":"Unsupported todo status: {seed.status}","messagePattern":"Unsupported todo status: (.+?)","errorType":"exception","errorClass":"RpcError","httpStatus":null,"severity":"error","filePath":"python/omp-rpc/src/omp_rpc/client.py","lineNumber":1706,"sourceCode":"        next_task_id = 1\n\n        def next_task() -> str:\n            nonlocal next_task_id\n            task_id = f\"task-{next_task_id}\"\n            next_task_id += 1\n            return task_id\n\n        def normalize_todo_item(seed: TodoSeed) -> JsonObject:\n            if isinstance(seed, str):\n                return {\n                    \"id\": next_task(),\n                    \"content\": seed,\n                    \"status\": cast(JsonValue, \"pending\"),\n                }\n\n            if isinstance(seed, TodoItem):\n                if seed.status not in _TODO_STATUS_VALUES:\n                    raise RpcError(f\"Unsupported todo status: {seed.status}\")\n                return {\n                    \"id\": seed.id or next_task(),\n                    \"content\": seed.content,\n                    \"status\": cast(JsonValue, seed.status),\n                    \"notes\": seed.notes,\n                    \"details\": seed.details,\n                    \"blocker\": seed.blocker,\n                }\n\n            content = seed.get(\"content\")\n            if not isinstance(content, str) or not content.strip():\n                raise RpcError(\"Todo items must provide a non-empty 'content' value\")\n\n            raw_id = seed.get(\"id\")\n            raw_status = seed.get(\"status\")\n            raw_notes = seed.get(\"notes\")\n            raw_details = seed.get(\"details\")\n            raw_blocker = seed.get(\"blocker\")","sourceCodeStart":1688,"sourceCodeEnd":1724,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/python/omp-rpc/src/omp_rpc/client.py#L1688-L1724","documentation":"RpcError raised when seeding todos with a TodoItem whose status is not one of the allowed values (pending, in_progress, completed, abandoned) per _TODO_STATUS_VALUES. The client validates statuses before sending them over RPC.","triggerScenarios":"Passing a TodoItem constructed with a custom/typo'd status string (e.g. 'done', 'open', 'InProgress') into the todo seeding/patch command.","commonSituations":"Migrating from another todo schema with different status enums; hand-building TodoItem dataclasses with raw strings; case-sensitivity mistakes ('Pending' vs 'pending').","solutions":["Use only 'pending', 'in_progress', 'completed', or 'abandoned' as TodoItem.status","Map your application's statuses to the four supported values before seeding","Lowercase/normalize status strings before constructing TodoItem","Validate statuses against the TodoStatus literal type with a type checker (mypy/pyright) to catch typos statically"],"exampleFix":"// before\nTodoItem(id=\"1\", content=\"Ship\", status=\"done\")\n// after\nTodoItem(id=\"1\", content=\"Ship\", status=\"completed\")","handlingStrategy":"validation","validationCode":"ALLOWED = {\"pending\", \"in_progress\", \"completed\", \"abandoned\"}\nassert item.status in ALLOWED, f\"bad todo status: {item.status!r}\"","typeGuard":"def has_valid_todo_status(item: TodoItem) -> TypeGuard[TodoItem]:\n    return item.status in {\"pending\", \"in_progress\", \"completed\", \"abandoned\"}","tryCatchPattern":"try:\n    client.seed_todos(items)\nexcept RpcError as exc:\n    if \"Unsupported todo status\" in str(exc):\n        items = [normalize_status(i) for i in items]\n        client.seed_todos(items)\n    else:\n        raise","preventionTips":["Use the TodoStatus literal type so type checkers catch invalid statuses","Normalize external status strings (lowercase, map synonyms like done->completed)","Keep a shared constant of allowed statuses next to TodoItem construction sites"],"tags":["rpc","validation","todos","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}