Drop descendant channel posts from retained remote compaction v2 history (#47249)

## Why

Remote compaction v2 excluded descendant progress messages from retained history but kept `CHANNEL_POST` messages from those same agents.

## What changed

Treat descendant `CHANNEL_POST` messages like `MESSAGE` progress updates when selecting history to retain after remote compaction v2.

## Testing

Extend the remote compaction test to verify that a child channel post is included in the compaction input and omitted from the follow-up request.

GitOrigin-RevId: 204bf44b8cddf1e6dc1e48234f51d4ac2aaf2e9f
This commit is contained in:
jif
2026-09-22 10:44:00 +00:00
committed by copyberry
parent 3b50349e1a
commit c117207a6f
2 changed files with 26 additions and 0 deletions
+1
View File
@@ -572,6 +572,7 @@ fn is_retained_for_remote_compaction_v2(
content.first(),
Some(AgentMessageInputContent::InputText { text })
if text.starts_with("Message Type: MESSAGE\n")
|| text.starts_with("Message Type: CHANNEL_POST\n")
);
let is_completion = matches!(
content.first(),