Skip to content

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

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

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 👍 / 👎.

@qqqqqf-q

Copy link
Copy Markdown
Owner

谢谢你的一系列图像生成改进!前端接下来会整体翻新(滚动/渲染都会重写),这批针对旧前端的展示优化没有落点了,只能关闭。好消息是 #87#92 这两个底层小修复已经合入,artifact 覆盖和 attachment 前缀的问题都带上了。感谢!

@qqqqqf-q qqqqqf-q closed this Aug 20, 2026
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.

2 participants