{"record":{"id":"2d10e54924cd3ee4","repo":"calesthio/OpenMontage","slug":"unsupported-atlas-image-model-id-model-r-use-ge","errorCode":null,"errorMessage":"Unsupported Atlas image model id {model!r}. Use get_info()['model_catalog'] for live routes.","messagePattern":"Unsupported Atlas image model id (.+?)\\. Use get_info\\(\\)\\['model_catalog'\\] for live routes\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/graphics/atlas_image.py","lineNumber":133,"sourceCode":"        }\n        return info\n\n    def estimate_cost(self, inputs: dict[str, Any]) -> float:\n        try:\n            model = self._resolve_model(\n                str(inputs.get(\"model\", _DEFAULT_MODEL)),\n                str(inputs.get(\"generation_mode\", \"generate\")),\n            )\n        except ValueError:\n            return _DEFAULT_COST\n        return float(IMAGE_MODELS[model][\"cost_per_image\"])\n\n    def estimate_runtime(self, inputs: dict[str, Any]) -> float:\n        return 30.0\n\n    def _resolve_model(self, model: str, operation: str) -> str:\n        if model not in IMAGE_MODELS:\n            raise ValueError(\n                f\"Unsupported Atlas image model id {model!r}. Use get_info()['model_catalog'] for live routes.\"\n            )\n        family = IMAGE_MODELS[model][\"family\"]\n        route = IMAGE_ROUTES.get(family, {}).get(operation)\n        if not route:\n            raise ValueError(f\"{family} does not expose generation_mode={operation!r} on Atlas Cloud\")\n        return route\n\n    def _build_payload(self, inputs: dict[str, Any], model: str) -> dict[str, Any]:\n        spec = IMAGE_MODELS[model]\n        payload: dict[str, Any] = {\"model\": model, \"prompt\": inputs.get(\"prompt\", \"\")}\n        width = int(inputs.get(\"width\", 2048))\n        height = int(inputs.get(\"height\", 2048))\n        style = spec[\"size_style\"]\n\n        if style == \"star\":\n            payload[\"size\"] = f\"{width}*{height}\"\n        elif style == \"x\":","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/calesthio/OpenMontage/blob/95e1c3d0ab93482159818560f6a8c8e866b9139f/tools/graphics/atlas_image.py#L115-L151","documentation":"ValueError raised by AtlasImageTool._resolve_model when the requested model id is not a key in the IMAGE_MODELS registry. Model ids are exact-match strings; the error points to get_info()['model_catalog'] as the live source of valid ids. _estimate_cost swallows this ValueError and returns a default, but the actual resolve path during execution raises.","triggerScenarios":"Passing model='seedream' or another shorthand/alias instead of the full registry id, using a model id from a different provider, or referencing a model removed/renamed in the current tool version.","commonSituations":"Model catalogs evolve (renames, new versions like seedream-4 -> seedream-5); prompts/code copied from older docs or examples; typos or wrong casing in the id.","solutions":["Call get_info()['model_catalog'] and copy the exact model id string from it.","Update stale hardcoded ids in your code/config to the current catalog names.","If you need a stable default, omit the model argument — the tool falls back to _DEFAULT_MODEL.","Keep model ids in one config location so catalog renames are a one-line fix."],"exampleFix":"# before\ninputs = {\"model\": \"seedream\", \"prompt\": \"...\"}  # alias, not in registry -> ValueError\n\n# after\ninfo = tool.get_info()\nvalid_ids = list(info[\"model_catalog\"].keys())\ninputs = {\"model\": valid_ids[0], \"prompt\": \"...\"}  # exact id from live catalog","handlingStrategy":"validation","validationCode":"valid_models = set(tool.get_info()[\"model_catalog\"].keys())\nassert inputs.get(\"model\", _DEFAULT) in valid_models or \"model\" not in inputs","typeGuard":"def is_valid_atlas_model(tool, model: str) -> bool:\n    return model in tool.get_info()[\"model_catalog\"]","tryCatchPattern":"try:\n    result = tool.run(inputs)\nexcept ValueError as e:\n    if \"Unsupported Atlas image model id\" in str(e):\n        inputs[\"model\"] = next(iter(tool.get_info()[\"model_catalog\"]))  # or fix from catalog\n        result = tool.run(inputs)\n    raise","preventionTips":["Resolve model ids from get_info() at runtime instead of hardcoding.","Centralize model selection in config to survive catalog renames.","Add contract tests that assert your configured ids exist in the catalog."],"tags":["atlas-cloud","image","model-id","validation"],"backgroundTag":null,"analyzedSha":"95e1c3d0ab93482159818560f6a8c8e866b9139f","analyzedAt":"2026-08-15T06:31:20.014Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}