Skip to content

fix(skills): configure draft budgets and retry truncated generation - #571

Merged
Grivn merged 4 commits into
mainfrom
codex/fix-570-skill-draft-budget
Nov 5, 2026
Merged

Grivn merged 4 commits into
mainfrom
codex/fix-570-skill-draft-budget

Conversation

@Grivn

@Grivn Grivn commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

摘要 / Summary

技能草案要求返回完整 SKILL.md,原先与复盘和评测共用写死的 16,384 token 预算,遇到 max-tokens 就整轮失败。新增只用于草案的首次 32,768 / 重试 65,536 显式预算;仅真实截断且第二预算更大时以新任务重新生成一次,与原有内容修正共用最多两次尝试,不保存截断内容,取消不重试。

Drafts previously failed before the file-validation retry because every skill operation shared a fixed 16k output budget. Add validated, draft-only initial and retry budgets (skills.draftMaxTokens / skills.draftRetryMaxTokens, integers 128–131072). The retry never silently exceeds a configured cap. Other skill operations retain their budgets. Errors retain actual attempted budgets, source UTF-8 byte size, settings location and provider-limit guidance within the UI's 500-character error field.

关联 Issue 或背景 / Related Issue or Context

Closes #570.

涉及区域 / Affected Areas

  • Host 激活、Headless 或 bundle / Host activation, Headless, or bundle
  • 运行时记忆 / Runtime Memory
  • 项目档案 / Project Documents
  • 记忆空间或 Provider / Memory Spaces or Providers
  • 子 Agent 或 Agent 工作流 / Subagent or Agent workflow
  • Web UI 或对话交互 / Web UI or conversation interaction
  • 设置、存储或安全 / Settings, storage, or security
  • CLI、RPC、命令或工具 / CLI, RPC, commands, or tools
  • 安装、更新或发布 / Installation, update, or release
  • 测试、构建或文档 / Tests, build, or documentation
  • 其他(请说明)/ Other (explain below)

PR 类型 / PR Type

  • 面向用户的功能或行为变更 / User-facing feature or behavior change
  • Bug 修复 / Bug fix
  • 增强或优化 / Enhancement or optimization
  • 兼容性适配 / Compatibility change
  • 维护或重构 / Maintenance or refactor
  • 测试或构建 / Tests or build

最新代码确认 / Latest Codebase Confirmation

  • 我已基于最新 main 分支开发,或在提交前已 rebase 或合并最新 main。 / I developed from the latest main, or rebased or merged the latest main before submitting.

同步命令 / Sync command:

git fetch origin main
git merge --no-ff --no-commit origin/main

Merged latest main cd1fe02c2f4ecd46a46d53c0b336e58add4821eb, including #566 and #567, while preserving both histories. The only conflicts were adjacent imports and independent configuration tests; both sides are retained. / 已通过普通合并纳入最新 main(含 #566、#567),保留全部原提交;仅相邻 import 与独立配置测试冲突,双方内容均保留。

AI 编码披露 / AI Coding Disclosure

  • 完全 AI 编码:全部编程改动由 AI 产出,并由贡献者接受和审查。 / Fully AI-coded: AI produced all programming changes, which the contributor accepted and reviewed.
  • 部分 AI 辅助:AI 帮助编写或修改了部分内容。 / Partially AI-assisted: AI helped write or modify part of the change.
  • 未使用 AI 编码辅助。 / No AI coding assistance was used.

使用的 AI 模型 / AI model used: GPT-6 (Codex)

使用的编码 Agent 工具 / Coding Agent tool used: OpenAI Codex desktop; implementation and independent code review used separate Codex agents. / 实现与独立代码审查由独立 Codex agents 执行。

