dsh-llm-codex-auth-native-compact-image
在终端中运行以下命令:
dsh plugin install thaning0/dsh-llm-codex-auth-native-compact-image
将以下提示词粘贴到 DeepSeek Harness 对话框中:
在 DeepSeek Harness 中执行 dsh plugin install thaning0/dsh-llm-codex-auth-native-compact-image 即可安装,完整源码地址见 https://github.com/thaning0/dsh-llm-codex-auth-native-compact-image 。
插件介绍
Many teams have already built their workflows in DeepSeek Harness but still want to tap into the model quota included in a ChatGPT or Codex subscription. dsh-llm-codex-auth-native-compact-image closes that gap: it signs you in to your ChatGPT account (Plus / Pro / Business / Edu) through OpenAI's official OAuth device-code flow, registers the subscription models as a codex-oauth provider inside dsh, and requires no API key management or local callback server. Credentials are stored exclusively in the dsh credential store, kept out of config files, session logs, and the repository, while the refresh token is renewed automatically within pi-ai's serialized write path.
Compaction is where the plugin really shines. It integrates provider-native compaction so that every /compact invocation, the 80 percent context-pressure auto-trigger, and context-overflow recovery all produce a versioned opaque checkpoint instead of a naive text summary. Checkpoints record attachment references but not image base64 payloads; after a restart the Codex adapter replays them verbatim. Cross-provider, cross-model, and cross-account identity mismatches fail fast before any network call, never silently falling back to basic compaction. The same npm package exposes separate auth/transport and agent-scoped compaction entry points, so callers never see credential material.
The plugin also handles multimodal image input for Codex models that declare image capability, converting PNG, JPEG, WebP, and GIF attachments into per-request base64 data URLs. Transient failures such as WebSocket disconnects, DNS errors, rate limits, and early stream closures are classified into TRANSPORT, RATE_LIMIT, or SERVER back-off retries while preserving the provider request ID for easier debugging. The settings panel surfaces remaining usage percentages across the 5-hour and 7-day windows with reset times and a manual refresh button, and in-chat commands like /codex-status, /codex-usage, and /codex-logout keep everything within reach.
This plugin is a good fit for developers who want to reuse an existing ChatGPT or Codex subscription inside dsh, value the quality and safety of native compaction over basic summarization, and deploy in headless environments where browser callbacks are unavailable. One caveat: the plugin calls the ChatGPT web-backend API, an endpoint that OpenAI does not officially support. Using it carries a real risk of Terms-of-Service violation or account restriction, so assess that risk before enabling it in production.
使用场景
- 复用已有 ChatGPT 或 Codex 订阅额度,在 dsh 中直接调用 Codex 系列模型进行推理。
- 使用 provider 原生 opaque checkpoint 替代文本摘要,在 /compact、80% 压力触发和 overflow 恢复中保持压缩质量。
- 在无浏览器的 headless 或 CI 环境中,通过 OAuth 设备码登录并持续调用 Codex 订阅模型。
适合人员
- 已持有 ChatGPT Plus、Pro、Business 或 Edu 订阅,希望在 dsh 工作流中复用的开发者。
- 重视上下文压缩质量与凭据安全隔离,不愿接受朴素文本摘要回退行为的团队。
- 需要在无浏览器回调的服务器或 CI 管线上调用 Codex 模型的工程师与平台团队。