Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/skill-draft-output-budgets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"dsh-mnemon": patch
---

Give skill drafts configurable 32k initial and 64k retry output budgets. Regenerate once under a fresh task after truncation only when the explicit retry budget is larger, discard partial output, and report attempted budgets and source file size with provider-limit guidance. Keep other skill operations and adoption unchanged.

技能草案新增可配置的首次 32k 与重试 64k 输出预算。仅在截断且显式重试预算更大时使用新任务重新生成一次,丢弃不完整输出,并报告尝试预算、原文件大小和模型提供方上限建议。其他技能操作与采纳流程保持不变。
3 changes: 3 additions & 0 deletions docs/en/guides/skills.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,13 @@ Skills has its own page under **Plugins → dsh-mnemon**, like every component,
| **Suggest skill improvements** | On | Allow reviews to improve existing skills; reviews pause when both suggestion types are off |
| **New skill destination** | User | Choose User, Project or Follow storage; saved with **Apply**, reset with **Discard**. Existing skill improvements keep their original file |
| **Backtest drafts** | On | Compare each new draft with the current version on its test cases |
| **Draft generation** | 32,768 / 65,536 tokens | First attempt / one larger retry after truncation; saved with **Apply** and available with self-evolution off |
| **Review parameters** | — | The thresholds above, folded, applied together with **Apply** |
| **In the conversation** | On | Show the **Turn skills** line under each turn |
| **Sidebar entry** | Off | Show Skills as its own sidebar entry instead of in the Memory System |

