DeepSeek Harness 插件

dsh-codex-oauth-biratcha

DeepSeek Harness plugin: use your OpenAI Codex (ChatGPT Plus/Pro) subscription through OAuth.(英文原文)

跳到安装方式

来源信息

GitHub 仓库
birat-chapagain/dsh-codex-oauth
最近更新
2026年8月20日
分类
工具与能力
GitHub stars
0
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/birat-chapagain/dsh-codex-oauth
插件名:dsh-codex-oauth-biratcha
作者:birat-chapagain

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-codex-oauth

Use your OpenAI Codex subscription (ChatGPT Plus/Pro) inside DeepSeek Harness — via OAuth, the same way the official Codex CLI and other harnesses do.

The upstream harness's multi-provider adapter deliberately withholds openai-codex because Codex authenticates through ChatGPT OAuth, and that adapter holds no credential store and runs no login flow. This community plugin supplies both pieces as an installable bundle: a file-backed OAuth credential store, a /codex login human command, and a codex provider route registered on the public LLM seam.

  • Built on the published seam packages (@deepseek-ai/dsh-llm, @deepseek-ai/cordis) — no fork, no core change.
  • pi-ai's provider-owned Codex OAuth flows handle the wire protocol: browser login with a local callback server, headless device-code login, and automatic refresh under a cross-process credential-store lock.
  • Tokens live in $DSH_HOME/codex-oauth.json (0600, owner-only directory), the same place the CLI bin and the harness plugin both read.

Requirements

  • A ChatGPT Plus or Pro subscription. (A plain OpenAI platform API key does not work — subscription access is bound to your ChatGPT account, not an API key.)
  • DeepSeek Harness installed (npx @deepseek-ai/dsh web or a source checkout).

Install

One command installs the bundle into the web profile (it writes the one-time pnpm build approvals and runs dsh plugin add for you):

npx --yes https://github.com/birat-chapagain/dsh-codex-oauth/releases/download/v0.1.5/dsh-codex-oauth.tgz install

Then restart dsh web and run /codex login once.

Manual alternatives (same effect, both use prebuilt artifacts with no build permission):

dsh plugin --profile web add https://github.com/birat-chapagain/dsh-codex-oauth/releases/download/v0.1.5/dsh-codex-oauth.tgz
# or, from git (pin a commit for reproducibility: github:…/…#<sha>):
dsh plugin --profile web add github:birat-chapagain/dsh-codex-oauth

pnpm 11.22+ hard-fails when any transitive dependency has an unapproved build script — pi-ai's tree carries two (@google/genai, protobufjs, both unused by the Codex route). The one-command installer writes the approvals for you (and repairs a snippet pasted from pnpm's suggestion with its set this to true or false placeholders); a manual install that ends with ERR_PNPM_IGNORED_BUILDS just needs this one-time snippet in the profile's pnpm-workspace.yaml:

allowBuilds:
  '@google/genai': true
  protobufjs: true

(If pnpm prints different exact keys in its error, use those — the printed keys are authoritative.)

The profile manifest ends up listing the bundle after @deepseek-ai/dsh-base; verify the composed tree without booting:

dsh --profile web --dump-config

Log in

Logging in is a human command, not a model tool — it never enters a prompt.

Web UI

Type /codex login in the chat input. A browser window opens on the ChatGPT authorization page; complete it, and the command reports when the token is stored. Use /codex logout and /codex status to manage it.

Headless / CLI

The bundle also ships a dsh-codex-oauth bin that runs outside the harness (the headless profile has no command plane):

npx dsh-codex-oauth login                 # browser flow (desktop)
npx dsh-codex-oauth login --method device # device-code flow (headless)
npx dsh-codex-oauth status
npx dsh-codex-oauth logout

Device flow prints a one-time code plus the OpenAI device-verification URL; enter the code on any device, and the CLI waits until you authorize and stores the token in the same file the harness reads.

Use Codex

The plugin registers provider route codex with the Codex catalog models (gpt-5.x-codex and friends, from the installed pi-ai catalog). Select codex / a Codex model in the Web model picker, or set the default for a headless profile in the profile's cordis.patch.yml:

- id: agent-default-model
  config:
    provider: codex
    model: gpt-5.4

Per-session selection in the Web UI needs no patch. Provider, model, and capabilities resolve through the same LLM seam as shipped providers; prompts, tools, persistence, and history replay behave identically.

Configuration

FieldDefaultMeaning
providercodexProvider route id the adapter registers.
storePath$DSH_HOME/codex-oauth.jsonOAuth credential store location.
transportsseCodex Responses transport: sse, websocket, websocket-cached, or auto. sse exits cleanly after one-shot headless turns; websocket/websocket-cached reuse the connection for long interactive sessions but keep one-shot processes alive.
cacheRetentionlongpi-ai prompt-cache retention: none, short, long.

Override in a later patch layer (profile cordis.patch.yml replaces this row's whole config):

- id: codex-oauth
  config:
    provider: codex
    transport: sse

Security notes

  • The store document is written atomically with 0600 permissions under a 0700 directory, and a group/world-readable document is refused on POSIX. It holds your ChatGPT OAuth tokens — treat it like an API key.
  • The harness process and its tool subprocesses run as your user; like the upstream credentials document, this file is not hidden from tools the model can drive. Do not point the model's workspace at your Harness home.
  • Only https URLs issued by the login flow are ever handed to the browser opener.
  • The login flow is pi-ai's provider-owned implementation (authorization-code + device-code against chatgpt.com); this plugin answers its interaction prompts and stores the result.

How it works

  • src/store.tsFileCredentialStore, a persistent pi-ai CredentialStore with serialized read-modify-write (dsh-atomic-write).
  • src/auth.ts — login/status/logout over pi-ai's openai-codex OAuth provider.
  • src/adapter.tsCodexAdapter extends LlmAdapter (from @deepseek-ai/dsh-llm), registered with ctx.llm.registerAdapter(['codex'], …); stream() resolves/refreshes auth via pi-ai automatically.
  • src/convert.ts — request/stream vocabulary conversion, adapted from @deepseek-ai/dsh-llm-pi-ai (MIT, © DeepSeek AI) with image attachment support and provider-native replay state omitted.
  • src/index.ts — the Cordis function plugin (name/inject/Config/apply); registers the adapter and, when the composition mounts ctx.commands, the /codex command.

Limitations

  • Text only. Image content is refused with UNSUPPORTED_CONTENT before any provider request.
  • No browser Models-page card. Configuration happens through the patch layer and the picker lists the route through the adapter registry; login is the bin or /codex command, not the credentials page.
  • No provider-native replay state. Historical assistant messages replay as provider-neutral content (correct, but without signature/cache reuse).
  • Browser login assumes a desktop browser. Machines without one use --method device or /codex login device.
  • One login at a time. The callback server and store lock serialize concurrent logins; wait for one to finish.

Development

npm install
npm test        # builds lib/ then runs vitest (unit + Loader composition + built-bin smokes)

The composition test boots the real dsh-llm service and this plugin through the Cordis Loader with only the pi-ai SDK mocked, and the bin tests exercise the built artifact under plain Node.

License

MIT. The conversion modules in src/convert.ts are adapted from @deepseek-ai/dsh-llm-pi-ai (MIT, © DeepSeek AI).