Present encrypted subagent replies as evidence in Guardian reviews (#63926)

## Why

Encrypted replies from subagents can provide evidence for a Guardian
decision. Reviewer compaction can drop those replies when it filters
descendant progress and completion messages.

## What changed

When native multi-agent history is enabled and the reviewer uses the
OpenAI provider, send encrypted replies from descendants to ancestors
as standalone `guardian.subagent_reply` tool outputs in Guardian review
and async scoring requests. Include the sender and recipient, preserve
the encrypted payload, and keep native message IDs in stored history
for deduplication.

Retain qualifying replies across reviewer compaction within the existing
per-message and shared token budgets.

## Testing

Extend regression coverage for incremental reviews, compaction recovery
with and without native agent review, and reply ID stability across
retained WebSocket scoring requests.

GitOrigin-RevId: bb46149426b1a60a6ed5cac6765283ec77682d23
This commit is contained in:
jif
2026-11-25 14:22:54 +00:00
committed by copyberry
parent e8fb104cd6
commit d3ca5182df
15 changed files with 339 additions and 45 deletions
+5
View File
@@ -1920,6 +1920,11 @@ impl Session {
workspace_routing.as_ref().clone(),
extensions.model_request_contributors().to_vec(),
)
.with_guardian_reply_rendering(
thread_extension_data
.get::<crate::client::QuoteGuardianReplies>()
.is_some(),
)
.with_budget_policy(budget_policy.clone())
.with_executed_tool_calls(executed_tool_calls.clone())
.with_restored_history(matches!(