Repository navigation
Conversation
A draft task whose subagent stops reporting never settles, so its suggestion stayed drafting and could not be dismissed, deleted or retried until the Host restarted. Abort the task after 15 minutes and record why, which puts the suggestion back to pending.
WanX609
force-pushed
the
fix/skill-draft-deadline
branch
from
November 5, 2026 16:52
9037d68 to
58d3972
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要 / Summary
草案子任务挂死时,建议会永远停在
drafting:background()只挂 AbortController,没有截止时间;writeDraft里的runTask一旦不返回,catch 永远不执行,忽略/删除/重试又都被前置校验挡住,只能重启宿主才恢复。本 PR 给草案任务加 15 分钟截止:超时用可区分的DraftDeadlineError中止任务,并把原因写回建议,使其回到pending可重试。A draft task whose subagent stops reporting never settles.
background()only wires an AbortController, so the catch that returns the suggestion topendingnever runs, and the page keeps showing "drafting" until the Host restarts. This gives the draft task a 15-minute deadline, aborts it with a distinguishing error, and records that reason on the suggestion.关联 Issue 或背景 / Related Issue or Context
N/A — 没有对应 Issue。现象来自本机真实使用:一条建议停在
drafting八分钟,期间账本零写入、没有lastError、也没有进度;忽略/删除被拒(a draft is being written for this suggestion),最后靠重试才成功。涉及区域 / Affected Areas
PR 类型 / PR Type
最新代码确认 / Latest Codebase Confirmation
main分支开发,或在提交前已 rebase 或合并最新main。 / I developed from the latestmain, or rebased or merged the latestmainbefore submitting.同步命令 / Sync command:
git fetch origin main;分支基于0db25213d128dfeb420163de20fd41a787366c87(fork 与上游同一提交)。AI 编码披露 / AI Coding Disclosure
使用的 AI 模型 / AI model used:DeepSeek-V4.1-Flash
使用的编码 Agent 工具 / Coding Agent tool used:DeepSeek Harness(DSH)桌面端
仓库规范检查 / Repository Rules
@deepseek-ai/*NPM 契约。src/host/protocol.ts为准,没有在两侧重复定义 wire DTO。status/lastError字段,长度仍受既有裁剪约束。lib/文件。memory subagent stopped with ...),没有新增设置键、命令或路径。.changeset/skill-draft-deadline.md)。兼容性与数据安全 / Compatibility and Data Safety
默认行为不变,只影响「草案任务超过 15 分钟仍未返回」这一条路径:超时中止任务,建议回到
pending并记录原因,不写草案、不改技能文件、不改 ledger 格式或 RPC 权限。宿主关闭时的普通 abort 不携带DraftDeadlineError,仍走原来的错误文案,已有的取消语义(不保存已完成结果)保持不动。Only the "task has not returned within 15 minutes" path changes: the task is aborted, the suggestion returns to
pendingwith the reason recorded, and no draft, skill file, ledger format, or RPC authority changes. A plain Host-shutdown abort carries noDraftDeadlineErrorand keeps the previous message.本地验证 / Local Validation
执行的命令 / Commands run:
结果摘要 / Result summary:
本地未能执行:贡献者所在网络无法克隆仓库或安装依赖,CI 为第一次完整执行,结果以 CI 为准,失败我来补。新增用例(
tests/skill-evolution.spec.ts):把草案任务的runTask换成「只在 abort 时 reject」的 promise,用 fake timers 推进 16 分钟,断言建议回到pending且lastError为skill draft did not finish within 15 minutes。改动 / Changes
src/host/skill-evolution.tsbackground()增加可选deadlineMs:到期以DraftDeadlineError调用controller.abort(),并在 finally 里清定时器。draft()传DRAFT_DEADLINE_MS(15 分钟),catch 记录deadlineReason(signal) ?? error。deadlineReason()只认DraftDeadlineError,宿主关闭的普通 abort 不受影响。tests/skill-evolution.spec.ts:新增 1 个用例。.changeset/skill-draft-deadline.md:patch。