- Início
- Plugins
- Modelos e provedores
- dsh-llm-github-copilot
dsh-llm-github-copilot
lujianjun19/dsh-llm-github-copilot
GitHub Copilot LLM adapter: OAuth device-flow sign-in, live model discovery from the Copilot API, vision support for image-capable models (gpt-4.1, gpt-4o), and two wire protocols (Chat Completions and Responses API) with automatic endpoint routing per model.
Instalar
dsh plugin --profile web add github:lujianjun19/dsh-llm-github-copilotREADME
dsh-llm-github-copilot
English | 中文
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:
| Prefix | Source |
|---|---|
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
Plugins relacionados
dockyard-dsh
aitabby/dockyard-dsh
dsh-commandcode-provider
mars-sea/dsh-commandcode-provider
dsh-codex-connect
franksong2702/dsh-codex-connect
dsh-authinone
stormycry-cryp/dsh-authinone