subeichen1/dsh-auto-effort ↗★ 0

dsh-auto-effort

Per-turn thinking-effort routing that keeps the current model, including Magpie and other third-party providers

Package
dsh-auto-effort
Compatibility
Unverified
Version
1.0.0
License
MIT
Last updated
Nov 9, 2026

Other repositories with this package name

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add dsh-auto-effort

配置

在 profile 的 cordis.patch.yml 中覆盖同名行即可(id: auto-effort):

- id: auto-effort
  config:
    mode: auto            # auto | manual,初始模式;之后由胶囊切换并持久化(见下方状态文件)
    global: true          # 覆盖所有会话(含子代理);false 时仅覆盖本插件挂载的 agent
    respectExplicit: false # true 时尊重请求里已有的 reasoningEffort(见下方警告)
    judgeUrl: ""          # 可选:Laya 判定服务的 /judge 地址(见下方隐私说明)
    judgeTimeoutMs: 1000  # 可选:远程判定超时(100–10000ms)
    efforts:              # 可选:按档位改偏好顺序
      low: [low, minimal]
      high: [high, medium]
      max: [max, xhigh]
    judge:                # 可选:判定规则的可调项,缺省值如下
      scoreHigh: 3        # 累计分 ≥ 此值 → high
      scoreMax: 6         # 累计分 ≥ 此值 → max
      lengthTiers: [160, 500, 1200]   # 长度加分档位:+1 / +1 / +2
      judgeMaxChars: 4000 # 超过此长度只保留开头与结尾
      hardKeywords: []    # 额外的高难度关键词(按纯文本匹配,不需要转义)
      broadKeywords: []   # 额外的广度关键词(+3)

模式文件位置:$DSH_HOME/auto-effort-mode.json,未设置 DSH_HOME 时退回 ~/.dsh/auto-effort-mode.json; 写入走「临时文件 + rename」,中途被杀不会留下半截文件。

judgeUrl 会把任务文本发出去:请求体包含 task(最多 judgeMaxChars 字)、上一轮任务 prev_task 与会话 id。默认关闭(空字符串)。开启时请使用本机或可信地址,并注意非 https 的 地址会在日志里打印一条 warn:文本将以明文离开本机,且目前不做脱敏。

respectExplicit: true 的代价:只要请求里已经带了 reasoningEffort,插件就原样放行。 本机 profile 的 agent-default-model 默认设了 reasoningEffort: max,于是每一轮都算「已指定」, 插件等于全程不介入——胶囊会显示「AUTO · 已指定 · max」并灰掉,悬停可看到原因。想要插件真正 接管,请保持 respectExplicit: false,或去掉 profile 里的默认 reasoningEffort。

胶囊的几种非档位状态:AUTO · 已指定 · (让行)、AUTO · 不支持(模型没有声明强度)、 AUTO · 离线(宿主路由不可达)、AUTO · 切换失败(写入被宿主拒绝,3 秒后恢复)、手动(不介入,请求原样发出)。

模式是全局开关:胶囊按会话显示判定记录,但点击切换的是所有会话共用的 auto/manual, 浮层在没有模型信息时会写明这一点。没有本会话记录时胶囊显示 AUTO · 待判定,不会拿别的会话 最近一条判定来顶替。