baosfeng/my-dsh-plugins--plugins-dsh-my-opencode-session-header ↗★ 11

dsh-my-opencode-session-header

为推理请求注入会话头以修复网关错误 适合使用OpenCode Go网关且遇到400报错的用户。

包名
dsh-my-opencode-session-header
兼容性
待验证
版本
0.1.0
许可证
MIT
最近更新
2026年10月10日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:baosfeng/my-dsh-plugins#e7fff48bc3ce67cc99f28fa7f1f8175814da76eb&path:plugins/dsh-my-opencode-session-header

配置项

配置项默认值说明
enabledtrue总开关(false 不注册监听、不装 fetch 补丁)
providers["opencode", "opencode-go"]provider 路由白名单(空数组 / 非法值启动即报错)
hosts["opencode.ai"]目标主机白名单,自动含子域(zen.opencode.ai 命中 opencode.ai)
headerName"x-opencode-session"注入的请求头名
valueMode"uuid"uuid = 取会话 id 中的裸 UUID(无则回退原串);raw = 原始会话 id
overridefalse已有同名头时是否覆盖
- id: opencode-session-header
  config:
    enabled: true
    providers: ['opencode', 'opencode-go']
    hosts: ['opencode.ai']
    valueMode: uuid
    # override: true   # 仅当确有需要覆盖已有同名头时才开启