KakaruHayate/dsh-degen-heal0

@dsh-external/llm-degen-heal

检测并自愈 LLM 输出退化循环:流式碎词/熵骤降/空转仪表三信号,请求级惩罚注入(含需核心改一行项)、流中断重试、冷却幂等、dev_loop_status 诊断

包名
@dsh-external/llm-degen-heal
版本
0.2.0
许可证
BSD-3-Clause
最近更新
2026年8月25日

安装

此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗

Configuration 配置

Every tunable is a validated config field (fail-loud on bad values). Override in your cordis.yml / profile patch / inject config:

plugins:
  '@dsh-external/llm-degen-heal':
    enabled: true
    # windowTokens: 256        # detection rolling window
    # repeatThreshold: 8       # run length that flags a token-loop
    # entropyRatio: 0.35       # unique/total below this (unstructured) => entropy-drop
    # detectAlternating: true  # detect consecutive A,B,A,B,… runs
    # idleTurns: 2             # no-tool short degenerate turns before meter steer
    # idleTurnWords: 60
    # temperatureDelta: 0      # request temp adjust per healing epoch (0 disables)
    # cooldownMs: 30000        # healing epoch cooldown
    # escalateAt: 2            # which degenerate stream causes the interrupt
    # maxRetriesPerEpoch: 1    # bounded retries per epoch
    # lockoutAt: 3             # triggers in one epoch before fail-open lockout
    # lockoutMs: 180000        # lockout suspension duration
    # healMessage: "..."       # corrective prompt injected to the model
fielddefaultmeaning
enabledtruemaster switch; false = pure passthrough with no logging
providers[]provider allowlist, empty = all
windowTokens256detection rolling window size
shortTokenMaxLen32short-token length cap
repeatThreshold8run length (same token, or alternating) that flags a loop
entropyRatio0.35entropy-drop threshold
detectAlternatingtruealso count consecutive A B A B… runs
leakMarkersbuilt-inphrases treated as leaked thinking/planning prose
leakThreshold2marker hits in a window before leak-out fires
idleTurns2consecutive idle turns before the meter acts
idleTurnWords60idle turn word cap
temperatureDelta0request temperature adjust per healing epoch (0 disables)
cooldownMs30000healing epoch cooldown
escalateAt2which degenerate stream triggers the interrupt
maxRetriesPerEpoch1degenerate retries granted per epoch
lockoutAt3triggers in one epoch before fail-open lockout
lockoutMs180000lockout suspension duration
healMessagebuilt-incorrective message injected to the model