Preface¶
DeepSeek Harness (DSH) adopts an “everything is a plugin” architecture, with stable core logic and plugin-based capability extensions. When handling Codex-like sessions, increasing session length can lead to context bloat. While retaining the official Basic Compaction engine as the main controller, the dsh-codex-compaction plugin provides an optional account-level native summarization interface for Codex sessions and fixes some historical compatibility issues.
Plugin Overview¶
dsh-codex-compaction is a model inference plugin for DeepSeek Harness, maintained by the user shaomingbo. It provides supplementary features to the official Basic Compaction engine, including an optional native summarization interface, image replay fixes, and legacy structured reader support. The plugin does not modify DSH core code and does not require repeated account logins.
Core Features¶
The plugin mainly provides the following capabilities:
-
Standard sessions remain standard
New and existing regularopenai-codexsessions retain the official automatic compaction mechanisms (triggering, pressure, overflow recovery, retention, metering, shrink checks, and commit/refresh). The default path remains unchanged until you explicitly enable other features. -
Per-session native compaction (disabled by default)
Each session can independently enable or disable native compaction.- In a running session, enter
/codex-native onto enable native compaction. - Enter
/codex-native offto stop creating new native sessions (existing native state can be read through the corresponding reader). - Enter
inheritto restore the session to the configuration file default (the default is disabled in the current version).
- In a running session, enter
-
Image replay fixes
Version 0.3.3 fixes image replay issues in user and tool results, and supports rendering through the host’s persistent attachment service and public Pi conversion. -
Legacy compatibility
Supports the traditionalcodex-native-labpath and archived B presets. Provides dedicated compatibility support for legacy sessions. -
Custom model support
Supports resolving custom models such asgpt-6-astrathrough the account metadata interface. -
Clear boundaries
- Native checkpoints replay only the compacted summary, not the original conversation. Semantic recall is lossy, and compacted details are not necessarily retained.
- Each owner lease allows at most one additional recovery request (native retry or transparent text fallback), without stacking or renewal.
- Native carrier history does not fall back to text mode.
Installation and Enablement¶
Before installation, ensure that one of the following DSH CLI versions is available in your PATH: 0.1.2-alpha.3, 0.1.2-rc.1, 0.1.5-rc.1, or 0.1.5-rc.2.
Use the following command to install the plugin:
npx --yes --ignore-scripts github:shaomingbo/dsh-codex-compaction#v0.4.3
After installation, enable native compaction in the session with the following command:
/codex-native on
Typical Usage¶
- Enable/stop: In the session, enter
/codex-native onto enable it and/codex-native offto stop it. - Observe logical replacement: Enter
/codex-contextto view the observation results for logical replacement. - Legacy path setup: In scenarios that require compatibility with the legacy structured reader, use
/codex-compact-setup.
Use Cases and Cautions¶
- Version requirement: The plugin depends on specific DSH CLI versions. Check
dsh --versionbefore installation. - Restart required: After modifying a Bundle, restart the corresponding configuration file; the Web GUI requires a hard refresh for changes to take effect.
- Recall limitation: The plugin does not guarantee lossless semantic recall. Keep critical state, decisions, and code references in project files, and reread them when needed.
- Non-registry dependency: The plugin does not depend on a registry; instead, it pre-checks the
codex-runtime/v1protocol and the authenticated owner at runtime.
Conclusion¶
dsh-codex-compaction provides a non-invasive, optional native summarization capability for DeepSeek Harness Codex sessions. It is suitable for scenarios that need to preserve the standard compaction mechanism while using the native interface to handle specific long sessions or image history. See its GitHub repository for more technical details and source code.