{"record":{"id":"2ecf0729414c8ba6","repo":"conductor-oss/conductor","slug":"image-generation-not-supported-by-the-model-yet-2ecf07","errorCode":null,"errorMessage":"Image generation not supported by the model yet","messagePattern":"Image generation not supported by the model yet","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"ai/src/main/java/org/conductoross/conductor/ai/providers/grok/Grok.java","lineNumber":93,"sourceCode":"                .topP(input.getTopP())\n                .maxTokens(input.getMaxTokens())\n                .stopSequences(input.getStopWords())\n                .frequencyPenalty(input.getFrequencyPenalty())\n                .presencePenalty(input.getPresencePenalty())\n                .toolCallbacks(toolCallbacks)\n                .toolNames(toolNames)\n                .internalToolExecutionEnabled(false)\n                .build();\n    }\n\n    @Override\n    public ChatModel getChatModel() {\n        return this.chatModel;\n    }\n\n    @Override\n    public ImageModel getImageModel() {\n        throw new UnsupportedOperationException(\"Image generation not supported by the model yet\");\n    }\n}\n","sourceCodeStart":75,"sourceCodeEnd":96,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/ai/src/main/java/org/conductoross/conductor/ai/providers/grok/Grok.java#L75-L96","documentation":"Grok.java throws UnsupportedOperationException from getImageModel() because the xAI Grok provider has no image-generation API endpoint. The AIModel interface declares getImageModel() as a non-default abstract method (line 141), so every provider must implement it — Grok fulfills the contract by throwing. LLMHelper.generateImage() calls llm.getImageModel() unconditionally at line 155, so routing an image task to grok crashes.","triggerScenarios":"A Conductor workflow task calls an LLM image-generation worker (e.g. LLMGenerateImage) with llmProvider set to \"grok\". LLMHelper.generateImage() invokes llm.getImageModel() and the Grok provider throws immediately — no network call is ever made.","commonSituations":"Pointing an image-generation task at a chat-only provider; confusing grok-2-vision (vision input) with image output; copying a chat-completion provider config and reusing it for an image task without checking capability support.","solutions":["Switch the image-generation task's llmProvider to a provider that implements a real ImageModel: openai, gemini, azureopenai, bedrock, stabilityai, or cohere.","Split the workflow into two tasks: use grok for chat/text and a different provider for image generation.","Contribute a GrokImageModel adapter once xAI ships a stable image-generation endpoint."],"exampleFix":"// before (workflow task input)\n{\"llmProvider\": \"grok\", \"model\": \"grok-2-vision\", \"prompt\": \"a cat\"}\n// after\n{\"llmProvider\": \"openai\", \"model\": \"dall-e-3\", \"prompt\": \"a cat\"}","handlingStrategy":"validation","validationCode":"// Check provider name against known image-capable providers before calling getImageModel()\nprivate static final Set<String> IMAGE_CAPABLE = Set.of(\n    \"openai\", \"gemini\", \"azureopenai\", \"bedrock\", \"stabilityai\", \"cohere\");\n\nString provider = request.getLlmProvider();\nif (!IMAGE_CAPABLE.contains(provider)) {\n    throw new IllegalArgumentException(\n        \"Provider '\" + provider + \"' does not support image generation. \" +\n        \"Supported: \" + IMAGE_CAPABLE);\n}\nImageModel model = llm.getImageModel();","typeGuard":"null","tryCatchPattern":"try {\n    ImageModel model = llm.getImageModel();\n} catch (UnsupportedOperationException e) {\n    throw new IllegalArgumentException(\n        \"Provider '\" + providerName + \"' does not support image generation: \" + e.getMessage(), e);\n}","preventionTips":["Maintain a capability matrix mapping provider names to supported features (chat, image, video, embeddings, speech).","Validate llmProvider against supported capabilities at task-definition time, not at runtime.","Document in workflow definitions which provider each task type requires."],"tags":["grok","image-generation","unsupported-operation","ai","provider"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}