Skip to content

feat(copilot): support image generation and editing - #2

Open
billxc wants to merge 2 commits into
mainfrom
user/xiaocw/copilot-images
Open

billxc wants to merge 2 commits into
mainfrom
user/xiaocw/copilot-images

Conversation

@billxc

@billxc billxc commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

Enable image generation and editing through GitHub Copilot upstreams. Copilot advertises GPT Image 2.5 Flare with Images API endpoints, but Floway previously discarded those capabilities and rejected image calls.

  • Derive generation and edit capabilities independently from the upstream model catalog, without hardcoding model IDs.
  • Forward image generation and JSON/multipart image editing through the existing authenticated Copilot transport.
  • Construct JSON bodies and their media types together; have the image-edit serializer return the encoded body with its headers.
  • Keep content-type decisions out of Copilot authentication, and let the transport generate multipart boundaries.
  • Update Custom/Azure image-edit callers to consume the serialized request without changing their protocol behavior.
  • Preserve upstream responses and existing image usage accounting.

This change is backend-only; the Playground does not yet expose image-generation models.

Validation

  • 139 tests passed across nine explicitly selected request-encoding, provider, authentication, model-discovery/merging, and gateway image test files.
  • ESLint passed for all 14 changed files.
  • TypeScript checks passed for provider, provider-copilot, provider-azure, provider-custom, and gateway.
  • Real end-to-end requests were repeated after the cleanup through an isolated local Floway server using an authorized Copilot account:
    • /v1/images/generations: HTTP 200 in approximately 10 seconds.
    • /v1/images/edits with a multipart upload: HTTP 200 in approximately 12 seconds.
    • Both outputs fully decoded as 1024×1024 PNGs; the edit changed blue foreground pixels to red.
    • Both requests and separate text/image token quantities were recorded in the local usage database.
  • SSE/partial-image streaming and real JSON-reference editing were not tested.

No local credentials, databases, logs, or generated images are included in this PR.

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