Remove ghost snapshots (#19481)

## Summary
- Remove `ghost_snapshot` / `GhostCommit` from the Responses API surface
and generated SDK/schema artifacts.
- Keep legacy config loading compatible, but make undo a no-op that
reports the feature is unavailable.
- Clean up core history, compaction, telemetry, rollout, and tests to
stop carrying ghost snapshot items.

## Testing
- Unit tests passed for `codex-protocol`, `codex-core` targeted undo and
compaction flows, `codex-rollout`, and `codex-app-server-protocol`.
- Regenerated config and app-server schemas plus Python SDK artifacts
and verified they match the checked-in outputs.
This commit is contained in:
pakrym-oai authored and GitHub committed 2026-04-27 18:48:57 -07:00
1 parent 7e8594fc19
commit 4e05f3053c
43 files changed
+305 -3254

No files matched your search

+28 -1
View File
@@ -867,7 +867,7 @@ impl RolloutRecorder {
if line.trim().is_empty() {
continue;
}
let v: Value = match serde_json::from_str(line) {
let mut v: Value = match serde_json::from_str(line) {
Ok(v) => v,
Err(e) => {
warn!("failed to parse line as JSON: {line:?}, error: {e}");
@@ -875,6 +875,10 @@ impl RolloutRecorder {
continue;
}
};
if strip_legacy_ghost_snapshot_rollout_line(&mut v) {
trace!("skipping legacy ghost_snapshot rollout line");
continue;
}
// Parse the rollout line structure
match serde_json::from_value::<RolloutLine>(v.clone()) {
@@ -961,6 +965,29 @@ impl RolloutRecorder {
}
}
fn strip_legacy_ghost_snapshot_rollout_line(value: &mut Value) -> bool {
match value.get("type").and_then(Value::as_str) {
Some("response_item") => value
.get("payload")
.is_some_and(is_legacy_ghost_snapshot_response_item),
Some("compacted") => {
if let Some(replacement_history) = value
.get_mut("payload")
.and_then(|payload| payload.get_mut("replacement_history"))
.and_then(Value::as_array_mut)
{
replacement_history.retain(|item| !is_legacy_ghost_snapshot_response_item(item));
}
false
}
_ => false,
}
}
fn is_legacy_ghost_snapshot_response_item(value: &Value) -> bool {
value.get("type").and_then(Value::as_str) == Some("ghost_snapshot")
}
fn truncate_fs_page(
mut page: ThreadsPage,
page_size: usize,