
ymh0000123/dsh-client-masquerade
30Last commit Aug 16, 2026
dsh-client-masquerade DSH plugin
This plugin lets you apply, clear, or switch between masquerade headers (Claude Code, Codex, or custom) for any configured llm-pi-ai provider. It provides a Settings page, a model tool (mask_client), and a user-agent patch to ensure the disguise works with gateways that check User-Agent. The interface is bilingual (English/Chinese) and follows the Harness language setting.
How to install the dsh-client-masquerade DSH plugin
dsh plugin --profile web add github:ymh0000123/dsh-client-masqueradeCopying does not run this command. Review the repository and version before installing the dsh-client-masquerade DSH plugin.
dsh-client-masquerade DSH plugin data source
dsh-client-masquerade DSH plugin snapshot date: Aug 16, 2026
discovered
What the dsh-client-masquerade DSH plugin can do
- One-click application/clearing/switching of masquerade presets: Claude Code, Codex, or custom headers.
- Writes fake client identity headers into provider configuration (headers field) sent with every request.
- Three entry points: Settings page, model tool mask_client (list/on/off/test), and dynamic mode Run card.
- Bilingual UI that follows the host language setting.
- Test action makes a real minimal streaming call to verify the headers the gateway actually receives.
Where the dsh-client-masquerade DSH plugin fits
- Bypass gateways that route or allow requests based on the User-Agent client identity.
- Quickly switch between different client identities for testing provider configurations behind different gateways.
- Debug headless scenarios where the gateway requires a specific client header to authenticate.
- Integrate custom models into workflows that expect a Claude Code or Codex client header.
Who the dsh-client-masquerade DSH plugin is for
- Developers using DeepSeek Harness who need to access gateways that filter by client identity (e.g., agentrouter, claude-code-router).
- Advanced users who want to test custom llm-pi-ai providers under different client head conditions.
dsh-client-masquerade DSH plugin limitations
- Only works with llm-pi-ai custom providers; the built-in deepseek-official provider has no header hook.
- Requires the User-Agent patch to be applied (otherwise the user-agent header is overridden by the harness).
- Masquerade headers are persisted in settings; disabling the plugin does not automatically remove them.
- After uninstall, the User-Agent patch and persisted headers must be manually cleaned up.
dsh-client-masquerade DSH plugin: from the repository README
Quoted from the ymh0000123/dsh-client-masquerade README, the upstream source of the dsh-client-masquerade DSH plugin. Copyright remains with the original authors.
**DeepSeek Harness 插件:让自定义模型伪装成 Claude Code / Codex 客户端** **A DeepSeek Harness plugin: make a custom model masquerade as a Claude Code / Codex client.** 一些网关(如 agentrouter、claude-code-router 类代理)按请求头识别客户端并据此路由或放行。本插件把伪造的客户端身份头写入你的 `llm-pi-ai` provider 配置,随每次请求真实发到上游网关——一键开启/关闭/切换,带中英文设置页。 --- ## 安装 / Install ### 方式一:官方命令安装(推荐) ```bash dsh plugin --profile web add github:ymh0000123/dsh-client-masquerade ``` 这条命令会在 profile 目录里执行 `pnpm add github:ymh0000123/dsh-client-masquerade`,然后自动把包(其 `dsh.bundle.patch` 声明)并入该 profile 的插件层栈——**不需要手动改任何配置文件**。 **然后应用 User-Agent 补丁(必做)**——否则伪装头里的 `user-agent` 会被 pi-ai 适配器的归属机制剥掉并覆盖为 `deepseek-harness/...`,按 User-Agent 识别客户端的网关(agentrouter、claude-code-router 类)会拒绝请求(**401 UNAUTHENTICATED**)。在你的 profile 目录(含 `node_modules` 的那个)执行: ```bash node node_modules/dsh-client-masquerade/patches/apply-pi-ai-useragent-patch.mjs ``` > 注意:`node_modules` 是相对路径,请先在 profile 目录(含 `node_modules` 的那个)里执行。不记得目录或不在该目录时,直接用**绝对路径**调用脚本即可,脚本会自动定位本 profile 里安装的 `dsh-llm-pi-ai`: > > ```bash > node "C:\Users\你的用户名\.dsh\profiles\web\node_modules\dsh-client-masquerade\patches\apply-pi-ai-useragent-patch.mjs" > ``` 补丁幂等,可重复执行;`pnpm install` 或升级 `dsh-llm-pi-ai` 后需重新应用一次。
Read the full READMERepository license: MIT
dsh-client-masquerade DSH plugin questions
How do I install the masquerade plugin?
Run `dsh plugin --profile web add github:ymh0000123/dsh-client-masquerade` in your terminal. This will install the package and automatically register it into the profile's plugin stack. Then you must apply the User-Agent patch (see next FAQ) and restart `dsh web`.
Why do I get 401 UNAUTHENTICATED when using the masquerade?
This usually happens because the User-Agent patch hasn't been applied. The native `dsh-llm-pi-ai` adapter strips and overrides the `user-agent` header. Apply the patch via Settings page or run `node node_modules/dsh-client-masquerade/patches/apply-pi-ai-useragent-patch.mjs` in your profile directory, then restart `dsh web`.
How do I switch between Claude Code and Codex masquerade?
Go to Settings → Client Masquerade. Select the provider you want to configure, then click either 'Claude Code' or 'Codex' button. The headers will be written immediately. You can also use the model tool `mask_client action=on provider=<id> preset=codex`.
How do I uninstall the plugin and clean up leftover data?
Run `dsh plugin --profile web remove dsh-client-masquerade`. After uninstall, two things remain: the User-Agent patch (run `--revert` to undo) and any masquerade headers written into provider settings (manually set them to 'Off' or clear the `headers` field).
Can I use custom headers beyond the two presets?
Yes. Use the `custom` preset or pass `headersJson` parameter with the `mask_client` tool. For example: `mask_client action=on provider=my-provider preset=custom headersJson={"originator":"codex-tui"}`. The custom headers will be merged with the existing ones.