Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c86d59542c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| raw_aspect_ratio = item.get("aspect_ratio", DEFAULT_ASPECT_RATIO) | ||
| if not is_supported_aspect_ratio(raw_aspect_ratio): |
There was a problem hiding this comment.
Treat null aspect_ratio as default in generate_images
The OpenAI strict tool schema now permits aspect_ratio: null for prompt items (see _make_responses_schema_strict, which marks properties nullable and appends null to enums), but this validator rejects that payload: item.get("aspect_ratio", DEFAULT_ASPECT_RATIO) returns None when the key is present with null, then is_supported_aspect_ratio(None) fails and the tool errors. That makes schema-valid strict tool calls fail at runtime instead of falling back to the default aspect ratio.
Useful? React with 👍 / 👎.
| ) | ||
|
|
||
| grouped_items = list(grouped_requests.items()) | ||
| grouped_results = await asyncio.gather( |
There was a problem hiding this comment.
Keep Replicate batching global across aspect-ratio groups
Launching one process_tasks call per aspect-ratio group via asyncio.gather removes the previous global concurrency cap for Flux requests: each group enforces REPLICATE_BATCH_SIZE independently, so mixed-ratio requests can now issue groups × REPLICATE_BATCH_SIZE concurrent Replicate calls. This increases burst load and can trigger rate-limit or stability issues for prompts that span multiple aspect ratios.
Useful? React with 👍 / 👎.
This updates generate_images to use prompt objects with optional per-image aspect_ratio and removes batch-level aspect ratio handling. It adds shared aspect-ratio constants and validation, and threads aspect ratio through Flux generation while allowing providers like DALL-E to ignore it. It also updates the system prompt guidance and Agent Activity UI to surface aspect ratios in a muted way per image. Tests were expanded to cover schema compatibility (including OpenAI strict tool schema), per-image batching, and validation behavior.