Skip to content

feat: stable image generation artifact display with dedup and multi-i…#86

Open
DivXPro wants to merge 1 commit into
qqqqqf-q:mainfrom
DivXPro:feat/imageGenDisplay
Open

feat: stable image generation artifact display with dedup and multi-i…#86
DivXPro wants to merge 1 commit into
qqqqqf-q:mainfrom
DivXPro:feat/imageGenDisplay

Conversation

@DivXPro

@DivXPro DivXPro commented May 26, 2026

Copy link
Copy Markdown
Contributor

…mage support

Replace single artifactRef with generatedImages data model to handle multiple images per image_generate call without overwriting. Images render via GeneratedImageGroup in the assistant turn path, with markdown suppression via suppressedArtifactKeys to prevent duplicates.

Fix: when hasAssistantTurn=true, skip passing generatedImages to MessageBubble to avoid double rendering in both segment and bubble paths.

…mage support

Replace single artifactRef with generatedImages data model to handle
multiple images per image_generate call without overwriting. Images render
via GeneratedImageGroup in the assistant turn path, with markdown
suppression via suppressedArtifactKeys to prevent duplicates.

Fix: when hasAssistantTurn=true, skip passing generatedImages to
MessageBubble to avoid double rendering in both segment and bubble paths.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a187271450

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

): GeneratedImageItem[] {
const seen = new Set(prev.map((item) => item.artifact.key))
const additions: GeneratedImageItem[] = []
let order = 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep generated image ordering monotonic across appends

appendGeneratedImages resets order to 0 on every call, but the final list is sorted by (toolCallIndex, order). When multiple image_generate results share the same toolCallIndex (for example, repeated/continued tool phases that reuse indices), later images can be reinserted ahead of earlier ones (e.g., 0,1 then 0 sorts as 0,0,1), which breaks the intended stable display order. Use a monotonic base order (or include event sequence) so newly appended images always stay after previously accepted images within the same index bucket.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant