Login to Codex Using ChatGPT Subscription in DeepSeek Harness

Preface

DeepSeek Harness already contains most of the backend flows required by Codex, including the OAuth flow, token refresh, credential storage, and the transport layer with chatgpt.com/backend-api. What’s missing is an entry point to initiate login — the openai-codex flow is registered, but nothing calls it. dsh-codex-oauth is that one line of invocation. It doesn’t implement OAuth, doesn’t store tokens, and doesn’t handle refresh. The plugin is responsible for initiating login, relaying authorization prompts, and displaying masked status in cards; OAuth, credential storage, and refresh are still handled by Harness and pi-ai.

Core Features

  • Initiate login
  • Relay authorization prompts
  • Display masked status

Installation and Activation

Before installation, declare keyless routing in the configuration.

  1. Add the following to ~/.dsh/profiles/<profile>/cordis.patch.yml:
    - id: llm-pi-ai
      name: "@deepseek-ai/dsh-llm-pi-ai"
      config:
        providers:
          openai-codex: {}
The value must be empty. Only an empty value preserves the provider's own authentication method.
  1. Install the plugin.
    • Desktop profiles must use the in-app plugin manager.
    • Other cases (e.g., web profile) use the CLI:
    dsh plugin --profile web add github:callqh/dsh-codex-oauth
  1. Restart the profile. The bundle list is assembled at startup, so it won’t be loaded without a restart.

Usage

Open Settings → Codex Login.

Click the button and choose a login method: Browser Login (default, the authorization page opens in a new tab, and the callback lands on 127.0.0.1:1455) or Device Code (used when the browser is not on this machine).

After login, the card will display the masked account, plan level, and token validity period, and will switch over without requiring a page refresh. Clicking log out deletes the credentials.

Security and Architecture

  • Tokens only remain on the host side.
  • Credentials are stored only once — in the harness credential store under the llm-pi-ai/openai-codex record, written by pi-ai in its own format.
  • The browser side only receives the masked account, plan level, and validity period.

Notes

  • Ensure that the openai-codex route is configured as keyless; otherwise, authentication will fail.
  • Desktop profiles must be installed through the in-app plugin manager; the CLI does not support managing desktop profiles.
  • The profile must be restarted after installation to take effect.

Conclusion

By filling the gap in Harness’s Codex login entry point, this plugin enables developers to use Codex models in the DSH environment with their existing ChatGPT Plus / Pro subscriptions.

Plugin Directory | GitHub Repository

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye