Replies: 5 comments 1 reply
|
This lifecycle-handoff proposal is a useful operator-level boundary to document alongside the implementation discussion. The handbook has a source-backed subagent strategy guide covering ownership, continuations, cancellation, and settlement handoff, plus the agent runtime map for tracing where those contracts cross model, tool, Session, and safety layers. It is community-maintained and tracks the upstream project; current release: v0.5.265. |
|
Follow-up: the Agent lifecycle guide now captures the parent-dispose / child-handoff contract from this report, including bounded hung-child reclamation and durable settlement disposition. It is published in v0.5.289: https://github.com/sandbaseai/deepseek-harness-handbook/releases/tag/v0.5.289 |
|
Follow-up 1 — Evidence chain (per source line,
2.1 Root cause: ownership level mismatch (parent exits, child stays)
2.2 Most stubborn orphan form: hung, never released
2.3 Handoff info lost: parent exits first → child settlement silently dropped
2.4 Fault silentization (makes the defect harder to spot)
2.5 Unbounded container (scale amplifier)
跟帖1 — 证据链(按源码行号,
2.1 根因:ownership 层级错配(父退子留)
2.2 孤儿最顽固形态:挂起永不释放
2.3 交接信息丢失:父先退 → 子结算静默丢
2.4 故障静默化(让缺陷更难发现)
2.5 容器无上限(规模放大)
|
|
Follow-up 2 — Fix direction (minimum-cost anchor) The correct pattern already exists in-repo (the authors know how):
→ The fix is not "rewrite lifecycle management." It is to align Fix direction (direction only, no implementation):
Priority suggestion: Note: the 跟帖2 — 修复方向(最小代价锚点) 正确模式同仓库已存在(作者会做):
→ 修复方向不是"重写全生命周期管理",而是把 修复方向(仅方向,不写具体实现):
优先级建议: 补充:该弱契约家族的 dispose 半仍未合入上游——目前只有 Jstn-1g 的社区参考实现( |
EN / EnglishWorth pulling in #4989 here — it's the same "unbounded container" pattern hitting a different module in production. HiSeax reports that That's the same structural gap as the 中文版 / ZH值得把 #4989 拉进来——是同一个「无界容器」模式,打在不同模块上,已经进了生产环境。 HiSeax 报告 这就是 #4909 证据链 2.5 节文档化的 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Several of us have independently been converging on the same pattern from different angles: a weak cross-module lifecycle contract. On #4793, Jstn-1g reproduced it against
0.1.2-alpha.1and shipped a reference fix (cleanup bound to the parent Agent's own scope; 146 tests green). argszero confirmed the dispose half is real and framed it as the dispose-side of that weak-contract family. weijiafu14 / liyangbing / nokkies surfaced the same shape from the MCP-runtime and preset-mount angles.Upstream status that matters: the option half of #4666 was natively fixed in
0.1.2-alpha.1, but the dispose half is still NOT merged into the main branch — only the community reference implementation exists. So this is not re-reporting a bug; it lifts the pattern to the architecture layer and gives the convergence view, then points at the minimum-cost fix anchor.TL;DR (30s to judge priority)
dsh-agent-loopanddsh-subagentboth use factory/fiber-level ownership; neither binds a child agent's lifecycle to its parent's dispose. Result: parent exits → child stays; orphan never released; handoff info lost; crash silently dies. The design assumes the ideal exit path; production-normal exits (crash / abort / parent-exits-first / child-hung) have no handoff contract.activationsgrows monotonically (OOM risk);drain/drainDescendantsdegrade to O(n); scheduler fault → dangling tool_calls → model 400 hard-hang.@deepseek-ai/dsh@0.1.1-rc.2).The contract is 4 links, each broken
agentsservice fiber scopedrainChildrendrainChildren/drainDescendantsare explicit APIs, no auto hookwatchSettlementwaits onwhenIdle(); hung never settlesnotifySettlementsilently returnsRoot cause is not a single line — it is ownership层级选错 + 清理靠显式调用 + 挂起靠自管 + 交付靠乐观存在 stacked together. Notably,
dsh-jobs-local/dsh-schedulein the same repo bind cleanup correctly toagent.ctx.effect— so the authors do know how;dsh-subagent's continuation manager just architecturally skipped the cascade.Evidence chain (per source line, versioned) → in follow-up 1. Fix direction (minimum-cost anchor = align
dsh-subagentto the jobs/scheduleagent.ctx.effectcascade) → in follow-up 2.中文版 / ZH
我们几个人从不同角度独立收敛到了同一个模式:跨模块生命周期契约薄弱。在 #4793,Jstn-1g 用
0.1.2-alpha.1复现并给出参考实现(cleanup 装到父 Agent 自身作用域,146 测试全绿);argszero 确认 dispose 这一半是真实的,并把它定为那个弱契约家族的 dispose 侧;weijiafu14 / liyangbing / nokkies 从 MCP 运行时和 preset 挂载角度也点出了同一形态。关键的上游状态:#4666 的 option 半已在
0.1.2-alpha.1原生修复,但 dispose 半仍未合入主分支——目前只有社区参考实现。所以这不是重复报 bug,而是把模式升到架构层、给收敛视角,再指最小代价修复锚点。TL;DR(30 秒判断优先级)
dsh-agent-loop与dsh-subagent两层都用 factory/fiber 级所有权;没有任何一层把子 agent 生命周期绑定到父 dispose。结果:父退 → 子留;孤儿不释放;交接信息丢失;崩溃静默死。设计按理想退出路径;生产常态(崩溃 / abort / 父先退 / 子挂起)没有交接契约。activations单调增长(OOM 风险);drain/drainDescendants退化为 O(n);调度异常 → 悬挂 tool_calls → 模型 400 永久卡死。@deepseek-ai/dsh@0.1.1-rc.2)。契约是 4 个环节,每一环都断
agents服务 fiber scopedrainChildrendrainChildren/drainDescendants是显式 API,无自动 hookwatchSettlement等whenIdle(),挂起永不 settlenotifySettlement静默 return根因不是某一行——是「ownership 层级选错 + 清理靠显式调用 + 挂起靠自管 + 交付靠乐观存在」四者叠加。值得指出的是:同仓库的
dsh-jobs-local/dsh-schedule都把清理正确绑定到agent.ctx.effect——说明作者会做清理,dsh-subagent的 continuation manager 只是在架构上漏做了级联。证据链(按源码行号、带版本)→ 跟帖1。修复方向(最小代价锚点 = 把
dsh-subagent对齐到 jobs/schedule 的agent.ctx.effect级联)→ 跟帖2。All reactions