Under **Draft generation**, set **Draft output token limit** and **Retry output token limit** to budgets your model provider supports, including reasoning and the complete `SKILL.md`. They are separate so retries never silently double your chosen limit. A retry limit equal to or below the first disables the truncation retry. There are at most two attempts, shared with the existing file-validation repair. Truncated output is discarded; only a complete, validated draft is saved, and the installed skill changes only after adoption. If generation fails, the error gives the attempted budgets and source file size. Lower a budget rejected by your provider; for a file that still cannot fit, shorten the skill or choose a model with a larger output limit. See [Skills settings](../reference/configuration.md#skills-settings) for the exact keys and ranges.

`skills.targetScope` defaults to `user` to preserve existing installations: upgrading or changing storage scope does not move new skill writes to another root. Choose `storage` explicitly to follow storage scope. New suggestions record their resolved destination; drafts and redrafts keep that destination, and adoption uses the draft unless you explicitly choose another root. Suggestions from older versions without a destination use the current setting when drafted; existing drafts retain their recorded root. Improvements always write back to their original `baseKey`, regardless of this setting or a destination override.

Project roots come from the Skills Source catalog for the selected workspace, following DSH discovery (nearest `.git` ancestor, or the workspace itself); the model task's working directory is not used. A missing workspace/project or an unwritable destination produces a visible review/draft error. Mnemon does not silently fall back to user skills. Adoption checks the final selected project again: a project removed after drafting is not recreated, and you can explicitly select a user root instead. Later filesystem failures are also reported. No skills are migrated, discovery precedence is unchanged, and adoption remains an explicit user action.
Expand Down
8 changes: 7 additions & 1 deletion docs/en/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ When the active Strategy does not drive idle review or runtime capacity maintena

## Skills settings

Skills keeps its settings under `skills` in the `mnemon` entry, edited on its own page under **Plugins → dsh-mnemon** through the `mnemon-skills` settings scope. Settings apply live once saved, without rebuilding the memory runtime; the destination selector and review parameters wait for **Apply** or **Discard**. The [Skills guide](../guides/skills.md#self-evolution) explains what each does.
Skills keeps its settings under `skills` in the `mnemon` entry, edited on its own page under **Plugins → dsh-mnemon** through the `mnemon-skills` settings scope. Settings apply live once saved, without rebuilding the memory runtime; the destination selector, draft budgets and review parameters wait for **Apply** or **Discard**. Draft budgets are read at the start of each draft. The [Skills guide](../guides/skills.md#self-evolution) explains what each does.

| Key | Default | Range | Meaning |
|---|---:|---|---|
Expand All @@ -368,6 +368,8 @@ Skills keeps its settings under `skills` in the `mnemon` entry, edited on its ow
| `skills.allowUpdate` | `true` | boolean | **Suggest skill improvements**: allow reviews to improve existing skills |
| `skills.targetScope` | `user` | `storage` / `user` / `project` | **New skill destination**: `user` → `user-dsh`; `project` → `project-dsh`; `storage` follows `storageScope` (`global` / `custom` → user, `workspace` / `workspaces` → project). Apply or Discard on the settings page |
| `skills.autoBacktest` | `true` | boolean | **Backtest drafts**: compare each new draft with the current version on its test cases |
| `skills.draftMaxTokens` | `32768` | integer, 128–131072 | **Draft output token limit**: budget for the first complete draft, including reasoning |
| `skills.draftRetryMaxTokens` | `65536` | integer, 128–131072 | **Retry output token limit**: one fresh attempt after `max-tokens`, only when this is greater than `draftMaxTokens`; an equal or lower value disables the truncation retry |
| `skills.hints` | `true` | boolean | **In the conversation**: the **Turn skills** line under each turn |
| `skills.sidebar` | `false` | boolean | **Sidebar entry**: Skills as its own sidebar entry, out of the Memory System |
| `skills.reviewThreshold` | `5` | 1–50 | **Review threshold**: the activity score a conversation's window must reach before a review |
Expand All @@ -378,6 +380,10 @@ Skills keeps its settings under `skills` in the `mnemon` entry, edited on its ow
| `skills.maxPendingPerSession` | `5` | 1–20 | **Pending per conversation**: past this, the least confident pending suggestions of a conversation expire |
| `skills.casesPerRun` | `8` | 1–20 | **Cases per backtest**: the most cases one automatic backtest runs |

**Draft generation** is available even with self-evolution off. The two budgets explicitly bound each attempt instead of silently doubling a user's limit. A draft gets at most two attempts total, shared with the existing retry for a rejected skill file. Only a `max-tokens` stop can use the larger budget; cancellation and other model failures do not retry. A truncated result is discarded before parsing or saving, and a retry starts a fresh task and child. Successful drafts still require the existing schema and content checks and explicit adoption; generating a draft does not change the installed skill. Reviews, case generation, executors and judges retain their existing budgets.

Keep both values within the selected provider/model's output limit. If generation still truncates, the error reports the attempted budgets and source `SKILL.md` size in UTF-8 bytes (zero for a new skill), and points to these settings. Raise the budgets only within the model's supported limit; if the provider rejects a requested budget, lower it. If the complete file cannot fit that limit, shorten the skill or select a model with a larger output limit.

`skills.targetScope` defaults to `user` to preserve existing installations: upgrading or changing storage scope does not move new skill writes to another root. Choose `storage` explicitly to follow storage scope. New suggestions record their resolved destination; drafts and redrafts keep that destination, and adoption uses the draft unless you explicitly choose another root. Suggestions from older versions without a destination use the current setting when drafted; existing drafts retain their recorded root. Improvements always write back to their original `baseKey`, regardless of this setting or a destination override.

Project roots come from the Skills Source catalog for the selected workspace, following DSH discovery (nearest `.git` ancestor, or the workspace itself); the model task's working directory is not used. A missing workspace/project or an unwritable destination produces a visible review/draft error. Mnemon does not silently fall back to user skills. Adoption checks the final selected project again: a project removed after drafting is not recreated, and you can explicitly select a user root instead. Later filesystem failures are also reported. No skills are migrated, discovery precedence is unchanged, and adoption remains an explicit user action.
Expand Down
17 changes: 17 additions & 0 deletions docs/pr-assets/issue-570-skill-draft-budgets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Skill draft output budgets

[简体中文](./README.zh-CN.md)

The real DSH 0.2.2-rc.1 WebUI runs the code from `3475288406b68e005f6e69afc67922542cf8bc12` on Node 24.22.2. The disposable `scripts/serve-e2e.mjs --without-mnemon-cli` fixture isolates its profile, workspace, memory, and skill roots and uses only a loopback model stub. No real gateway or paid model call was used.

1. Open **Plugins → dsh-mnemon → Skills → Draft generation** with self-evolution off: the budgets are 32,768 and 65,536.
2. Set them to 49,152 and 98,304 and select **Apply**: the real settings page reports that they are saved and live.
3. Reload the page and reopen the settings: both saved values remain. [Validation](./validation.json) records the readback and screenshot hashes.

![Default budgets with self-evolution off](./settings-defaults.png)

![Explicit budgets saved through the real settings page](./settings-applied.png)

The screenshots capture only the settings dialog and contain no credentials, private data, or local paths. The fixture and its test browsers were stopped after capture. These images verify settings behavior, not live-model generation quality; truncation recovery, cancellation, content guards and unchanged ledger behavior are covered by `tests/skill-evolution.spec.ts` and `tests/subagent.spec.ts`.

Full verification on the production revision passed: 2,512 root tests with 7 skips, 753 workspace tests with 3 skips, and documentation, types, deterministic builds, Headless and package checks. The official DSH 0.2.2-rc.1 root run also passed 2,512 tests with 7 skips. Two review followup regressions change only tests; the resulting skill-evolution suite passes all 53 tests.
17 changes: 17 additions & 0 deletions docs/pr-assets/issue-570-skill-draft-budgets/README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 技能草案输出预算

[English](./README.md)

真实 DSH 0.2.2-rc.1 WebUI 在 Node 24.22.2 上运行 `3475288406b68e005f6e69afc67922542cf8bc12` 的代码。一次性 `scripts/serve-e2e.mjs --without-mnemon-cli` 夹具隔离 profile、工作区、记忆和技能根目录,只配置回环模型桩,未调用真实网关或付费模型。

1. 关闭自进化时打开**插件 → 可组合记忆 → 技能管理 → 草案生成**,默认预算为 32,768 和 65,536。
2. 改为 49,152 和 98,304 后点击**应用**,真实设置页面显示“已保存并实时生效”。
3. 刷新页面并重新打开设置,两项保存值保持一致。[验证记录](./validation.json)保存了回读结果和截图摘要。

![关闭自进化时显示的默认预算](./settings-defaults.png)

![通过真实设置页面保存显式预算](./settings-applied.png)

截图只包含设置对话框,没有凭据、私有数据或本地路径。截图完成后已停止夹具及测试浏览器。图片验证设置行为,不代表真实模型生成质量;截断恢复、取消、内容校验和 ledger 保持不变由 `tests/skill-evolution.spec.ts` 与 `tests/subagent.spec.ts` 覆盖。

生产代码提交的完整验证通过:根测试 2,512 项通过、7 项跳过,工作区测试 753 项通过、3 项跳过,文档、类型、确定性构建、Headless 和包检查均通过。官方 DSH 0.2.2-rc.1 根测试同样 2,512 项通过、7 项跳过。审查补充的两项回归只修改测试,补充后技能进化测试共 53 项全部通过。
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions docs/pr-assets/issue-570-skill-draft-budgets/validation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"codeRevision": "3475288406b68e005f6e69afc67922542cf8bc12",
"host": "@deepseek-ai/dsh@0.2.2-rc.1",
"node": "24.22.2",
"locale": "zh-CN",
"fixture": "scripts/serve-e2e.mjs --without-mnemon-cli",
"defaultBudgets": {
"draftMaxTokens": 32768,
"draftRetryMaxTokens": 65536
},
"savedBudgets": {
"draftMaxTokens": 49152,
"draftRetryMaxTokens": 98304
},
"afterPageReload": {
"draftMaxTokens": 49152,
"draftRetryMaxTokens": 98304
},
"selfEvolutionEnabled": false,
"paidProviderCalls": 0,
"screenshots": {
"settings-applied.png": {
"sha256": "dcfc861b3925d72f523bba4db0c175c1d62fd27361730bf4b392c6f661dc7356",
"bytes": 82099
},
"settings-defaults.png": {
"sha256": "abfb78e2eb8570c188f5b7372e6592003b0d48b60b8f4e6d1054b20db1955f66",
"bytes": 79561
}
},
"limits": [
"Settings UI and profile persistence only; no real gateway generation was run."
]
}
3 changes: 3 additions & 0 deletions docs/zh-CN/guides/skills.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,13 @@ Agent 会按技能内容执行,技能也可能带有脚本。只安装你信
| **改进已有技能** | 开启 | 允许复盘提出已有技能的改进;两类建议均关闭时暂停复盘 |
| **新技能写入位置** | 用户 | 选择用户、项目或跟随存储范围;点击**应用**保存或**放弃**还原。改进已有技能仍写回原文件 |
| **草案自动回测** | 开启 | 草案写好后,用测试用例与当前版本对比 |
| **草案生成** | 32,768 / 65,536 token | 首次尝试 / 截断后一次扩容重试;点击**应用**保存,关闭自进化时也可设置 |
| **复盘参数** | — | 上文提到的各项阈值,默认折叠,修改后一起**应用** |
| **对话提示** | 开启 | 在每个回合下方显示**本回合技能** |
| **侧边栏入口** | 关闭 | 技能管理单独显示在侧边栏,不再放在记忆系统里 |

在**草案生成**里,将**草案输出 token 上限**和**重试输出 token 上限**设为模型提供方支持的预算,预算包含推理和完整 `SKILL.md`。两项独立配置,重试不会隐性翻倍你选择的上限。重试上限等于或小于首次值时关闭截断重试。每份草案最多尝试两次,与原有文件校验修正共用重试机会。截断输出会丢弃,只保存完整且校验通过的草案,采纳后才改动已安装技能。失败信息包含实际尝试预算与原文件大小:提供方拒绝预算时应调低;完整文件仍无法容纳时,可缩短技能或选择输出上限更高的模型。准确配置键与范围见[技能管理设置](../reference/configuration.md#技能管理设置)。

`skills.targetScope` 默认保留 `user`,兼容现有安装:升级或修改存储范围不会把新技能写到另一个根目录。需要跟随存储范围时显式选择 `storage`。新建议记录解析后的目标;草案及重新起草保留该目标,采纳沿用草案的目标,除非用户手动选择其他位置。旧版本中没有目标字段的建议在起草时使用当前设置;已有草案保留记录的目标。改进已有技能始终写回原 `baseKey`,不受设置或目标覆盖影响。

项目根来自所选工作区的 Skills Source 目录,遵循 DSH 的发现规则(最近的 `.git` 祖先目录,否则为工作区本身),不使用模型任务的工作目录。缺少工作区/项目或目标不可写时,复盘/起草会显示明确错误,不静默降级到用户技能。采纳时重新检查最终选择的项目:不会重建起草后被删除的项目,用户可以明确改选用户根目录;后续文件系统错误也会显示。不会迁移技能或改变发现优先顺序,采纳仍由用户明确操作。
Expand Down
Loading
Loading