Add an experimental rollout compression endpoint (#46020)

## What changed

Add `rollout/compress` to trigger a best-effort background compression pass for cold local rollouts, even when `features.local_thread_store_compression` is disabled. The method takes no parameters and immediately returns `{}` to acknowledge scheduling, not completion. Existing worker locks, concurrency limits, and cooldowns still apply.

Require the `experimentalApi` capability and reject non-local thread stores. Document the endpoint and the requirement that clients sharing the Codex home support compressed rollout files.

## Testing

Add integration tests for compression with the startup flag disabled, lossless rollout readback, experimental capability enforcement, and rejection of non-local thread stores.

GitOrigin-RevId: be73a3b3f37f3adc54512de8256abf684d5d8112
This commit is contained in:
jif
2026-09-16 20:39:18 +00:00
committed by copyberry
parent 6d75b525ea
commit 0d083092b4
10 changed files with 192 additions and 0 deletions
@@ -715,6 +715,13 @@ client_request_definitions! {
serialization: global("memory"),
response: v2::MemoryResetResponse,
},
#[experimental("rollout/compress")]
/// Start a best-effort background compression pass for cold local rollouts.
RolloutCompress => "rollout/compress" {
params: #[ts(type = "undefined")] #[serde(skip_serializing_if = "Option::is_none")] Option<()>,
serialization: None,
response: v2::RolloutCompressResponse,
},
ThreadUnarchive => "thread/unarchive" {
params: v2::ThreadUnarchiveParams,
serialization: thread_id(params.thread_id),
@@ -30,6 +30,7 @@ mod project;
mod realtime;
mod remote_control;
mod review;
mod rollout;
mod thread;
mod thread_attachment;
mod thread_data;
@@ -68,6 +69,7 @@ pub use project::*;
pub use realtime::*;
pub use remote_control::*;
pub use review::*;
pub use rollout::*;
pub use shared::*;
pub use thread::*;
pub use thread_attachment::*;
@@ -0,0 +1,13 @@
//! Fire-and-forget maintenance requests for local rollout storage.
use crate::JsonSchema;
use crate::TS;
use serde::Deserialize;
use serde::Serialize;
/// Acknowledges the compression trigger, not completion. Existing maintenance
/// locks and cooldowns can cause the background pass to skip without doing work.
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct RolloutCompressResponse {}