Repository navigation
fix: batch concurrency (#429), ghost-abort rescue (#430), drain timer leak (#431), MCP orphan process (#432) and Windows skill path (#385) - #439
Closed
yeshilei-QWQ wants to merge 1 commit into
Conversation
… ghost abort rescue (huiliyi37#430), drain timer leak (huiliyi37#431), MCP orphan process (huiliyi37#432) and Windows skill path (huiliyi37#385) - fix(coordinator): scope delegate_batch prewarm, stigmergy, orderControllers, and policy tables with orderDispatchKey(order) to prevent collisions during top-level batch concurrency (huiliyi37#429) - fix(agent): clear watchdog abort state and reset abortController upon rescue if user has not explicitly aborted; differentiate watchdog stall from user Esc (huiliyi37#430) - fix(turn-orch): unref tool abort drain timer and clear it in finally block to prevent lingering event loop timer leaks (huiliyi37#431) - fix(mcp): do not drop connection registration when transport.close() throws so killChildrenSync can still terminate orphan processes (huiliyi37#432) - fix(skills): use basename(current.path) === 'SKILL.md' instead of endsWith('/SKILL.md') for Windows path separator compatibility (huiliyi37#385)
huiliyi37
pushed a commit
that referenced
this pull request
Oct 10, 2026
Owner
|
已通过 sync 流程合入 dev,感谢 @yeshilei-QWQ 的贡献 🎉 本 PR 的改动(fix: batch concurrency (#429), ghost-abort rescue (#430), drain timer leak (#431), MCP orphan process (#432) and Windows skill path (#385))已经 sync 流程合入主仓(本次 sync),并已收录进 CONTRIBUTORS.md。 按仓库的双仓流程,公开仓 PR 不经 merge 按钮合入(保持 dev 主仓唯一事实源),现以 sync-merged 标记关闭。欢迎继续贡献! |
huiliyi37
pushed a commit
that referenced
this pull request
Oct 23, 2026
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)
本 PR 修复了当前活跃存在的 5 项关键生命周期与并发稳定性缺陷(#429, #430, #431, #432, #385),并附带全量针对性单测与全量构建验证证据。
修复问题与变更详情 (Changes & Fixes)
fix(coordinator): 顶层并发 delegate_batch 批级表隔离 ([bug] 顶层 delegate_batch 并发时 order.id 碰撞,批级共享表跨批互删/污染 #429)
delegate_batch时,两批内相同order.id(如batch:0)发生碰撞,导致batchPrewarmByOrder、batchStigmergyByOrder、policyCancelledIds与orderControllers跨批互相覆盖/删除。order.id外部展示与dependsOn解析稳定的前提下,引入内部隔离键orderDispatchKey(order)索引批级私有状态表,防止并发互相干扰。src/agent/__tests__/coordinator-concurrency-tables.test.tsfix(agent): 看门狗误杀 rescue 后重置 abortController 与状态同步 ([bug] P7 watchdog ghost-abort rescue 结构性失效:rescue 后本轮仍被立即再中止 #430)
abortController.signal.aborted仍然为 true,后续步骤(如 compaction)立刻被中止;且未检查是否为用户显式 Esc 中止。abortController并清理看门狗中止标志位。src/agent/__tests__/ghost-abort-rescue.test.tsfix(turn-orch): 清理工具批 abort drain 泄漏定时器 ([bug] 工具批 abort drain 竞速定时器不 clear 也不 unref(同类先例 #184) #431)
unref()也未在批完成时clearTimeout,导致定时器堆积并拖慢进程退出高达 6s。drainTimer.unref?.(),并在 Promise 结算的finally块中执行clearTimeout(drainTimer)。fix(mcp): MCP close 失败时保留连接登记供退出兜底清理 ([bug] MCP 连接 close 失败路径被提前摘除登记,子进程沦为孤儿 #432)
shutdownServer等在transport.close()失败时提前将连接从connectionsMap 中移除,导致进程退出阶段killChildrenSync()无法感知失败连接的僵尸子进程。transport.close()成功后才从this.connections移除;若异常则保留在表中,并设置suppressReconnect,由killChildrenSync()在退出阶段兜底强杀。src/mcp/__tests__/manager-close-failure.test.tsfix(skills): 兼容 Windows 反斜杠 SKILL.md 路径解析 ([bug] Windows 技能快照构建全线失败:endsWith('/SKILL.md') 正斜杠恒假导致 Missing linked skill resource(v3.29.0) #385)
current.path.endsWith('/SKILL.md')因路径分隔符为\导致恒为 false,技能资源包扫描失败。basename(current.path) === 'SKILL.md'进行跨平台路径判定。src/skills/__tests__/skill-windows-path.test.ts测试与验证证据 (Test Evidence)
src/skills/__tests__/skill-windows-path.test.ts✔src/mcp/__tests__/manager-close-failure.test.ts✔src/agent/__tests__/coordinator-concurrency-tables.test.ts✔src/agent/__tests__/ghost-abort-rescue.test.ts✔npm test -- src/mcp/__tests__/ src/skills/__tests__/: 233/233 PASS (0 failed)npm run build: Build success in 6079ms (dist 包、Native 模块与 runtime checks 全绿)npm run typecheck: Typecheck clean (pre-push hook 自动化校验通过)