Repository navigation
Conversation
Moderation now uses omni-moderation-latest, and ImageStore constructs image requests with gpt-image-1 and size options supported by that model. The image view displays progress, request errors, and decoded base64 images while retaining URL support. Starting a request cancels the previous subscription and clears stale results and errors; cancellation ends progress without displaying an error. The diff adds tests for request parameters, moderation success and failure, image errors, retries, base64 results, and cancellation. Refs MacPaw#478
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.
What
Moderation Chat rejects messages with an invalid-model error. Creating an image silently fails, leaving the user without an image, progress feedback, or an explanation. Moderation requests use the rejected text-moderation-latest model, while image creation omits the required model parameter. Image failures are only printed, and the view only handles URL responses, so it cannot display base64 image results.
Moderation now uses omni-moderation-latest, and ImageStore constructs image requests with gpt-image-1 and size options supported by that model. The image view displays progress, request errors, and decoded base64 images while retaining URL support. Starting a request cancels the previous subscription and clears stale results and errors; cancellation ends progress without displaying an error. The diff adds tests for request parameters, moderation success and failure, image errors, retries, base64 results, and cancellation.
Ran
xcodebuild test -scheme DemoChatfor MiscStoreTests and ImageStoreTests on an iPhone 17 simulator (iOS 26.4): 3 tests (11 test cases) pass with this change.The moderation half has a runtime regression test: with the source changes reverted, MiscStoreTests compiles and fails because the request sends text-moderation-latest instead of omni-moderation-latest.
The image half is covered by ImageStoreTests, which call the new images(prompt:n:size:) entry point and read imagesQueryError. Those APIs do not exist on main, so these tests cannot run against the old code.
Refs #478
Why
The October 27 Demo release check (#478) found that Moderation Chat fails on every message and that image creation appears to do nothing. This covers those two items; the other observations in that report are left for follow-up.
Affected Areas
Demo app only:
MiscStore.swift,ImageStore.swiftandImageCreationView.swift, plus the newMiscStoreTests.swiftandImageStoreTests.swift. No library code changes.