mirror of
https://github.com/openai/codex.git
synced 2026-06-01 19:02:59 +00:00
compact: snapshot reinjection above last summary
This commit is contained in:
@@ -1660,6 +1660,22 @@ keep me updated
|
||||
},
|
||||
];
|
||||
assert_eq!(refreshed, expected);
|
||||
|
||||
let refreshed_value =
|
||||
serde_json::to_value(&refreshed).expect("serialize refreshed history");
|
||||
let Value::Array(refreshed_items) = refreshed_value else {
|
||||
panic!("expected refreshed history to serialize as array");
|
||||
};
|
||||
|
||||
assert_snapshot!(
|
||||
"process_compacted_history_reinject_above_last_summary_shapes",
|
||||
context_snapshot::format_labeled_items_snapshot(
|
||||
"When compaction output has multiple summary-only user messages and no real user message, canonical context is reinserted above the last summary.",
|
||||
&[("Refreshed History Layout", refreshed_items.as_slice())],
|
||||
&ContextSnapshotOptions::default()
|
||||
.render_mode(ContextSnapshotRenderMode::KindWithTextPrefix { max_chars: 64 }),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
source: core/src/compact.rs
|
||||
expression: "context_snapshot::format_labeled_items_snapshot(\"When compaction output has multiple summary-only user messages and no real user message, canonical context is reinserted above the last summary.\",\n&[(\"Refreshed History Layout\", refreshed_items.as_slice())],\n&ContextSnapshotOptions::default().render_mode(ContextSnapshotRenderMode::KindWithTextPrefix\n{ max_chars: 64 }),)"
|
||||
---
|
||||
Scenario: When compaction output has multiple summary-only user messages and no real user message, canonical context is reinserted above the last summary.
|
||||
|
||||
## Refreshed History Layout
|
||||
00:message/user:<COMPACTION_SUMMARY>\nolder summary
|
||||
01:message/developer:fresh permissions
|
||||
02:message/user:<COMPACTION_SUMMARY>\nlatest summary
|
||||
Reference in New Issue
Block a user