fix: permissive bugfixes and FLUX image generation#17
Merged
seanfromthepast merged 3 commits intomainfrom Mar 12, 2026
Merged
Conversation
The sync endpoint's broad except-Exception handler was swallowing the 422 HTTPException from resolve_model_policy() and re-wrapping it as 500.
- Use google/gemini-2.5-flash-image (exists on OpenRouter) instead of -preview variant (404) when no open-weight image models available - Accept string or PromptIssue in ImagePromptOptimizerOutput.issues_found to avoid retry storms when DeepSeek returns plain strings
…neration - Default permissive image model is now FLUX.2 Pro via OpenRouter - Add black-forest-labs/ to PERMISSIVE_PREFIXES and OPENROUTER_PREFIXES - OpenRouter provider sends modalities: ["image"] for FLUX models (image-only models don't support ["image", "text"]) - Update downstream docs with FLUX as permissive image default
seanfromthepast
approved these changes
Mar 12, 2026
realityinspector
pushed a commit
that referenced
this pull request
Mar 15, 2026
* fix: let HTTPException (422) pass through sync endpoint's generic catch The sync endpoint's broad except-Exception handler was swallowing the 422 HTTPException from resolve_model_policy() and re-wrapping it as 500. * fix: permissive image fallback and optimizer schema tolerance - Use google/gemini-2.5-flash-image (exists on OpenRouter) instead of -preview variant (404) when no open-weight image models available - Accept string or PromptIssue in ImagePromptOptimizerOutput.issues_found to avoid retry storms when DeepSeek returns plain strings * feat: use FLUX (black-forest-labs/flux.2-pro) for permissive image generation - Default permissive image model is now FLUX.2 Pro via OpenRouter - Add black-forest-labs/ to PERMISSIVE_PREFIXES and OPENROUTER_PREFIXES - OpenRouter provider sends modalities: ["image"] for FLUX models (image-only models don't support ["image", "text"]) - Update downstream docs with FLUX as permissive image default
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
except Exceptionwas swallowing the 422 HTTPException from permissive policy validation, returning 500 insteadgoogle/gemini-2.5-flash-image-previewdoesn't exist on OpenRouter (404). Schema tolerance forImagePromptOptimizerOutput.issues_found(DeepSeek returns strings instead of objects, causing retry storms)black-forest-labs/flux.2-provia OpenRouter. Addblack-forest-labs/to PERMISSIVE_PREFIXES and OPENROUTER_PREFIXES. OpenRouter provider sendsmodalities: ["image"]for FLUX (image-only models)Test plan
model_policy=permissivewith image uses FLUX via OpenRouterpytest -m fastpasses