PerryLink/dsh-param-repair ↗★ 15
dsh-param-repair
Vendor parameter mapping and deterministic JSON repair for DeepSeek Harness: the /translate command maps temperature/top_p/max_tokens/stop/system across 11 vendors, and the tools/post-execute repair layer (plus the fix_json tool) fixes broken JSON tool output with escape repair, trailing-comma removal, truncation closure, and required-field completion — never fabricating data
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:PerryLink/dsh-param-repair配置
所有可调项都是 Schemastery Config 字段(可在 cordis.yml 中修改)。按 id 定向覆盖会替换整行——需要重新声明每个键。cordis.patch.yml 逐键内联注释。
最常用键:
| 键 | 默认值 | 含义 |
|---|---|---|
enabled | true | 总开关;false 不注册任何东西 |
repair.enabled | true | post-execute 修复层开关 |
repair.toolNames | [] | 额外按名加入修复的 JSON 文本工具(叠加于 string 根/json 根 schema) |
repair.maxSteps | 8 | 策略应用预算(修复循环轮数,1..64) |
diffMaxChars | 200 | 单条日志 diff 片段的字符上限 |
registerCommand | true | 注册 /translate 命令 |
registerTool | true | 注册 fix_json 工具 |
完整配置表(13 个键)
| 键 | 默认值 | 含义 |
|---|---|---|
enabled | true | 总开关;false 不注册任何东西 |
repair.enabled | true | post-execute 修复层开关 |
repair.toolNames | [] | 额外按名加入修复的 JSON 文本工具(叠加于 string 根/json 根 schema) |
repair.strategies.escapeRepair | true | 转义字符串内的裸控制字符 |
repair.strategies.trailingComma | true | 删除闭合括号前的逗号 |
repair.strategies.truncationClosure | true | 闭合因截断而未闭合的字符串或容器 |
repair.strategies.fieldCompletion | true | 以显式 null 占位补全缺失的必填字段 |
repair.maxSteps | 8 | 策略应用预算(修复循环轮数,1..64) |
diffMaxChars | 200 | 单条日志 diff 片段的字符上限 |
diffMaxEntries | 50 | 日志 diff 条目上限 |
registerCommand | true | 注册 /translate 命令 |
registerTool | true | 注册 fix_json 工具 |
rosettaDataPath | (none) | 可选的外部 rosetta 数据文件(与内置 lib/rosetta-data.json 同形);覆盖内置映射表,文件非法则挂载期响亮失败 |
profile patch 中的覆盖示例:
- insert:
- id: dsh-param-repair
name: dsh-param-repair
config:
enabled: true
repair:
enabled: true
toolNames: ['emit-json']
strategies:
escapeRepair: true
trailingComma: true
truncationClosure: true
fieldCompletion: true
maxSteps: 8
diffMaxChars: 200
diffMaxEntries: 50
registerCommand: true
registerTool: true