dshbase

插件目录 / Developer / dsh-session-header

dsh-session-header

未验证 homily707

✓ 持续维护 基于 1 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

2Stars
0Forks
0未关闭 issue
语言
2026-08-22最近推送
跨平台平台

功能简介

Developer 类别的 DeepSeek Harness 插件。

我们的评价
未验证 — 尚未实测

Developer 类别的 DeepSeek Harness 插件。 尚未验证——请自行安装测试。

「未验证」表示我们的自动化 CI 尚未安装过该插件。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

你是插件作者? 想拿到「已验证」标签——提交你自己的验证证据(截图、日志或短视频),我们审核通过后即改为「已验证」。

提交验证证据 ↗

README

dsh-session-header

English | 中文

A DeepSeek Harness plugin that injects an x-session-id HTTP header onto every LLM provider request the harness sends, carrying the harness session id of that exact call.

Why

The harness has no per-request header seam — GenerateOptions has no headers field and every adapter builds its own wire headers internally. If your model gateway (or an intermediary proxy) keys routing, caching, or auditing on a session header, the harness cannot send one by itself.

This plugin closes that gap with the two official interception points composed together:

  • the llm/stream waterfall names the calls that are LLM calls and carries options.sessionId;
  • a globalThis.fetch patch adds the header, so every fetch-based adapter (llm-deepseek, llm-pi-ai, and any SDK whose transport bottoms out in global fetch) is covered without touching adapter code.

Context propagation uses AsyncLocalStorage: only fetches that happen inside an LLM call's stream are touched; unrelated fetches (web RPC, telemetry, tool traffic) pass through untouched. A header anyone else already set is never overwritten (case-insensitive, per HTTP semantics). Unloading the plugin restores the original fetch.

Semantics of the value:

  • default: GenerateOptions.sessionId of the call in flight, with the harness's session- branding prefix stripped (a plain UUID is sent) — main-session turns, compaction/title helper calls, and in-process subagent children each report their own session id (subagents get their own child session ids);
  • value config: a fixed value for every call instead (sent verbatim, no prefix stripping);
  • calls with neither get no header.

Install

Requires the dsh CLI and Node ≥ 22.

As a bundle (recommended)

dsh plugin --profile <name> add github:homily707/dsh-session-header

This package is plain JavaScript with no build scripts, so the pnpm ≥ 10 build allowance is not needed. Verify the layer and boot:

dsh --profile <name> --dump-config   # look for the "# == dsh-session-header" layer
dsh --profile <name>

As a --patch overlay from a local checkout

# my-overlay.yml — plugin rows need an absolute module path here
- insert:
    - id: session-header
      name: /absolute/path/to/dsh-session-header/index.js
      config:
        header: x-session-id
        # value: my-fixed-session-id
dsh --patch ./my-overlay.yml

Configuration

field type default meaning
header string x-session-id header name to inject; case-insensitive on the wire
value string fixed value; unset = the harness session id of the call in flight

Verify it

Point a provider's baseURL at a logging gateway (or any endpoint that echoes request headers) and start a session:

x-session-id: ba104306-a748-4052-a6e3-ab60be2e4c1f

Every request of the same conversation carries the same id; a spawned subagent's requests carry the child session id.

Notes

  • The llm-deepseek adapter already sends its own x-deepseek-harness-session-id on every request; this plugin is provider-neutral and intentional about not overwriting existing headers.
  • attributionHeaders() (the harness User-Agent attribution contract) is never touched.
  • Concurrent sessions are handled correctly: the header value is resolved per call through AsyncLocalStorage, not through shared mutable state.

License

MIT

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-session-header」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:homily707/dsh-session-header

Headless(CLI)profile:

dsh plugin --profile headless add github:homily707/dsh-session-header

实测报告

尚未 L3 验证——若已跑过,见下方失败备注。

状态:pending · 最近测试 2026-08-26
备注:验证: runtime-fail 浏览全部待验证失败 →
安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7789 个插件 →