tui: preserve remote image attachments across resume/backtrack#10590
tui: preserve remote image attachments across resume/backtrack#10590charley-oai merged 32 commits intomainfrom
Conversation
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f885dff4d6
ℹ️ 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".
ebcfde4 to
6f8ee0e
Compare
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f8ee0e891
ℹ️ 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".
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6266fc0b8b
ℹ️ 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".
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e8cf40dce
ℹ️ 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".
|
All contributors have signed the CLA ✍️ ✅ |
57a5637 to
0442033
Compare
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04420335e2
ℹ️ 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".
84a0a05 to
381d687
Compare
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
codex/codex-rs/tui/src/bottom_pane/chat_composer.rs
Lines 2139 to 2143 in 381d687
The new remote-image support allows submissions with pending_non_editable_image_urls, but history entries recorded here only capture text/local images and are gated on !text.is_empty() || !self.attached_images.is_empty(). That means (a) remote‑only submissions never enter ChatComposerHistory, and (b) submissions that include remote images will be recalled via Up/Down without those remote images. Users who backtrack/resume a remote‑image message and later use history navigation will silently drop the remote attachments. Consider storing remote image URLs in HistoryEntry (and recording/rehydrating them) so history recall preserves the full submission, including remote‑only cases.
ℹ️ 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".
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 106bb9e60c
ℹ️ 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".
a2099c3 to
fbcca43
Compare
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fbcca43a56
ℹ️ 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".
1673f23 to
2c9819b
Compare
2c9819b to
ca60dcb
Compare
e5e0e60 to
f9cf89d
Compare
97cd3ef to
a9600fa
Compare
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9600fa92d
ℹ️ 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".
|
@codex review this |
c2e8a35 to
0ef19af
Compare
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b22817ea5c
ℹ️ 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".
| let mut next_image_label = total_remote_images + 1; | ||
|
|
||
| for (idx, message) in to_merge.into_iter().enumerate() { | ||
| if idx > 0 { |
There was a problem hiding this comment.
Skip separator newlines for remote-only queued messages
drain_queued_messages_for_restore unconditionally inserts \n for every merged entry after the first. Remote-image-only turns now have empty text, so if one is queued before a text turn, restore prepends a blank line and shifts TextElement byte ranges, changing the resubmitted prompt after an interrupt. Handle empty-text messages without adding separators.
Useful? React with 👍 / 👎.
Summary
This PR makes app-server-provided image URLs first-class attachments in TUI, so they survive resume/backtrack/history recall and are resubmitted correctly.
Can delete the attached image upon backtracking:

In both history and composer, remote images are rendered as normal
[Image #N]placeholders, with numbering unified with local images.What changed
UserHistoryCellBacktrackSelectionChatComposerHistory::HistoryEntryChatWidget::UserMessageUp/Down,Delete/Backspace).UserInput::Image), and keep request shape stable for remote-image-only turns.[Image #1]..[Image #M][Image #M+1]AppEvent::ApplyThreadRollbackand syncs transcript overlay/deferred lines after trims, so overlay/transcript state stays consistent.Docs + tests
docs/tui-chat-composer.md(remote image flow, selection/deletion, numbering offsets)tui/src/chatwidget/tests.rs,tui/src/app.rs,tui/src/app_backtrack.rs,tui/src/history_cell.rs, andtui/src/bottom_pane/chat_composer.rsValidation
just fmtcargo test -p codex-tuiCodex author
codex fork 019c2636-1571-74a1-8471-15a3b1c3f49d