Reuse parent compactions in Guardian review sessions (#37513)

## What changed

- Add the under-development `guardian_reuse_parent_compaction` feature.
- Restart Guardian review sessions after parent history rewrites and seed them with the latest encrypted compaction that has a response item ID.
- Keep the existing reviewer when a rewritten history has no reusable compaction, preserving authorization and restriction context held by that session.

## Testing

- Cover reuse-key invalidation and compaction eligibility.
- Verify review-session behavior across parent compaction and a subsequent summary-free history reset.

GitOrigin-RevId: 891805d3c3dca34ddda6e3bfc5097be4ff164267
This commit is contained in:
Won Park
2026-08-07 23:40:46 +00:00
committed by copyberry
parent 208f05b233
commit c2bcb9a26b
4 changed files with 260 additions and 33 deletions

View File

@@ -247,6 +247,8 @@ pub enum Feature {
DefaultModeRequestUserInput,
/// Enable automatic review for approval prompts.
GuardianApproval,
/// Reuse encrypted parent compaction when restarting Guardian review sessions.
GuardianReuseParentCompaction,
/// Enable Guardian V2 automatic approval reviews.
GuardianV2,
/// Enable persisted thread goals and automatic goal continuation.
@@ -1365,6 +1367,12 @@ pub const FEATURES: &[FeatureSpec] = &[
stage: Stage::Stable,
default_enabled: true,
},
FeatureSpec {
id: Feature::GuardianReuseParentCompaction,
key: "guardian_reuse_parent_compaction",
stage: Stage::UnderDevelopment,
default_enabled: false,
},
FeatureSpec {
id: Feature::GuardianV2,
key: "guardianv2",