dsh-codex-tools: Adding Codex Search, Image Generation, and Image Recognition Tools to DeepSeek Harness

Preface

In the DeepSeek Harness workflow, models may need to access the public internet, generate bitmaps, or read local images and answer questions about them. dsh-codex-tools is a plugin for DeepSeek Harness, maintained by SPYQWER1, that registers three Codex-supported tools: codex_web_search, image_gen, and image_vision.

It uses the existing ChatGPT/Codex login state and does not provide login functionality or an LLM provider.

Core Features

codex_web_search is used to search the public internet and return summaries along with source URLs.

Parameters:

  • query: Required.
  • maxSources: Defaults to 5, range 1 to 10.
  • freshness: Optional, either cached or live.
  • model: Defaults to gpt-5.4-mini.

image_gen

image_gen is used to generate bitmaps; it does not edit or convert existing images.

Parameters:

  • prompt: Required.
  • out: Defaults to output/imagegen/<timestamp>.<format>, must be relative to the current DSH session workspace.
  • size: Optional, one of auto, 1024x1024, 1536x1024, 1024x1536, 2048x2048, 2048x1152.
  • format: Optional, one of png, jpeg, webp, defaults to png.
  • model: Defaults to gpt-5.5.

Path restrictions:

  • out only accepts files within the current DSH session workspace.
  • Rejects absolute paths, parent directory segments, and symbolic links.
  • Does not overwrite existing files; parent directories are created.

image_vision

image_vision is used to read local images and return descriptions or answer questions about them.

Parameters:

  • image: Required, limited to png, jpeg/jpg, webp, or gif files within the current DSH session workspace, maximum 15 MiB.
  • question: Optional.
  • model: Defaults to gpt-5.5.

Path restrictions:

  • image only accepts files within the current DSH session workspace.
  • Rejects absolute paths, parent directory segments, and symbolic links.

Installation and Activation

First, confirm the runtime environment:

  • DeepSeek Harness.
  • Node >= 22.
  • ChatGPT/Codex login state; can use DSH credentials OPENAI_CODEX_API_KEY or OPENAI_CODEX_REFRESH_TOKEN.

Install from Git:

dsh plugin --profile web add github:SPYQWER1/dsh-codex-tools

Install from npm:

dsh plugin --profile web add dsh-codex-tools

Restart DSH after installation:

dsh web

Or:

dsh --profile web

Remove the plugin:

dsh plugin --profile web remove dsh-codex-tools

Credentials and Login State

Credentials are resolved first from environment variables:

CODEX_ACCESS_TOKEN
CODEX_REFRESH_TOKEN

If these variables do not exist, the auth file is read:

$CODEX_HOME/auth.json
~/.codex/auth.json

If credentials are injected via DSH, OPENAI_CODEX_API_KEY or OPENAI_CODEX_REFRESH_TOKEN can be used. After an HTTP 401, the transport layer refreshes the access token once and attempts to persist the refreshed login state to the auth file. When DSH credentials are injected, the refresh code may still write to the auth file selected by CODEX_HOME or the default path.

Runtime Limitations and Compliance

  • The plugin uses chatgpt.com/backend-api/codex/responses. This endpoint is internal, undocumented, and subject to change or restriction.
  • Search summaries and excerpts are generated by the model; you should open the source URLs to verify the original text.
  • Web search and image generation use the metered Codex-usage bucket of the ChatGPT plan.
  • Must comply with OpenAI Terms of Use; ChatGPT subscriptions must not be used to support a public-facing image-generation service.
  • image_gen’s out and image_vision’s image only accept files within the current DSH session workspace; absolute paths, parent directory segments, and symbolic links are rejected.

Use Cases and Considerations

Suitable for developers who already have a DSH environment and ChatGPT/Codex login state and want to add public web search, bitmap generation, or local image understanding to their DSH workflows.

The plugin runs with the permissions of the current DSH process; check the source code and MIT license before installation.

Links

  • GitHub: https://github.com/SPYQWER1/dsh-codex-tools
羽毛球分组比赛记分
小程序二维码

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

Xiaoye