仓库规范检查 / Repository Rules

  • 未修改 DSH 官方源码,未让 tsconfig 指向 DSH 源码 checkout,仅使用正式的 @deepseek-ai/* NPM 契约。 / I did not modify DSH source or point tsconfig at a DSH source checkout, and used only published @deepseek-ai/* NPM contracts.
  • Client 与 Host 边界仍以浏览器安全的 src/host/protocol.ts 为准,没有在两侧重复定义 wire DTO。 / The Client and Host boundary still uses browser-safe src/host/protocol.ts as the source for wire DTOs.
  • 持久化格式、RPC 权限、路径或凭据处理的变更包含兼容或拒绝路径、安全分析和相应测试。 / Changes to persistence formats, RPC authority, paths, or credentials include compatibility or rejection paths, security analysis, and tests.
  • 没有提交 token、密钥、私有记忆、未脱敏日志或生成的 lib/ 文件。 / I did not commit tokens, credentials, private memory, unredacted logs, or generated lib/ files.
  • 用户可见文案和长期文档已同步维护中文与英文版本,命令、配置键和路径保持一致。 / User-facing copy and long-lived documentation are synchronized in Chinese and English, with matching commands, configuration keys, and paths.
  • 会改变发布制品或其元数据的 PR 已添加 changeset;仅测试、CI 或站点文档变更可不添加。 / A PR that changes a published artifact or its metadata includes a changeset; test-only, CI-only, and site-documentation-only changes may omit one.
  • 新增和修改的代码、注释、文档、提交信息不含 emoji。 / New and modified code, comments, documentation, and commits contain no emoji.

兼容性与数据安全 / Compatibility and Data Safety

新增两项可选 Skills 设置,旧配置使用默认值,不迁移技能或 ledger 格式,不更改 RPC 权限、路径或凭据。生成只保存完整且通过原有校验的草案,已安装技能仍由用户明确采纳后修改。截断失败不会写入新草案,已有草案保留;关联建议回到 pending 并记录错误。取消后即使模型已返回完整结果也不保存。重试预算等于或小于首次预算可关闭截断重试;两项预算均须符合模型提供方的上限。

The new optional settings default for existing installations. No storage-format, authority, credential or installed-skill changes are introduced. Drafts still pass schema/content checks and require explicit adoption. Both attempts stay within their explicit budgets; providers with lower caps need lower settings. A model that cannot fit the full file needs a shorter skill or a higher-capacity model. All verification uses synthetic local data; the issue reporter's real gateway and Windows environment were not exercised.

本地验证 / Local Validation

执行的命令 / Commands run:

Node 24.22.2:

pnpm run verify
pnpm run typecheck
pnpm exec vitest run --dir tests tests/subagent.spec.ts tests/skill-evolution.spec.ts tests/config.spec.ts tests/task-agent-session-host.spec.ts tests/activation-agent-compat.spec.ts tests/subagent-start.spec.ts tests/lifecycle.spec.ts tests/review-tools.spec.ts
DSH_HOST_ROOT=/path/to/installed/dsh-0.2.2-rc.1 pnpm exec vitest run --config scripts/installed-dsh.config.ts tests/subagent.spec.ts tests/skill-evolution.spec.ts tests/config.spec.ts tests/task-agent-session-host.spec.ts tests/activation-agent-compat.spec.ts tests/subagent-start.spec.ts tests/lifecycle.spec.ts tests/review-tools.spec.ts
git diff --check

结果摘要 / Result summary:

  • Final merged revision bc85d88a0962ce2b13617bf98696434ba5c2a846: complete verify passed, with 2,550 root tests passed / 8 skipped (170 passed files / 2 skipped), and 759 workspace tests passed / 3 skipped across 18 projects, including 95/95 Skills Source tests. Documentation, type checks, deterministic builds, Headless activation, public entry checks and package lint all passed. / 含 fix(skills): remove dead suggestion links from evidence #566、fix(host): preserve DSH task agents and allow user continuation #567 的最终合并提交已完整验证通过。
  • After integrating fix(host): preserve DSH task agents and allow user continuation #567, the affected coordinator, lifecycle, task continuation, settings and skill suites passed on both the repository dependencies and official DSH 0.2.2-rc.1: 476 passed / 1 skipped across 12 files. fix(skills): remove dead suggestion links from evidence #566 was then merged without conflicts and the full verification above was rerun. / fix(host): preserve DSH task agents and allow user continuation #567 合入后,默认依赖及官方 rc.1 的受影响测试均通过;fix(skills): remove dead suggestion links from evidence #566 无冲突合入后重新执行了上述全量验证。
  • The 53 skill-evolution tests include fresh-task truncation recovery, exhausted retry with a byte-identical saved ledger, invalid file rejection, disabled retry, both cancellation timing branches and no third attempt after file-validation repair. Other regressions cover unchanged non-draft budgets, persistent settings validation and actionable errors after long provider diagnostics. / 回归覆盖预算、重试、取消、持久化与错误提示边界。
  • Independent review found no Critical/Important issue; the draft-budget implementation is unchanged by the integration merges. / 独立审查无 Critical/Important 问题,整合 main 未改写草案预算实现。
  • No paid model calls or live-gateway reproduction. / 未运行付费模型或真实网关复现。

用户可见变更证据 / Local Feature Evidence

证据 / Evidence:

English evidence · 中文证据

Real isolated rc.1 WebUI: with self-evolution off, defaults are 32768 / 65536; saving 49152 / 98304 shows success, and both values survive page reload. Screenshots contain only the settings dialog, without private data, credentials or local paths. / 真实隔离 rc.1 WebUI 已验证默认值、保存成功和刷新后回读;截图无私有数据、凭据和本地路径。

Draft budgets saved in the real WebUI

@Grivn
Grivn merged commit 6f22139 into main Nov 5, 2026
12 checks passed
@Grivn Grivn mentioned this pull request Nov 5, 2026
13 of 15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant