DeepSeek Harness 插件

dsh-llm-github-copilot

GitHub Copilot LLM 适配器:OAuth 设备码登录、从 Copilot API 动态发现模型、视觉模型图片输入支持(gpt-4.1、gpt-4o),以及 Chat Completions 与 Responses 双协议,按模型自动路由。

跳到安装方式

来源信息

GitHub 仓库
lujianjun19/dsh-llm-github-copilot
最近更新
2026年8月18日
分类
模型与服务商
GitHub stars
2

安装

默认先复制一段 Prompt,让 Agent 读页面和仓库;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读页面和仓库。

请先不要安装。阅读这个 DeepSeek Harness 插件,说明它解决什么问题、会访问哪些文件、网络或密钥,以及如何安装和卸载。

插件页面:https://deepseekplugins.org/zh/plugins/lujianjun19/dsh-llm-github-copilot
GitHub:https://github.com/lujianjun19/dsh-llm-github-copilot
插件名:dsh-llm-github-copilot
作者:lujianjun19
安装命令:dsh plugin --profile web add @lujianjun19/dsh-llm-github-copilot

确认前不要执行安装命令。

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-llm-github-copilot

English | [中文](README.zh.md)

GitHub Copilot LLM adapter for DeepSeek Harness.

Sign in with your GitHub account and use every Copilot model — including GPT-4.1, Claude Sonnet, Gemini, and GPT-5 family — directly inside DeepSeek Harness. Vision-capable models accept pasted or dragged images in the chat composer.

Install

From npm (recommended)

dsh plugin --profile web add @lujianjun19/dsh-llm-github-copilot

From GitHub

dsh plugin --profile web add github:lujianjun19/dsh-llm-github-copilot

pnpm 10 and newer block git dependency build scripts by default. If installation asks you to approve the package build, add the exact package key it reports to the profile's pnpm-workspace.yaml:

allowBuilds:
  dsh-llm-github-copilot: true

Then repeat the install command.

After installation, register the plugin in the profile's cordis.patch.yml:

- insert:
    - id: llm-github-copilot
      name: '@lujianjun19/dsh-llm-github-copilot'

Restart DSH to activate:

dsh web

Sign in

Run the login command inside the Harness chat:

/copilot-login

Follow the instructions — open the verification URL in your browser, enter the displayed code, and authorize the GitHub App. The token is stored automatically once you complete authorization. Run /copilot-status to confirm the connection and see the available models.

To sign out:

/copilot-logout

You can also set the token directly as an environment variable (useful for CI or headless setups):

export GITHUB_COPILOT_OAUTH_TOKEN=<your-github-oauth-token>

Supported token types:

PrefixSource
gho_OAuth token (gh auth login)
github_pat_Fine-grained PAT (requires Copilot permission)
ghu_GitHub App user token (VS Code client)

ghp_ classic PATs are not accepted by the Copilot API.

Features

Model discovery — available models are fetched live from https://api.githubcopilot.com/models on each login and cached for 5 minutes. No static list to maintain.

Vision support — models that declare supports.vision: true (e.g. gpt-4.1, gpt-4o) accept images. Paste or drag a PNG/JPEG/WebP/GIF into the chat composer; the image is attached, persisted, and visible in history after reload.

Two wire protocols — the adapter speaks both OpenAI Chat Completions (/chat/completions) and the newer Responses API (/responses). The correct endpoint is chosen automatically per model.

Reasoning control — effort levels (low / medium / high / max) are forwarded to models that declare them (gpt-5.x, Claude thinking budget, Gemini reasoning).

Automatic token refresh — the short-lived Copilot API token is renewed transparently before it expires; no action required.

Settings page — the plugin adds a dedicated GitHub Copilot section to the Harness Web settings UI (open DSH in your browser → click the gear icon → GitHub Copilot). From there you can sign in, view authentication status and the available model list, and sign out — no slash commands required.

Configure

The plugin works with no configuration. To override defaults, edit the profile's cordis.patch.yml:

- id: llm-github-copilot
  config:
    oauthTokenEnv: GITHUB_COPILOT_OAUTH_TOKEN   # env var that holds the GitHub OAuth token
    baseURL: https://api.githubcopilot.com       # override Copilot API host
    defaultContextWindow: 262144
    defaultMaxTokens: 32768
    streamIdleTimeoutMs: 300000
    models: []   # optional static fallback catalog; leave empty to use live discovery

Develop

Requires Node.js ≥ 24 and npm.

cd /path/to/dsh-llm-github-copilot
npm run build      # concatenate source fragments → lib/index.js and lib/client.js
npm test           # build + deterministic artifact, i18n, and metadata tests
npm run check      # build + tests + npm pack dry-run
npm run deploy     # test → build → atomic deploy with rollback backup

Install the checkout into a local profile directly:

dsh plugin --profile web add .

After Host changes restart DSH; after Client-only changes a hard refresh (Ctrl+Shift+R) is usually enough.

Rollback

npm run deploy keeps a timestamped backup before each install. To roll back, stop DSH and restore the wanted backup:

cp -r ~/.dsh/plugin-backups/dsh-llm-github-copilot/<timestamp> \
      ~/.dsh/profiles/web/node_modules/@lujianjun19/dsh-llm-github-copilot
dsh web

Troubleshooting

Model selector shows no GitHub Copilot group after restart The plugin loaded in a previous process that didn't pick up the new package. Restart dsh web. The stored token is preserved; no need to sign in again.

Models appear but Claude is missing Your egress IP is restricted. Export HTTPS_PROXY pointing to a proxy that exits from an unrestricted region, then restart dsh web.

/copilot-login times out or reports a network error Transient network issue during device-code polling. Run /copilot-login again to get a fresh code (the old one is invalidated automatically).

configurable provider "github-copilot" is already declared An older version of this plugin used the route name github-copilot, which conflicts with a DSH built-in. This version uses github-copilot-official. Verify that your cordis.patch.yml uses id: llm-github-copilot and name: '@lujianjun19/dsh-llm-github-copilot'.

Token expired No action needed. The plugin stores the long-lived GitHub OAuth token and refreshes the short-lived Copilot API token automatically before it expires. Only an explicit sign-out or token revocation requires a new /copilot-login.

License

[MIT](LICENSE)