Skip to content

fix(gemini): handle blob-backed generated images#115

Open
goneflyin wants to merge 1 commit into
nicobailon:mainfrom
goneflyin:fix/gemini-blob-image-generation
Open

fix(gemini): handle blob-backed generated images#115
goneflyin wants to merge 1 commit into
nicobailon:mainfrom
goneflyin:fix/gemini-blob-image-generation

Conversation

@goneflyin
Copy link
Copy Markdown

Summary

  • detect Gemini generated images that now render as blob: URLs, not only lh3 gg-dl URLs
  • convert blob-backed images to base64 in the Gemini page context before saving
  • keep existing gg-dl URL download path for older UI responses
  • add a regression test for blob-backed image detection

Why

Gemini image generation can complete successfully in the browser but surf gemini --generate-image keeps polling until timeout because the UI now renders the generated image as blob:https://gemini.google.com/.... The existing poller only looks for img[src*="gg-dl"], so image-only responses have no success condition.

Test plan

  • npm test -- --run test/unit/gemini-client.test.ts
  • npm test -- --run test/unit/chatgpt-client.test.ts test/unit/grok-client.test.ts

Note: npm run check and npm run lint currently fail on main due to unrelated existing TypeScript/Biome config errors.

@goneflyin
Copy link
Copy Markdown
Author

In all candor, totally used Pi to generate this PR without looking closely at the surf code... not my milieu.

Pretty sure it works and is accurate, but feel free to yell at me if not and I'll revise as needed. Thanks for the tool!

@goneflyin goneflyin force-pushed the fix/gemini-blob-image-generation branch from 3f83839 to 3f16d99 Compare May 21, 2026 22:02
@goneflyin goneflyin force-pushed the fix/gemini-blob-image-generation branch from 3f16d99 to 7e31000 Compare May 21, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant