dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
本机已登录的 Codex(ChatGPT Plus/Pro)订阅接入 DSH。用途:①在侧边栏展示 5 小时窗口与一周窗口的剩余额度、重置时间与剩余重置券数量,并支持一键消耗一张重置券重置额度;②读取额度时自动把订阅线路注册进 llm-pi-ai(openai-codex 路由),使 Codex 模型出现在模型选择器中;③access token 到期前自动续期并原子写回,无需手动更换密钥;④提供 codex 工具把任务委派给本机 Codex agent。无需填写任何 API key。
用途:把你本机已经登录的 Codex(ChatGPT Plus/Pro)订阅接入 DeepSeek Harness。 它显示 5 小时窗口与一周窗口的剩余额度、重置时间与剩余重置券数量,支持选择并消耗指定重置券来重置额度; 读取额度时自动把订阅线路注册进 DSH,使 Codex 模型出现在模型选择器中;并在 access token 到期前 自动续期。无需填写任何 API key,使用的是你本机 Codex 登录已有的凭证。
平台支持:Linux 与 Windows。 Windows 会从 PATH、OpenAI Codex 官方安装目录和 npm 命令垫片中定位 CLI。
中文更新记录:CHANGELOG.zh.md
English: use your Codex (ChatGPT Plus/Pro) subscription inside DeepSeek Harness
Codex 胶囊与面板显示两个窗口的剩余额度与重置券;openai-codex 路由,模型出现在模型选择器;中文详解(功能明细、面板路由、安装与配置、安全边界)见 README.zh.md。
Use your Codex (ChatGPT Plus/Pro) subscription inside DeepSeek Harness.
It reads the quota of the Codex account you are already signed in to on this machine, shows it in the UI, exposes the subscription's models to DSH's model picker, and can spend a specifically selected rate-limit reset credit.
Quota panel
Codex chip in the sidebar footer: remaining 5-hour window, remaining weekly window,
and how many reset credits are left (collapses to the percentage when the sidebar is in rail mode).reset / nothingToReset / noCredit / alreadyRedeemed). This consumes a real credit
and cannot be undone.Model routing
Reading the quota also registers the subscription route in the llm-pi-ai settings namespace,
so the Codex models appear in DSH's model picker:
llm-pi-ai:
providers:
openai-codex:
apiKeyEnv: OPENAI_CODEX_API_KEY
displayName: Codex (ChatGPT Plus/Pro)
baseURL: https://chatgpt.com/backend-api
Only that provider entry is replaced through settingsController.mutate(). No fixed settings-file path is assumed, and every other provider remains untouched. The profile declares the complete eight-model catalog, including gpt-6-luna and gpt-6-sol.
Token upkeep
The access token is refreshed against auth.openai.com when it has less than 24 hours left,
and the rotated access_token / refresh_token / id_token triple is written back to
auth.json atomically; POSIX systems additionally enforce mode 0600, while Windows keeps the profile ACL. The current access token is stored in DSH's
credential store under the reference name above, so settings.yaml never holds a secret.
Panel transport
The browser half talks to the host half over this plugin's own same-origin routes —
GET /codex-plus/status, POST /codex-plus/sync, POST /codex-plus/reset (JSON body: { "creditId": "…" }) — which the DSH web
server already protects with its browser-session policy. No new RPC channel and no token in the
page are involved.
Delegation tool
codex hands a self-contained task to the local Codex agent and returns its final answer —
useful for a second opinion, a fresh-context review, or an independent subtask.
| Tool | Purpose |
|---|---|
codex | Run a task through codex exec and return the answer |
codex_quota | Read the quota and re-sync the provider route |
codex_models_sync | Refresh the token and re-register the models now |
codexprobe | Diagnostics: resolved CLI, Codex home, cached catalog, quota read |
codex login); its login lives in <codexHome>/auth.json.DSH_CODEX_BIN, the established Linux locations, PATH,
then Windows fallbacks under %LOCALAPPDATA%\OpenAI\Codex\bin\<hash>\codex.exe
and %APPDATA%\npm\codex.cmd|exe. A real .exe is preferred over command shims.DSH_CODEX_HOME, else ~/.codex on both platforms.dsh plugin --profile web add dsh-codex-plus
Then restart the profile and refresh the page. Switch the conversation's model to Codex (ChatGPT Plus/Pro) to use the subscription for that session.
All keys are optional.
- id: codex-plus
name: 'dsh-codex-plus'
config:
codexBin: /usr/local/bin/codex # explicit CLI path
codexHome: ~/.codex # explicit CODEX_HOME
workspace: /path/to/workspace # shell sandbox root (default: process cwd)
providerRoute: openai-codex # pi-ai catalog route to configure
providerDisplayName: Codex (ChatGPT Plus/Pro)
credentialRef: OPENAI_CODEX_API_KEY # credential-store reference name
syncProviders: true # set false to skip the settings write entirely
sandboxPolicy: true # false disables the workspace-write policy
Set syncProviders: false if you only want the quota panel and would rather wire the
provider yourself.
auth.json.settings.yaml only carries the
reference name OPENAI_CODEX_API_KEY.auth.json is only ever written with the refreshed triple, atomically, at mode 0600.codex exec runs with the sandbox you pass to the codex tool (read-only by default).
Note that running Codex inside a sandbox that already blocks user namespaces can make
Codex's own workspace-write sandbox fail; danger-full-access then defers to DSH's own
sandbox, which is the safer pairing.MIT