Always use streamed remote compaction for supported providers (#44255)

## What changed

- Route manual and automatic remote compaction through the v2 implementation.
- Retire the `remote_compaction_v2` feature toggle while continuing to advertise it in the model client beta features header.
- Migrate compaction tests from `/responses/compact` to streamed `/responses` requests with `compaction_trigger` items and remove legacy parity coverage.

## Testing

Add streamed compaction coverage for tool search output trimming and session base instruction token estimates. Update app-server tests to verify started/completed notifications for both local and streamed remote compaction.

GitOrigin-RevId: cea392a6166a9b116ff83708fd9126d5546476e4
This commit is contained in:
rka-oai authored and copyberry committed 2026-09-09 18:04:04 +00:00
1 parent 2617ed2e1c
commit 3dc1e2a584
25 files changed
+675 -5635

No files matched your search

+1 -24
View File
@@ -9,7 +9,6 @@ use crate::client_common::Prompt;
use crate::client_common::ResponseEvent;
use crate::compact::InitialContextInjection;
use crate::compact::run_inline_auto_compact_task;
use crate::compact_remote::run_inline_remote_auto_compact_task;
use crate::compact_remote_v2::run_inline_remote_auto_compact_task as run_inline_remote_auto_compact_task_v2;
use crate::connectors;
use crate::context::ContextualUserFragment;
@@ -1315,12 +1314,7 @@ async fn run_auto_compact(
}
match turn_context.provider.capabilities().remote_compaction {
RemoteCompactionSupport::V2
if turn_context
.config
.features
.enabled(Feature::RemoteCompactionV2) =>
{
RemoteCompactionSupport::V2 => {
emit_compact_metric(
&sess.services.session_telemetry,
"remote_v2",
@@ -1337,23 +1331,6 @@ async fn run_auto_compact(
)
.await?;
}
RemoteCompactionSupport::V2 => {
emit_compact_metric(
&sess.services.session_telemetry,
"remote",
/*manual*/ false,
);
run_inline_remote_auto_compact_task(
Arc::clone(sess),
step_context,
fallback_step_context,
client_session.turn_state(),
initial_context_injection,
reason,
phase,
)
.await?;
}
RemoteCompactionSupport::Unsupported => {
emit_compact_metric(
&sess.services.session_telemetry,