{"record":{"id":"1b6fbf277f66341a","repo":"linshenkx/prompt-optimizer","slug":"unsupported-test-type-1b6fbf","errorCode":"UNSUPPORTED_TEST_TYPE","errorMessage":"UNSUPPORTED_TEST_TYPE","messagePattern":"UNSUPPORTED_TEST_TYPE","errorType":"error_code","errorClass":"ImageError","httpStatus":null,"severity":"warning","filePath":"packages/core/src/services/image/adapters/ollama.ts","lineNumber":111,"sourceCode":"        .map((model: any) => (typeof model?.id === 'string' ? model.id.trim() : ''))\n        .filter((id: string) => !!id)\n        .map((id: string) => this.buildDefaultModel(id))\n        .sort((a: ImageModel, b: ImageModel) => a.id.localeCompare(b.id))\n    } catch (error) {\n      console.warn('[OllamaImageAdapter] Failed to fetch models:', error)\n      return []\n    }\n  }\n\n  protected getTestImageRequest(testType: 'text2image' | 'image2image'): Omit<ImageRequest, 'configId'> {\n    if (testType === 'text2image') {\n      return {\n        prompt: 'a simple red flower',\n        count: 1\n      }\n    }\n\n    throw new ImageError(IMAGE_ERROR_CODES.UNSUPPORTED_TEST_TYPE, undefined, { testType })\n  }\n\n  protected getParameterDefinitions(_modelId: string): readonly ImageParameterDefinition[] {\n    // Keep this minimal; Ollama's OpenAI-compatible image API is experimental.\n    return [\n      {\n        name: 'size',\n        labelKey: 'image.params.size.label',\n        descriptionKey: 'image.params.size.description',\n        type: 'string',\n        defaultValue: '1024x1024',\n        allowedValues: ['1024x1024', '1536x1024', '1024x1536', 'auto']\n      }\n    ]\n  }\n\n  protected getDefaultParameterValues(_modelId: string): Record<string, unknown> {\n    return { size: '1024x1024' }","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/linshenkx/prompt-optimizer/blob/3e677b1d9f7e0493c142c175560531e7ae786dce/packages/core/src/services/image/adapters/ollama.ts#L93-L129","documentation":"The Ollama image adapter's getTestImageRequest supports only its defined test types; any other testType throws UNSUPPORTED_TEST_TYPE with the value in metadata. Mirrors the same pattern as other adapters.","triggerScenarios":"Running a model connectivity test with an unsupported testType against an Ollama-hosted image model — e.g. an edit or i2i test type, since Ollama's image API is text-to-image only.","commonSituations":"Generic test harnesses enumerating all test types; Ollama's experimental OpenAI-compatible image API lacking endpoints for the requested test kind.","solutions":["Use the supported text-to-image test type for Ollama models","Gate test options by provider capability in the calling UI","Contribute support if Ollama adds the capability"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const OLLAMA_TESTS = new Set(['text2image'])\nif (provider === 'ollama' && !OLLAMA_TESTS.has(testType)) return skip()","typeGuard":"function ollamaSupportsTest(t: string): boolean { return t === 'text2image' }","tryCatchPattern":"if (!ollamaSupportsTest(testType)) return\nawait adapter.getTestImageRequest(testType)","preventionTips":["Filter test types by provider capability","Handle UNSUPPORTED_TEST_TYPE as a skip in test reports"],"tags":["ollama","test","unsupported-operation"],"backgroundTag":"unsupported-operation-parameter","analyzedSha":"3e677b1d9f7e0493c142c175560531e7ae786dce","analyzedAt":"2026-08-27T21:29:16.709Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}