Repository navigation
fix(images): use standalone Images requests for ChatGPT subscriptions - #3741
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ChatGPT subscription image generation currently starts a secondary chat completion and asks it to call an image tool. Send a standalone Images JSON request instead, so generation no longer depends on chat-model discovery or orchestration.
The subscription route uses
/images/generationswith the desktop-capture defaults (gpt-image-2,quality: auto,size: auto, opaque background). Explicit image parameters and supported output formats are preserved. JSON image responses and provider errors use the existing image transport and decoding path.Type and Areas
Type: Bug fix / protocol compatibility
Areas: AI adapters, image-generation tool results, configuration contracts, model settings, locales, focused tests
Motivation / Impact
/responsesURLs in memory without rewriting stored services, deleting credentials, or reinterpreting legacy chat-model names as image-model IDs. Keep thechatgpt_codexserialized dialect value.Verification
Focused checks completed during implementation:
cargo test --locked -p openbitfun-ai-adapters --features image-generation,subscription-auth --lib client::image_generation::tests— 24 passed; the billed live probe is ignored by default.cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,git,tools-image-generation --lib agentic::tools::implementations::generate_image_tool::tests— 8 passed.cargo test --locked -p openbitfun-core-types --lib ai::image_dialect_compatibility— 1 passed.pnpm --dir src/web-ui run test:run src/infrastructure/config/components/image-generation/imageDialects.test.ts src/infrastructure/config/components/image-generation/imageModels.test.ts src/infrastructure/config/components/image-generation/ImageGenerationSettings.test.tsx— 47 passed after rebasing onto upstream main.pnpm run i18n:audit— passed after rebase, zero warnings.pnpm run type-check:web— passed after rebase.git diff --check upstream/main...HEAD— passed.The post-rebase adapter repeat could not acquire the shared Cargo build lock and was stopped while another workspace build continued. The 24 passing adapter tests above were run before rebase; the adapter source, its Cargo manifest, and Cargo.lock are unchanged by the rebase.
Live provider validation used an existing in-app login and the production adapter: a standalone subscription request returned a valid 1254×1254 PNG in approximately 22.5 seconds. A separate GIF request was explicitly rejected with
GIF output is not enabled for this request.GIF parameter forwarding is covered, but live GIF availability is not claimed.Local repository-wide checks have unrelated blockers:
pnpm run check:web: stale MiniAppchat-styles.cssprojection; the projection check still fails after rebase.node scripts/check-core-boundaries.mjs: EACCES while reading the extension-hostnode_modules/.bin/download-msgpackr-prebuildsentry.Reviewer Notes
The model identifier is the requested ID, not a provider-reported effective backend model. No persisted shape, credentials, host commands, or remote protocol requirements are added. Live validation was local to the adapter; GUI, SSH workspaces, Remote Connect, Peer Device Mode, and Detached Dispatch were not exercised. Broader builds and platform validation are left to CI.
Checklist