Codex Native Compaction OpenCode V2 plugin · Experimental GitHub ↗

Native checkpoints for OpenCode

@josevelaz/opencode-codex-native-compaction replaces OpenCode’s text compaction request with OpenAI Codex remote_compaction_v2. Later turns replay the provider’s opaque checkpoint instead of relying only on a text summary.

The plugin applies to OpenAI ChatGPT/Codex subscription requests. Other routes keep OpenCode’s normal compaction behavior unless the session already contains a native checkpoint.

Experimental compatibility: the recorded tested OpenCode build is v0.0.0-beta-18286. Dependencies pin that API. Newer V2 builds are not verified. The plugin uses a Codex subscription backend feature, not the public OpenAI API compaction endpoint.

Start here

Before using a long-running session

Keep the model and variant that created the checkpoint available. Another provider cannot interpret it. Keep the plugin’s stored checkpoint data too: the transcript contains only its ID, not a portable summary.

The plugin does not add its own compaction schedule. OpenCode controls the automatic threshold and recent history kept in the conversation.

For maintainers

Source code and issue tracking are on GitHub. The project uses the MIT license.