mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Refactor session mail recording and compaction metadata capture (#61461)
## What changed - Consume the optional delivery handle directly when recording inter-agent messages. - Capture compaction resume metadata before constructing the `CompactedItem`. - Move the existing inter-agent message rollout and resume test into `mail_publication_tests.rs`, preserving its assertions for turn IDs, timestamps, persisted metadata, and restored history. GitOrigin-RevId: 761a837922377d5a72266d775622211e43fa87d3
This commit is contained in:
committed by
copyberry
parent
c2c1ebba0a
commit
ecf54824c6
@@ -4736,6 +4736,8 @@ impl Session {
|
||||
for mut recording in pending {
|
||||
let _ = recording.changed().await;
|
||||
}
|
||||
let mut delivery = communication.delivery.as_ref();
|
||||
let mut result_write = None;
|
||||
{
|
||||
let mut state = self.state.lock().await;
|
||||
state.current_time_reminder.note_recorded_items(&items);
|
||||
@@ -4744,7 +4746,9 @@ impl Session {
|
||||
model_info.truncation_policy.into(),
|
||||
);
|
||||
}
|
||||
let result_write = communication.consumed(self.thread_id);
|
||||
if let Some(delivery) = delivery.take() {
|
||||
result_write = delivery.consumed(self.thread_id);
|
||||
}
|
||||
let saved = self
|
||||
.persist_rollout_items(&[
|
||||
RolloutItem::InterAgentCommunicationMetadata {
|
||||
@@ -4954,6 +4958,7 @@ impl Session {
|
||||
state
|
||||
.history
|
||||
.set_world_state_baseline(world_state_baseline.clone());
|
||||
let resume_metadata = self.compaction_resume_metadata(&state);
|
||||
let compacted_item = CompactedItem {
|
||||
message: metadata.message,
|
||||
replacement_history: Some(replacement_history),
|
||||
@@ -4966,7 +4971,7 @@ impl Session {
|
||||
window_id: Some(metadata.window_ids.window_id),
|
||||
compaction_response_id: metadata.compaction_response_id,
|
||||
latest_token_usage_record: state.latest_token_usage_record.clone(),
|
||||
resume_metadata: Some(self.compaction_resume_metadata(&state)),
|
||||
resume_metadata: Some(resume_metadata),
|
||||
};
|
||||
(compacted_item, world_state_baseline, started_item)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user