@opentritium/dsh-codex-shim: Route-Aware Codex Environment Simulation for DSH

Preface

One of the core philosophies of DSH is “everything is a plugin,” allowing the tools and presentation of a profile to be extended via plugins. The @opentritium/dsh-codex-shim described below addresses tool-calling issues for GPT-family and other Codex-adapted models in DeepSeek Harness: it simulates Codex-style prompts, tool vocabulary, tool results, and WebUI presentation for selected model routes, enabling such models to use tools more reliably within DSH.

What This Is

@opentritium/dsh-codex-shim is maintained by OpenTritium and licensed under MIT. Its positioning is as a Route-aware Codex environment simulation for DeepSeek Harness.

It is a shim, not a Codex runtime: it does not start a Codex app-server, does not handle Codex OAuth, does not provide models or credentials, does not execute commands itself, and does not provide a web-search backend. It only consumes existing DSH capabilities through public service definitions, consumers, and UI slots; when the model does not match or the bundle is removed, DSH continues to use normal tools and behaviors.

Core Features

  • Simulates Codex-style prompts, tool vocabulary, tool results, and WebUI presentation for selected model routes.
  • Supports configuring codex-shim in profile settings, including enabled, modelPatterns, and modelOverrides.
  • Registers shim tools: exec_command, write_stdin, apply_patch, view_image, update_plan, and web_run.
  • Hides host tools that overlap with replacement tools when they exist, avoiding mixed similar tools in active prompt advertisements.
  • Optionally patches the DSH WebUI to expose a settings client namespace, configured via expose: 'client'.

Installing into a Web Profile

Below is an example of installing a release tarball into the WebUI web profile.

gh release download --repo OpenTritium/dsh-codex-shim --pattern 'opentritium-dsh-codex-shim-*.tgz'
pnpm dsh plugin --profile web add ./opentritium-dsh-codex-shim-*.tgz
pnpm dsh --profile web --dump-config

The first command downloads the release tarball matching the pattern; the second command adds the bundle to the web profile; the third command exports the current profile configuration to verify the installation result.

Configuring Model Routing

If the built-in gpt-5.6-* rules are sufficient, you can skip this section.

You can add or modify the codex-shim: section in $DSH_HOME/settings.yaml within profile settings:

codex-shim:
  enabled: true
  modelPatterns:
    - gpt-5.6-*
    - deepseek-v4-*
  modelOverrides:
    - provider: openai
      model: gpt-5.6-luna
      enabled: true
    - provider: example-provider
      model: experimental-model
      enabled: false

enabled controls whether the shim is active. modelPatterns replaces the automatic-rule list, controlling which model routes enter the Codex surface. Each entry in modelOverrides must exactly match provider/model, and takes precedence over modelPatterns.

Optional: Exposing a Settings Client for WebUI

If you only configure via the settings file, you can skip this section. If you want the WebUI to expose a settings client namespace, you must first apply the patch to a specified clean DSH commit, then rebuild DSH, and finally install the release tarball.

gh release download --repo OpenTritium/dsh-codex-shim --pattern 'opentritium-dsh-codex-shim-*.tgz' --pattern 'deepseek-harness-settings-client-exposure-47f9438.patch'
git clone https://github.com/deepseek-ai/deepseek-harness.git deepseek-harness
cd deepseek-harness
git checkout 47f943859bef60e4160492346772ded9b24f765a
git apply --check ../deepseek-harness-settings-client-exposure-47f9438.patch
git apply ../deepseek-harness-settings-client-exposure-47f9438.patch
pnpm install && pnpm run build
pnpm dsh plugin --profile web add ../opentritium-dsh-codex-shim-*.tgz
pnpm dsh --profile web --dump-config

This patch targets only the clean checkout at 47f943859bef60e4160492346772ded9b24f765a. Do not apply it to a dirty checkout or a different commit.

Uninstallation

After removing the bundle, DSH will continue to use normal tools and behaviors.

pnpm dsh plugin --profile web remove @opentritium/dsh-codex-shim
pnpm dsh --profile web --dump-config

To clear saved shim preferences, you also need to delete the complete codex-shim: section from $DSH_HOME/settings.yaml.

If you previously applied the optional WebUI patch, you must first remove the bundle and then reverse-apply the patch; and only perform the reverse operation if no other local external bundle uses expose: 'client':

pnpm dsh plugin --profile web remove @opentritium/dsh-codex-shim
git apply --reverse --check ../deepseek-harness-settings-client-exposure-47f9438.patch
git apply --reverse ../deepseek-harness-settings-client-exposure-47f9438.patch
pnpm run build
pnpm dsh --profile web --dump-config

Use Cases and Considerations

Suitable for the following scenarios:

  1. You are already using GPT-family or other Codex-adapted models in DSH and want them invoked with Codex-style tool vocabulary and result presentation.
  2. You need to enable the Codex surface only on specific model routes without changing DSH’s default behavior.
  3. You want to install and uninstall the plugin in the web profile via release tarballs.

Points to note:

  1. It is a shim, not a Codex runtime; it does not provide a Codex app-server, OAuth, models, credentials, command execution, or a web-search backend.
  2. write_stdin is a degraded capability: non-empty stdin will be rejected because the current DSH shell definition has no stdin-write operation.
  3. view_image is a conditional capability: it requires the profile to provide filesystem and image-attachment capabilities.
  4. web_run is search-only and does not implement open, click, find, screenshots, or arbitrary fetch.
  5. modelOverrides entries must exactly match provider/model and take precedence over modelPatterns.
  6. Since the plugin runs within the current dsh process, review the source code and license before installation; this plugin is licensed under MIT.

Conclusion

The value of @opentritium/dsh-codex-shim lies in route-controlled overlaying of Codex-style prompts, tools, results, and WebUI presentation onto DSH while preserving DSH’s original behavior. It suits DSH users who need improved tool-calling stability for Codex-adapted models.

GitHub repository: https://github.com/OpenTritium/dsh-codex-shim.
Plugin directory reference: https://www.skillhub.cn/plugins/OpenTritium/dsh-codex-shim (this link was not verified during this round of research; it is listed here only as a reference).

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

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

Xiaoye