Keep image resize notices attached during remote compaction (#36956)

## Why

Image resize notices describe the history item immediately before them, so
remote compaction must not preserve or discard them independently of that item.

## What changed

- Group recognized `image_resize_notice` developer messages with their source
  history items when filtering compacted history.
- Account for each group together when trimming or truncating history to a token
  budget, preserving the notice only when its source is retained.

## Testing

- Extend the remote compaction v2 follow-up test to verify that a retained user
  image keeps its resize notice, while notices for discarded items and
  unrecognized developer notices are omitted.

GitOrigin-RevId: 82bb70a46eb68b07b4601e7fb345921d0789f442
This commit is contained in:
rka-oai authored and copyberry committed 2026-08-04 19:33:18 +00:00
1 parent 9952933c1d
commit 4bd5b9fd09
5 files changed
+174 -24

No files matched your search

+1
View File
@@ -22,6 +22,7 @@ pub use turn_metadata::detached_memory_responses_metadata;
mod codex_thread;
mod compact_model_fallback;
mod compact_remote;
mod compact_remote_history;
mod compact_remote_v2;
mod compact_token_budget;
mod config_lock;