Upgrade OpenAI image generation to GPT Image - #67
Merged
Dereje1 merged 1 commit intoJul 21, 2026
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.
Motivation
imgURLcontract and existingprocessImage()/S3 logic.Description
openaidependency range to^4.52.1inpackage.jsonandpackage-lock.jsonto match a GPT Image-capable SDK.server/controllers/post.tsto useOPENAI_IMAGE_MODEL = process.env.OPENAI_IMAGE_MODEL || 'gpt-image-1', replaced the hard-codeddall-e-3, and keptn: 1andsize: '1024x1024'.b64_jsonresponses by converting todata:image/png;base64,<base64>and retainingurlas a fallback, and changed persisted AI-generated data to only store lightweight metadata (created, hasUrl, hasB64Json, model) rather than the full base64.tests/server/controllers/post.test.tsto cover the configured model call, base64 (b64_json) handling, URL fallback, missing-image payload, and verification that the full base64 payload is not persisted, and documentedOPENAI_IMAGE_MODEL=gpt-image-1inREADME.md.package.json,package-lock.json,server/controllers/post.ts,tests/server/controllers/post.test.ts,README.md.Testing
npx jest tests/server/controllers/post.test.ts --runInBandand they passed.npm test -- --watch=false --runInBandand all test suites passed.npm run compileTSwhich succeeded, and lint withnpm run lintwhich succeeded after a minor test-line-length fix.npm run build_serverandnpm run build_client, both completed successfully.npm install openai@^4.52.1 --package-lock-onlycould not be completed in this environment due to an HTTP 403 from the registry/proxy, so the lockfile entries were updated in-place and all local automated checks used the updated files and mocked OpenAI behavior.Codex Task