Introduction¶
When running agents in DSH, model routing typically requires configuring a separate API key or building your own gateway. If you are already logged into the OpenAI Codex CLI with a ChatGPT Plus/Pro subscription on your local machine, your subscription quota and model catalog are actually stored in local credentials. However, the Harness interface does not display the remaining quota for the 5-hour/weekly windows by default, nor does it automatically write the openai-codex route into the model selector. Manually copying tokens or modifying settings.yaml is prone to token expiration and fails to distinguish between “just viewing quota” and “actually using the subscription model for conversation.”
The following section introduces the community plugin dsh-codex-plus (maintained by mia-wong1016), which reads the local Codex login state, displays quota and reset credits on the Web side, and registers subscription models when reading quota. When the access token is about to expire, it writes back to auth.json and syncs to the DSH credential store. No API key entry is required.
What is This¶
dsh-codex-plus belongs to the “Model Inference” category in the DSH community directory. Repository: github.com/mia-wong1016/dsh-codex-plus. Its purpose is to connect your locally logged-in Codex (ChatGPT Plus/Pro) subscription to the DeepSeek Harness, manage quota via a sidebar panel, route through the subscription line via the model selector, and use optional tools to delegate tasks to the local codex exec.
Platform support: Linux and Windows. Dependencies: Node 20+; it does not introduce Python or additional npm dependencies. License: MIT (see the repository README).
Core Functions¶
Quota Panel¶
There is a Codex capsule in the sidebar footer: it displays the remaining quota for the 5-hour window and the weekly window, as well as the number of remaining reset credits. When the sidebar is collapsed to rail mode, it displays as a percentage summary. Clicking it opens a panel where you can view the usage ratio and reset time for both windows, as well as each reset credit and its expiration date.
Resetting uses specified reset credits: the panel lists available credits via single selection, and the button only consumes the selected credit to reset both the 5-hour and weekly windows. The button is disabled if no credits are available; results are explicitly reported (e.g., reset, nothingToReset, noCredit, alreadyRedeemed). This operation consumes a real reset credit and is irreversible, requiring explicit confirmation.
The panel communicates with the host via the plugin’s same-origin routes: GET /codex-plus/status, POST /codex-plus/sync, POST /codex-plus/reset (JSON body { "creditId": "…" }), protected by the DSH Web service’s existing browser session policy; tokens are not exposed on the page.
Model Routing¶
When reading quota, the plugin registers the subscription route in the llm-pi-ai namespace, causing Codex models to appear in the DSH model selector. Write example (only replaces that provider entry; other providers remain unchanged):
llm-pi-ai:
providers:
openai-codex:
apiKeyEnv: OPENAI_CODEX_API_KEY
displayName: Codex (ChatGPT Plus/Pro)
baseURL: https://chatgpt.com/backend-api
The profile declares a complete eight-model catalog (including gpt-6-luna, gpt-6-sol, etc. listed in the README). Actual tokens are stored in the DSH credential store; settings.yaml only retains reference names and does not contain plaintext keys.
Credential Renewal¶
When the access token has less than 24 hours remaining, it refreshes with auth.openai.com and atomically writes back the new access_token / refresh_token / id_token triple to <codexHome>/auth.json. On POSIX, the file mode is 0600; on Windows, the profile ACL is preserved.
Agent Tools¶
In addition to the UI, the plugin exposes several tools to DSH to facilitate syncing quota or delegating subtasks during conversation:
| Tool | Function |
|---|---|
codex |
Execute self-contained tasks via codex exec and return the final answer |
codex_quota |
Read quota and re-sync provider routes |
codex_models_sync |
Refresh token and immediately re-register models |
codexprobe |
Diagnostics: resolved CLI, Codex home, cached catalog, quota reading |
codex runs in a read-only sandbox by default; if the outer sandbox has already blocked user namespaces, it may cause Codex’s built-in workspace-write to fail. The README suggests weighing the pros and cons yourself when pairing with DSH sandbox policies like danger-full-access.
Installation and Activation¶
Prerequisites: Codex CLI is installed locally and codex login has been completed. Login information is located at <codexHome>/auth.json (default ~/.codex, overridable via the environment variable DSH_CODEX_HOME). The CLI lookup order is DSH_CODEX_BIN, common Linux paths, PATH, as well as %LOCALAPPDATA%\OpenAI\Codex\bin\<hash>\codex.exe and npm shims on Windows.
The official installation command is:
dsh plugin --profile web add dsh-codex-plus
After installation, restart the profile and refresh the page. Switch the model to Codex (ChatGPT Plus/Pro) in the session to run the current conversation using that subscription.
Optional Configuration¶
Configuration items are all optional and written under the plugin’s config:
- 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 directory (defaults to 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 to false to completely stop writing to settings
sandboxPolicy: true # false disables workspace-write policy
If you only want the quota panel and intend to wire up the provider yourself, set syncProviders: false.
Typical Usage¶
- After completing
codex loginlocally, install the plugin using the command above and restart the Web profile. - Open DSH Web and check if the sidebar Codex capsule shows the quota for both windows and the number of reset credits; click sync or call the tools
codex_quota/codex_models_syncif necessary. - Create or switch a session, select Codex (ChatGPT Plus/Pro) as the model, and converse with Harness normally.
- When the quota is reached and the account has reset credits, select a credit via single-click in the panel and confirm to execute a reset (consumes one credit, resets both windows).
- When a second opinion or independent subtask is needed, use
codexin a flow that supports tool calling to hand the task over to the local Codex agent.
Use Cases and Notes¶
Who it is for: Developers who already maintain a ChatGPT Plus/Pro login via Codex CLI on Linux/Windows and wish to see subscription quota, reset with one-click credit selection, and use the subscription model catalog without an API key within DSH Web.
Security and Permissions: The plugin reads the auth.json written by your own login; it does not package or log credentials. Resets and token write-backs have boundary explanations (see the Security section in the repository). The panel routes are visible to callers holding a valid DSH Web session, revealing quota, plan type, and account email, but do not return tokens.
Please be aware before installing: DSH plugins run with the permissions of the current dsh process. Before connecting, it is recommended to read the repository source code and the MIT license to ensure consistency with your local Codex data directory and credential storage policy. The community plugin directory skillhub.cn is an independent site and has no official affiliation with DeepSeek / High-Flyer.
Conclusion¶
dsh-codex-plus transforms a “local Codex subscription” into an observable, routable, and renewable line within the Harness: quota and reset credits are operable in the UI, the model selector automatically mounts openai-codex, and token maintenance relies on the credential store and atomic write-backs to auth.json. For more details, see the repository README.zh.md.