itchenshi/dsh-gateway-models ↗★ 0

dsh-gateway-models

DeepSeek Harness plugin for gateway routes (OpenCode Go and Command Code): declares the route wire protocol and endpoint (so the API address never has to be typed), detects/reads each route's model catalog and puts the DeepSeek V4.1 models at the front of the OpenCode Go list while completing the Command Code list from its public catalog, supplies the route baseURL and the DeepSeek reasoning compat a catalog-unknown model needs, and attaches a stable per-conversation x-opencode-session header (fixes 400 MissingSessionID) without leaking the internal session id. 适合使用OpenCode Go等网关路由且不想手动配置端点的用户。

パッケージ
dsh-gateway-models
互換性
未検証
バージョン
0.2.0
ライセンス
MIT
最終更新
2026/09/25

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:itchenshi/dsh-gateway-models

ドキュメント

README 全文を読む ↗

1. 声明路由协议(配置层)

引擎给每个模型解析 api 的顺序是:

route.api  ??  目录里该模型的 api  ??  目录内所有模型共有的 api

opencode-go 目录里的模型横跨三种协议(anthropic-messages / openai-completions / openai-responses),第三项推不出来;目录外的新模型(如 deepseek-v4.1-flash)连第二项都没有。 于是引擎报 needs an api,模型页的严格校验也拒绝保存。

插件通过 cordis.patch.yml 给 llm-pi-ai 行补 providers.opencode-go.api: openai-completions (OpenCode Go 的 OpenAI 兼容端点说的就是这个协议)。

同一个补丁行也给 commandcode 补了 api 和 baseURL —— Command Code 完全不在自带目录里, 没有目录可推,所以地址必须由补丁层提供;写在补丁层(基础层)意味着你一次都不用填,只需要给密钥。 (这个补丁只覆盖默认名字;别的名字由运行时按接口地址识别后自己补上 api 和 baseURL。)

配置(cordis.patch.yml 的行 config,全部可选)

键说明
providers附加会话头的路由名,默认 ['opencode', 'opencode-go'];自定义路由名时加进来
commandcodeProviders额外的 Command Code 路由 id(默认不需要填:插件按接口地址自动识别 api.commandcode.ai 上的路由)。仅当某条路由的地址在配置里看不到时才用它明确指定
mode'uuid'(默认,安全)或 'session-id'(显式可选,会发送内部会话 ID)
debugtrue 时记录每个收到头的流式调用
debugFile追加 JSON 日志的路径;仅 $DSH_HOME/logs 或系统临时目录下的路径生效;日志里的 session 是 SHA-256 单向散列