DeepSeek Harness Plugin Hub

发布与管理完整 Harness Profiles,发现适合你的插件。

探索

插件目录环境预设文档中心动态

社区

发布插件联系我们报告问题

相关链接

Plugin Hub GitHubDeepSeek Harness 官方项目系统状态隐私说明
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

独立、非官方社区项目,与 DeepSeek 官方无隶属、授权或背书关系。

DeepSeek Harness Plugin Hub
ProfilesPlugins分类动态文档登录管理 Profiles
ProfilesPlugins分类动态文档登录
← Plugins

dsh-session-cost-cap

Session Cost Cap

限制单个会话在模型调用上的支出上限的 DeepSeek Harness 插件。跟踪实际令牌用量和价格,在接近上限时向模型发出警告,并在超出上限前停止或询问。

插件会安装到这里;不确定时保持 web。

npx -y @deepseek-ai/dsh plugin --profile web add dsh-session-cost-cap@0.1.0
README兼容性版本

兼容性与来源证明

Session Cost Cap 以 dsh-session-cost-cap 发布,当前版本为 0.1.0。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。

DSH 兼容范围
*
运行环境
web
发布来源
npm
Registry 更新时间
2026/11/4

版本

0.1.0stable
2026/10/20

相关插件

正在加载相关插件…

最新版
0.1.0
DSH
*
HMR
重启进程
Tree shaking
未声明可安全裁剪
解包体积
42.4 kB
文件数
13
Surface
web
许可证
MIT
发布源
npm
GitHub
★ 2
周下载
30
最近提交
2026/10/30
查看源码 ↗项目主页 ↗
README Badge

点击下方 Badge 复制 Markdown,粘贴到 README 即可。

这是你的 Plugin?认领权益 · 优先安全扫描

验证 package.json 声明的 GitHub 仓库,即可管理这个公开页面。认领后,Hub 会优先安排当前版本的安全扫描,并在通过后公开展示结果。

认领这个 Plugin →
报告问题

相关插件

继续浏览 models-usage 分类下经过校验的插件。

Experimental Cot Translation Bundle@deepseek-ai/dsh-experimental-cot-translation-bundle扩展推理的实验性机器翻译Our Free Model@ebony-vinyl/dsh-our-free-modelOur Free Model — 在 dsh 里装上这个插件即可,无需登录、注册或填 API Key,就能使用包括 DeepSeek V4.1 Flash、Kimi K3 在内的前沿模型,桌面端另有 EAC 协付渠道;2.0 起接入 LobsterAI、Qoder、TRAE、Cline、Loomy、Raccoon、MiniMax、ZCode、Gemini 十个账号渠道(原有匿名免费通道保留)(登录、账号池、积分领取、本地 OpenAI 网关与局域网转发、数据看板与运行日志),六页毛玻璃界面统一呈现。Usage@linxin666/dsh-usage用于 dsh Web GUI 的使用统计插件:检测各提供商的余额和编程套餐配额,并实时记录令牌使用情况;侧边栏 Settings 行上方显示紧凑的价格概览卡片Connect Workbuddydsh-connect-workbuddy把本机登录的 WorkBuddy 模型(国内版与国际版)接入 DeepSeek Harness:每次刷新按上游目录自动读取每个模型的积分倍率,支持逐模型图片输入开关、多账号切换与账号池自动换号,并提供每日签到、卡片与输入框里的胶囊积分读数等只读积分概览。

README

dsh-session-cost-cap

English | 中文

You give the agent a task before lunch. It hits a flaky test, decides the fix is a refactor, starts three subagents to "investigate", and re-reads the same 4,000-line file twenty times. When you come back the task isn't done, and the session has cost more than the rest of your week.

This DeepSeek Harness plugin keeps a running total of what each session spends, from the token counts the model actually reports, priced per model. Subagents count toward the session that started them. As the budget runs low the model is told to wrap up, and once it's spent, tool calls stop until you approve more:

[dsh-session-cost-cap] This session has used $4.12 of $5.00 (2.4M tokens), 82% of its budget.
Finish the task efficiently: skip optional exploration, avoid re-reading large files, and batch small edits.
dsh-session-cost-cap: this session has reached its cost cap ($5.03 of $5.00 (2.9M tokens)).
The user was asked to approve this call. If they decline, stop and tell them what you finished and what is left.

Install

dsh plugin --profile web add dsh-session-cost-cap

That's the web profile, the browser UI you start with dsh web. If you run DSH another way, use headless (scripts and CI) or acp (editor integrations) instead. Each profile keeps its own plugin list, so add it to every profile you use. It's on as soon as it's installed, with a $5 cap per session. Remove it with dsh plugin --profile web remove dsh-session-cost-cap.

It's also part of dsh-guard-pack, which installs nine guards at once.

How it works

  • Real usage, real prices. After every model call, DSH's adapter reports input, output and cached tokens. The plugin prices them with the model the request used, using llm-tally's table of 138 models (DeepSeek, OpenAI, Anthropic, Google, xAI, Qwen and more), with cache reads at the cached rate. Failed and retried attempts count too when the provider reports their usage, because they cost money.
  • Subagents roll up. A subagent's spend is added to the session that started it, however deep the nesting goes.
  • A warning first. At 80% of the budget (configurable) the next tool result carries a note asking the model to finish efficiently. It's shown once per budget level.
  • Then a stop. At the cap, each tool call needs your approval (ask, the default) or is refused (deny). Approving one lets the session spend another 50% of the cap before it asks again. In deny mode the model is told to stop and summarise what's done and what's left.
  • A token cap too, if you'd rather count tokens than dollars, or use both.

Models without a price

If a model isn't in llm-tally's table (a local model, a fine-tune, a new release), its tokens still count toward a token cap but not toward the dollar cap, and the DSH log says so once. Give it a price under prices to fix that.

Limits

  • Spend is tracked in memory while DSH runs. Resuming a session after restarting DSH starts its count from zero.
  • The cap is checked before tool calls. A step that ends with plain text (no tool call) already ends the turn, so it never runs away on its own, but the step that crosses the cap still completes.
  • Prices are list prices. Discounts, off-peak rates and batch pricing aren't applied, so the total is an upper estimate for those.

Settings

The easy way: open Plugins in DSH's sidebar, click dsh-session-cost-cap, change what you want and press Save. It applies at once, no restart needed.

Or add a row like this to ~/.dsh/profiles/<profile>/cordis.patch.yml, or to ~/.dsh/cordis.patch.yml for every profile. Keys you leave out keep their defaults.

- id: session-cost-cap
  config:
    maxUsd: 5          # dollars per session, subagents included; 0 = no dollar cap
    maxTokens: 0       # input + output tokens per session; 0 = no token cap
    mode: ask          # or deny
    extendBy: 0.5      # after an approval, allow 50% more of the cap before asking again
    warnAt: 0.8        # tell the model at 80% of the budget; 0 = never
    prices:            # USD per 1M tokens, for models llm-tally doesn't know
      my-local-model: { input: 0, output: 0 }
      my-fine-tune: { input: 3, output: 12, cachedInput: 0.3 }

Development

npm install        # from the repository root
npm test -w packages/dsh-session-cost-cap
npm run test:e2e   # real dsh runs against a scripted local model, no API key needed

MIT licensed. Written by acus9345. Bug reports and ideas are welcome in the issues.