pi-codex-compaction 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ This project follows the spirit of [Keep a Changelog](https://keepachangelog.com
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.4] - 2026-09-15
10
+
11
+ ### Added
12
+
13
+ - Show `[compaction (codex)] Checkpoint saved.` in the TUI after a Codex checkpoint is saved, to distinguish it from standard Pi compaction.
14
+
9
15
  ## [0.1.3] - 2026-09-11
10
16
 
11
17
  ### Fixed
package/README.md CHANGED
@@ -35,6 +35,12 @@ pi -e /path/to/pi-mono/packages/pi-codex-compaction
35
35
 
36
36
  ## Behavior
37
37
 
38
+ After a Codex checkpoint is saved, the TUI shows
39
+ `[compaction (codex)] Checkpoint saved.` Pi's built-in `[compaction]` heading
40
+ remains unchanged. The notice is not added to model context or stored in the
41
+ session, and is not replayed on reload. Standard Pi compaction does not show it.
42
+ Print, JSON, and RPC modes receive no extra notification.
43
+
38
44
  When Pi starts compaction on a supported Codex model, the extension sends a streamed Responses request whose `input` contains only discardable history, any compatible prior checkpoint, and a `compaction_trigger` item. The normal request envelope is retained because Codex's compaction path is parity-tested against ordinary Responses requests; this includes the effective system prompt, active tool definitions, reasoning level, prompt-cache fields, and routing fields. The request uses the `remote_compaction_v2` beta feature, and the returned opaque checkpoint and bounded provider usage are stored in the Pi compaction entry. Later requests rehydrate the raw checkpoint only when the model, endpoint, account, and authentication mode match; other providers/models receive the bounded textual fallback instead.
39
45
 
40
46
  Compaction uses the model active when Pi triggers it. If a session switches from a larger to a smaller model, the remote request is bounded against the new model's context window and tool outputs are reduced before sending. A previous opaque checkpoint is treated as incompatible after a model, endpoint, account, or authentication-mode switch; Pi's readable previous summary is sent instead. If the full request still cannot fit, the extension leaves compaction to Pi's normal implementation.
@@ -113,6 +119,9 @@ API. Async tools and mid-turn steering require upstream Pi support.
113
119
 
114
120
  For a small live test, load this package and select `openai-codex/gpt-6-astra`.
115
121
  Send two short messages, run `/compact`, then ask about the first message.
122
+ Confirm `[compaction (codex)] Checkpoint saved.` appears. Then run
123
+ `/compact Focus on recent work` and confirm the standard-compaction warning
124
+ appears without a Codex success notice.
116
125
  Repeat with `/fast on` and `pi-codex-tools` loaded. Check that compaction succeeds,
117
126
  the continuation retains context, and session usage includes compaction tokens.
118
127
  Use only a temporary file if you test `apply_patch`. Do not generate images.
@@ -84,6 +84,16 @@ export default function piCodexCompaction(pi: ExtensionAPI): void {
84
84
  };
85
85
  pi.on("session_before_compact", onBeforeCompact);
86
86
 
87
+ pi.on("session_compact", (event, ctx) => {
88
+ if (ctx.mode !== "tui" || !ctx.hasUI || !event.fromExtension) return;
89
+ if (!findActiveRemoteCompaction([event.compactionEntry])) return;
90
+ try {
91
+ ctx.ui.notify("[compaction (codex)] Checkpoint saved.", "info");
92
+ } catch {
93
+ // Display failures must not affect a saved checkpoint or continuation.
94
+ }
95
+ });
96
+
87
97
  pi.on("before_provider_headers", (event, ctx) => {
88
98
  if (!supportsRemoteCompaction(ctx.model)) return;
89
99
  const existing = event.headers["x-codex-beta-features"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-codex-compaction",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Use OpenAI Codex RemoteCompactionV2 for supported Pi sessions.",
5
5
  "type": "module",
6
6
  "license": "MIT",