Add Codex context compaction support (#990)

This commit is contained in:
Mohamed Boudra
2026-05-13 13:52:21 +00:00
committed by GitHub
parent e2ecae0e72
commit c3012ea520
6 changed files with 413 additions and 8 deletions
@@ -0,0 +1,17 @@
export interface CompactionMarkerLabelInput {
status: "loading" | "completed";
trigger?: "auto" | "manual";
preTokens?: number;
}
export function getCompactionMarkerLabel({
status,
trigger,
preTokens,
}: CompactionMarkerLabelInput): string {
if (status === "loading") return "Compacting...";
if (trigger === "auto") return "Context automatically compacted";
if (trigger === "manual") return "Context manually compacted";
if (preTokens) return `Context compacted (${Math.round(preTokens / 1000)}K tokens)`;
return "Context compacted";
}