chenyifawan-cell/dsh-litellm-extra-headers ↗★ 0
dsh-litellm-extra-headers
DeepSeek Harness plugin: inject an `extra_headers` entry into the OpenAI-compatible request BODY for model calls routed to listed providers and sent to listed upstream hosts — the only injection point that survives a LiteLLM relay, which drops client HTTP headers. 适合需要穿透LiteLLM等中转网关,向特定上游传递会话标识的开发任务。
Install
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:chenyifawan-cell/dsh-litellm-extra-headersREADME
Read the full README ↗配置字段
| 字段 | 类型 | 默认 | 说明 |
|---|---|---|---|
providers | string[] | [] | llm/stream 的 options.provider 路由键白名单。必须显式列出,匹配大小写不敏感。 |
hosts | string[] | [] | 允许注入的上游 host[:port] 白名单;带 scheme / path 的写法会被归一化(http://litellm.internal:4000/v1 → litellm.internal:4000)。必须显式列出。 |
header | string | x-opencode-session | 放进 extra_headers 的字段名。 |
mode | session-id | uuid | fixed | session-id | 取值来源:DSH 会话 id(跨轮次、跨重启稳定)/每会话一个进程内随机 uuid/配置里的字面量。 |
value | string | — | mode: fixed 时的字面量;fixed 却没给值会在加载时报错。 |
debug | boolean | false | 每次注入决策打一条 ctx.logger.info。 |
debugFile | string | — | 每次注入决策追加一行 JSON(含 provider / model / session / host / path / event / reason),进程控制台看不到时用它排错。 |
providers 或 hosts 为空时插件保持惰性并打一条 warning:一个可以共享出去的包,不应该对别人没被告知过的网关偷偷加字段。