Skip to content

Feat/restore image generation history#15223

Merged
won-openai merged 11 commits intomainfrom
feat/restore-image-generation-history
Mar 20, 2026
Merged

Feat/restore image generation history#15223
won-openai merged 11 commits intomainfrom
feat/restore-image-generation-history

Conversation

@won-openai
Copy link
Collaborator

Restore image generation items in resumed thread history

@won-openai
Copy link
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ 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".

Copy link
Contributor

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

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: db2240182f

ℹ️ 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".

@won-openai won-openai force-pushed the feat/restore-image-generation-history branch from 180df2d to 18baff0 Compare March 20, 2026 02:25
Copy link
Contributor

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

Choose a reason for hiding this comment

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

💡 Codex Review

ThreadItem::ImageGeneration {
id,
status,
revised_prompt,
result,
} => Some(TurnItem::ImageGeneration(ImageGenerationItem {

P1 Badge Update test adapter for new saved_path field

ThreadItem::ImageGeneration gained a saved_path field, but this exhaustive match arm still destructures without ../saved_path. The same file also constructs ThreadItem::ImageGeneration test fixtures without the new field, so cargo test -p codex-tui-app-server test builds will fail to compile.

ℹ️ 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".

@won-openai
Copy link
Collaborator Author

@codex review

Copy link
Contributor

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

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: 9452e68d3e

ℹ️ 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".

model_provider: "fallback".to_string(),
cwd: PathBuf::new(),
cli_version: String::new(),
source: SessionSource::VSCode,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

flakycode/testcase

Copy link
Contributor

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

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: 347b9b8cf2

ℹ️ 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".

Comment on lines +142 to +148
RolloutItem::EventMsg(EventMsg::ImageGenerationEnd(mut event))
if mode == EventPersistenceMode::Limited && event.saved_path.is_some() =>
{
// ResponseItem::ImageGenerationCall already persists the inline base64 payload.
// Keep only the saved-path metadata in limited rollouts to avoid storing the blob twice.
event.result.clear();
RolloutItem::EventMsg(EventMsg::ImageGenerationEnd(event))
Copy link
Contributor

Choose a reason for hiding this comment

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

P1 Badge Preserve inline image fallback in limited rollouts

Do not clear ImageGenerationEnd.result at persist time solely because saved_path is present. This erases the only portable copy of image bytes; if the file is later deleted/unavailable, resumed threads cannot render the image anymore. The read path already conditionally clears only when saved_path exists on disk, so this unconditional write-time clearing causes data loss.

Useful? React with 👍 / 👎.

Copy link
Contributor

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

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: a4dca4695f

ℹ️ 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".

};

if Path::new(saved_path).is_file() {
result.clear();
Copy link
Contributor

Choose a reason for hiding this comment

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

P1 Badge Keep inline image data when serving extended-history threads

clear_inline_image_results_for_saved_files always blanks ThreadItem::ImageGeneration.result when saved_path exists. This runs for resumed turns regardless of rollout persistence mode, so extended-history sessions lose their inline image payloads even though extended mode is meant to preserve detailed event data. Clients that cannot open the server-local file path get an empty image result.

Useful? React with 👍 / 👎.

@won-openai won-openai force-pushed the feat/restore-image-generation-history branch from a4dca46 to 0552a98 Compare March 20, 2026 05:03
@won-openai
Copy link
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ 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".

@won-openai won-openai merged commit 461ba01 into main Mar 20, 2026
38 of 40 checks passed
@won-openai won-openai deleted the feat/restore-image-generation-history branch March 20, 2026 05:57
@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants