
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
pi-codex-compaction
Advanced tools
Keep long Pi sessions usable on OpenAI Codex models by replacing Pi's local summary request with Codex's provider-side RemoteCompactionV2 checkpoint when the current model supports the Codex Responses API.
openai-codex model for each compaction; it never silently changes the session model.The current Codex catalog includes gpt-6-astra, gpt-5.6-sol, gpt-5.6-terra, and gpt-5.6-luna. Capability detection follows the provider/API contract (openai-codex + openai-codex-responses) rather than a brittle model-name list. Use Pi 0.85.1 or later.
pi install npm:pi-codex-compaction
For local development:
pi install /path/to/pi-mono/packages/pi-codex-compaction
Or load it for one run:
pi -e /path/to/pi-mono/packages/pi-codex-compaction
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.
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.
If the remote request fails, is cancelled, or returns an unexpected response, Pi's standard compaction path runs. Custom compaction instructions also use Pi's standard path because RemoteCompactionV2 has no documented custom-instructions field. The direct checkpoint request is restricted to https://chatgpt.com, rejects redirects, limits request/response size, and never decodes or logs encrypted_content. No configuration is required.
With pi-fast installed, direct compaction requests use the current Fast toggle.
With pi-codex-tools installed, apply_patch keeps its raw grammar definition,
custom-tool calls, and custom-tool results during compaction. Neither package is
required. No package reads a private Pi tool registry.
With pi-openai-reasoning installed, verified Astra requests keep the original
request effort and receive the current effort as a configuration update.
Failed compaction does not change saved reasoning state.
Pi 0.85.1 does not expose grammar metadata in getAllTools(). Two synchronous,
versioned pi.events contracts let cooperating extensions supply it:
pi-codex-compaction:tools:v1: { model, tools }, before provider serialization.
A tool owner can attach its own constrainedSampling metadata.pi-codex-compaction:request:v1: { ctx, messages, payload }, after input
assembly and before size checks. A listener can replace payload. This event
is not the general before_provider_request chain and does not carry auth.Other extensions' private request changes are not applied automatically.
Unknown third-party grammar metadata needs cooperation through the tools event.
The checkpoint entry includes standard Pi usage, including cache reads and
cache writes, as well as the original bounded token counters in details.
Costs follow Pi's catalog estimates. They are not a ChatGPT subscription bill.
Behavior was checked against openai/codex commit
654b0a77d0d2f81aa21f61caf7af4be88fe550bb (2026-09-11), notably
core/src/compact_remote_v2{,_attempt}.rs. No Codex code was copied.
RemoteCompactionV2 is a changing Codex protocol, not the public /responses/compact
API. Async tools and mid-turn steering require upstream Pi support.
For a small live test, load this package and select openai-codex/gpt-6-astra.
Send two short messages, run /compact, then ask about the first message.
Repeat with /fast on and pi-codex-tools loaded. Check that compaction succeeds,
the continuation retains context, and session usage includes compaction tokens.
Use only a temporary file if you test apply_patch. Do not generate images.
npm install
npm run -w packages/pi-codex-compaction check
npm test -w packages/pi-codex-compaction
npm run -w packages/pi-codex-compaction pack:dry-run
FAQs
Keep Pi sessions flowing with automatic server-side compaction on public OpenAI Responses.
The npm package pi-codex-compaction receives a total of 0 weekly downloads. As such, pi-codex-compaction popularity was classified as not popular.
We found that pi-codex-compaction demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.