Introduction¶
The plugin-based architecture of DeepSeek Harness (DSH) allows developers to integrate external capabilities into workflows. For developers who need to reuse a ChatGPT Codex subscription (Plus / Pro / Business / Edu), calling it directly from DSH requires solving authentication and context management issues. This plugin connects through the OAuth flow to a ChatGPT subscription and replaces the context compression logic with Codex’s native mechanism, resolving context overflow and compression efficiency issues in multi-turn conversations.
What Is This¶
This is a plugin for DeepSeek Harness (DSH), maintained by thaning0. It exposes the ChatGPT Codex subscription as the DSH model provider codex-oauth, and integrates native compression and image input capabilities.
Core Features¶
- Subscription model access: Registers the OpenAI Codex provider as
codex-oauthand exposes models such asgpt-5.3-codex-spark. - OAuth device-code login: Uses
auth.openai.comfor device-code login, without requiring a local callback server. - Credential security: Refresh / Access Tokens are stored only in the DSH credential store
$DSH_HOME/.credentials.yaml(permissions 0600), and are not included in configuration files, session logs, or the plugin repository. - Login and subscription usage: Supports login and logout, and displays the remaining usage percentage through commands in the settings page and conversations.
- Multi-turn conversations: Fully preserves provider-native replay metadata and supports multi-turn requests across rounds.
- Transient error recovery: Classifies WebSocket, DNS, rate-limit, and service-unavailable errors into DSH’s
TRANSPORT,RATE_LIMIT, orSERVERretry backoff. - Multimodal image input: Supports image input for models that declare image capability.
- Native compression: Provides a manual
/compactcommand and automatic compression triggered at 80% pressure, using an opaque native checkpoint.
Installation¶
Installation must use the file: prefix; otherwise dependency loading will fail.
dsh plugin --profile web add file:/path/to/dsh-llm-codex-auth-native-compact-image
After installation, restart DSH Web to activate the new bundle. Before installation, make sure pnpm is installed (dsh plugin forwards dependencies) or use the provided script for cross-platform installation.
Typical Usage¶
- Login: After restarting dsh, open the Settings page, select “Codex Subscription (ChatGPT)” in the sidebar, and log in. After logging in, you can view the remaining usage percentage for the 5-hour and 7-day windows on the Settings page.
- Create a conversation: When creating a new conversation, select the
Codex Nativeagent preset, and choose a model undercodex-oauthon the Models settings page. - Manual compaction: Enter
/compactin the conversation to manually compact the context. - Status queries: Enter
/codex-statusin the conversation to view login status, enter/codex-usageto view remaining usage, and enter/codex-logoutto log out.
Applicable Scenarios and Notes¶
- Compatibility: The original OAuth plugin and this plugin must not be loaded at the same time, otherwise the same provider will be registered twice.
- Security and compliance: This plugin uses unpublished ChatGPT backend endpoints (
chatgpt.com/backend-api). There is a real risk of violating OpenAI’s terms of service, which may result in account restrictions. Use it only after your own assessment. - Plugin maintenance: The repository does not contain any secrets. Before pushing to GitHub, make sure
.gitignoreis working, and never commit$DSH_HOME/.credentials.yaml. - Limitations: Automatic native compaction only applies to
codex-oauth; other providers will not fall back tocompaction-basic.
Conclusion¶
This plugin provides DSH users with a direct way to call Codex subscriptions and optimizes the context compression process. For developers who need to handle large amounts of context or multimodal capabilities, this is a viable integration solution.