Canvix — Free & open-source graphic design tool. A community-built Canva alternative with a drag-and-drop editor, templates, shapes, text, images & one-click export. Works on desktop, tablet & mobile.
TypeScript canva-alternativecanvasdesigndesign-tooldrag-and-dropeditorgraphic-designkonvanextjsopen-sourcereactself-hostedtemplatestypescript
fix(v0.16.3): image slot probe accepts b64_json responses (CF Workers AI shape) (#42)
Ashiq Hussain Mir6485456140dc
diff --git a/src/lib/ai/probe.test.ts b/src/lib/ai/probe.test.tsindex 6f7bcfe..f2de18a 100644--- a/src/lib/ai/probe.test.ts+++ b/src/lib/ai/probe.test.ts@@ -79,6 +79,13 @@ describe('probeSlot (A3)', () => {expect(generationsCreate).toHaveBeenCalledWith(expect.objectContaining({ prompt: expect.any(String) }))})+ it('accepts OpenAI-style b64_json responses as a successful generation', async () => {+ generationsCreate.mockResolvedValueOnce({ data: [{ b64_json: 'aGk=' }] } as unknown as Awaited<ReturnType<typeof generationsCreate>>)+ const out = await probeSlot('image', TARGET)+ expect(out.verdict.ok).toBe(true)+ expect(out.verdict.message).toContain('end-to-end')+ })+it('image 404 becomes a classified verdict, never a thrown error', async () => {generationsCreate.mockRejectedValueOnce(new Error('API request failed with status 404: 404 page not found'))const out = await probeSlot('image', TARGET)diff --git a/src/lib/ai/probe.ts b/src/lib/ai/probe.tsindex 4d66fa2..f53d38a 100644--- a/src/lib/ai/probe.ts+++ b/src/lib/ai/probe.ts@@ -123,7 +123,10 @@ export async function probeSlot(slot: string, target: ProbeTarget): Promise<{ vesize: '1024x1024',}))- const has = Boolean((r as { data?: { base64?: string }[] }).data?.[0]?.base64)+ // v0.16.3 (A3): OpenAI-compatible providers answer b64_json — the+ // same fallback the image route applies.+ const item = (r as { data?: { base64?: string; b64_json?: string }[] }).data?.[0]+ const has = Boolean(item?.base64 ?? item?.b64_json)return {verdict: {ok: true,@@ -132,7 +135,7 @@ export async function probeSlot(slot: string, target: ProbeTarget): Promise<{ vehttpStatus: 200,message: has? 'Generated a test image end-to-end — the full path works.'- : 'The provider answered but returned no image data.',+ : 'The provider answered but returned no image data — check the Logs view for its error (prompt filters reject benign probes now and then).',},}} catch (err) {